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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
#!/usr/bin/make -f
PYTHON_VERSIONS=$(shell pyversions -vs)
-include /usr/share/python/python.mk
docdir=debian/tmp/python-oss/usr/share/doc/python-oss
build: build-pre $(PYTHON_VERSIONS:%=build-python-%)
build-pre:
test -e debian/control
$(MAKE) all ossmodule.html ossmodule.txt
build-python-%:
/usr/bin/python$* setup.py build
clean:
test -e debian/control
test root = "`whoami`" || (echo need root priviledges; exit 1)
rm -rf build debian/tmp
find . -type f -name '*.pyc' -print0 \
| xargs -0 --no-run-if-empty rm --
rm -rf debian/substvars debian/files
$(MAKE) clean
install-pre:
test -e debian/control
test root = "`whoami`" || (echo need root priviledges; exit 1)
rm -rf debian/substvars
install -d -m0755 'debian/tmp/python-oss'
install-python-%: build
/usr/bin/python$* setup.py install --root='debian/tmp/python-oss' --prefix=/usr $(py_setup_install_args)
install: build install-pre $(PYTHON_VERSIONS:%=install-python-%)
# Don't ship *.pyc files
find debian/tmp -type f -name '*.pyc' -print0 \
| xargs -0 --no-run-if-empty rm --
chmod -R go-w 'debian/tmp/python-oss'
install -d --mode=0755 '$(docdir)'
install --mode=0644 \
README \
ossmodule.txt \
ossmodule.html \
debian/copyright \
'$(docdir)'
install --mode=0644 \
debian/changelog \
'$(docdir)/changelog.Debian'
gzip -9f \
'$(docdir)/README' \
'$(docdir)/ossmodule.txt' \
'$(docdir)/ossmodule.html' \
'$(docdir)/changelog.Debian'
find 'debian/tmp/python-oss/usr/lib' -name '*.so' -print0 \
| xargs -0 --no-run-if-empty \
strip --remove-section=.comment \
--remove-section=.note --strip-unneeded
binary: binary-indep binary-arch
binary-indep:
binary-arch: install
test -e debian/control
test root = "`whoami`" || (echo need root priviledges; exit 1)
install -d --mode=0755 'debian/tmp/python-oss/DEBIAN'
dpkg-shlibdeps `find 'debian/tmp/python-oss/usr/lib' -name '*.so'`
echo "python:Versions=$(PYTHON_VERSIONS)" | sed 's/ /, /g' >> debian/substvars
dpkg-gencontrol -p'python-oss' -P'debian/tmp/python-oss'
dpkg --build 'debian/tmp/python-oss' ..
.PHONY: build clean binary-indep binary-arch binary
|