forked from rackerlabs/puppet-repose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (40 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
PACKAGE := $(shell basename *.spec .spec)
ARCH = noarch
RPMBUILD = rpmbuild --define "_topdir %(pwd)/build" \
--define "_sourcedir %{_topdir}/sdist" \
--define "_builddir %{_topdir}/rpm-build" \
--define "_srcrpmdir %{_rpmdir}" \
--define "_rpmdir %{_topdir}/rpms"
INSTALLDIR=/etc/puppet/modules/${PACKAGE}
BUILDDIR=build
DISTDIR=${BUILDDIR}/sdist
RPMBUILDDIR=${BUILDDIR}/rpm-build
RPMDIR=${BUILDDIR}/rpms
all: rpms
clean:
rm -rf ${BUILDDIR}/ *~
install:
mkdir -p ${INSTALLDIR}
cp -pr . ${INSTALLDIR}
install_rpms: rpms
rpm -Uvh ${RPMDIR}/${ARCH}/${PACKAGE}*.${ARCH}.rpm
reinstall: uninstall install
uninstall: clean
rm -f ${INSTALLDIR}
uninstall_rpms: clean
rpm -e ${PACKAGE}
sdist:
mkdir -p ${DISTDIR}
tar -czf ${DISTDIR}/${PACKAGE}.tgz \
--exclude ".git" --exclude "*.log" \
--exclude "Makefile" --exclude "README*" \
--exclude "*.spec" --exclude "build" \
./
prep_rpmbuild: sdist
mkdir -p ${RPMBUILDDIR}
mkdir -p ${RPMDIR}
cp ${DISTDIR}/${PACKAGE}.tgz ${RPMBUILDDIR}/
rpms: prep_rpmbuild
${RPMBUILD} -ba ${PACKAGE}.spec
srpm: prep_rpmbuild
${RPMBUILD} -bs ${PACKAGE}.spec