forked from major/supernova
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (35 loc) · 978 Bytes
/
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
PACKAGE := $(shell basename *.spec .spec)
ARCH = noarch
RPMBUILD = rpmbuild --define "_topdir %(pwd)/rpmbuild" \
--define "_builddir %{_topdir}" \
--define "_rpmdir %(pwd)/rpms" \
--define "_srcrpmdir %{_rpmdir}" \
--define "_sourcedir %{_topdir}"
PREFIX = ${DESTDIR}/usr
all: rpms
clean:
rm -rf dist/ build/ rpmbuild/ rpms/
rm -rf docs/*.gz MANIFEST *~ *.egg-info
find . -name '*.pyc' -exec rm -f {} \;
build: clean
python setup.py build -f
install: build
python setup.py install -f --prefix ${PREFIX}
reinstall: uninstall install
install_rpms:
yum install rpms/${ARCH}/${PACKAGE}*.rpm
uninstall: clean
rm -f ${PREFIX}/bin/${PACKAGE}
rm -rf ${PREFIX}/lib/python2.*/site-packages/${PACKAGE}
uninstall_rpms: clean
rpm -e ${PACKAGE}
sdist:
python setup.py sdist
prep_rpmbuild: build sdist
mkdir -p rpmbuild
mkdir -p rpms
cp dist/*.gz rpmbuild/
rpms: prep_rpmbuild
${RPMBUILD} -ba ${PACKAGE}.spec
srpm: prep_rpmbuild
${RPMBUILD} -bs ${PACKAGE}.spec