#!/usr/bin/make -f # all versions PYVERSIONS=$(shell pyversions -vs) # default version VER := $(shell /usr/bin/python -c 'import sys; print sys.version[:3]') DEFAULT_PYTHON = python$(VER) kjb_version=1:$(shell dpkg-parsechangelog | sed -n 's/^Version: //p') include /usr/share/python/python.mk build: build-indep build-arch build-indep: build-indep-stamp build-indep-stamp: dh_testdir for v in $(PYVERSIONS); do \ python$$v setup.py build || exit 1; \ done touch $@ build-arch: build-arch-stamp build-arch-stamp: dh_testdir cd kjbuckets && \ for v in $(PYVERSIONS); do \ python$$v setup.py build || exit 1; \ done touch $@ clean: dh_testdir dh_testroot rm -f build-indep-stamp build-arch-stamp for v in $(PYVERSIONS); do \ python$$v setup.py clean --all; \ done cd kjbuckets && \ for v in $(PYVERSIONS); do \ python$$v setup.py clean --all; \ done dh_clean binary: binary-indep binary-arch # pythonX.Y-gadfly, python-gadfly & gadfly & python-kjbuckets (default) binary-indep: build-indep dh_testdir -i dh_testroot -i dh_prep -i dh_installdirs -i : # python-gadfly dh_installdocs -ppython-gadfly -Xinstallation -Xkjbuckets \ -Xstructure -Xgfplus TODO.txt doc/*.txt dh_installexamples -ppython-gadfly doc/demo/kjParsing/* for v in $(PYVERSIONS); do \ python$$v setup.py install_lib --install-dir \ debian/python-gadfly/usr/lib/python$$v/$(call py_sitename_sh, $$v) \ --no-compile || exit 1; \ done : # gadfly /usr/bin/python setup.py install_scripts \ --install-dir debian/gadfly/usr/bin dh_installdocs -pgadfly -Xinstallation -Xkjbuckets -Xstructure \ -Xgadfly -XkwParsing TODO.txt doc/*.txt dh_python2 -i : # python-gadfly dh_installdocs -ppython-gadfly dh_gencontrol -ppython-gadfly dh_installchangelogs -i CHANGES.txt dh_compress -i -X.py perl debian/dh_fixpythonscripts -i dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i # python-kjbuckets (version-specific) binary-arch: build-arch dh_testdir -a dh_testroot -a dh_prep -a dh_installdirs -a cd kjbuckets && \ for v in $(PYVERSIONS); do \ python$$v setup.py install --install-layout=deb \ --root $(CURDIR)/debian/python-kjbuckets $(py_setup_install_args) || exit 1; \ done dh_installchangelogs -a CHANGES.txt dh_installdocs -a doc/kjbuckets.txt dh_installexamples -a doc/demo/kjbuckets/* dh_strip -a dh_compress -a -X.py perl debian/dh_fixpythonscripts -a dh_fixperms -a dh_python2 -a dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a -- -v'$(kjb_version)' dh_md5sums -a dh_builddeb -a .PHONY: build build-indep build-arch clean binary binary-indep binary-arch