#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE = 1 DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk PYVERS = $(shell pyversions -r) LAST_CHANGE = $(shell dpkg-parsechangelog -S Date) BUILD_DATE = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)") SPHINXOPTS := -D html_last_updated_fmt=\"$(BUILD_DATE)\" build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: $(PYVERS:%=build-ext-%-stamp) $(PYVERS:%=dbg-build-ext-%-stamp) touch $@ build-ext-%-stamp: dh_testdir $* setup.py build touch $@ dbg-build-ext-%-stamp: dh_testdir $*-dbg setup.py build -g touch $@ clean: dh_testdir dh_testroot rm -f build*stamp dbg-build*stamp rm -rf build find . -name '*.pyc' | xargs rm -f dh_clean install: build install-prereq $(PYVERS:%=install-ext-%) $(PYVERS:%=dbg-install-ext-%) install-prereq: dh_testdir dh_testroot dh_prep dh_installdirs install-ext-%: $* setup.py install --root=$(CURDIR)/debian/python-pysqlite2 --install-layout=deb rm -rf debian/python-pysqlite2/usr/pysqlite2-doc rm -rf debian/python-pysqlite2/usr/bin find debian -type d -wholename '*pysqlite2/test' | xargs rm -rf find debian/python-pysqlite2 -name '*.pyc' | xargs rm -f dbg-install-ext-%: $*-dbg setup.py install --root=$(CURDIR)/debian/python-pysqlite2-dbg --install-layout=deb find debian/python-*-dbg ! -type d ! -name '*.so' | xargs rm -f find debian/python-*-dbg -depth -empty -exec rmdir {} \; # Build architecture-independent files here. binary-indep: dh_testdir dh_testroot dh_prep dh_installdirs -i usr/share/doc/python-pysqlite2-doc/html python setup.py build_docs --sphinxopts="$(SPHINXOPTS)" dh_installdocs -i build/doc/* cd debian/python-pysqlite2-doc/usr/share/doc/python-pysqlite2-doc && \ mv *.html *.js *.inv _static _sources html && \ ln -sf ../../../../javascript/jquery/jquery.js html/_static/jquery.js && \ ln -sf ../../../../javascript/underscore/underscore.js html/_static/underscore.js dh_installchangelogs -i dh_compress -i -Xjson -Xtxt -Xjs dh_fixperms -i dh_installdeb -i dh_shlibdeps -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i # Build architecture-dependent files here. binary-arch: build install dh_testdir -a dh_testroot -a dh_installdocs -a dh_python2 -a dh_installchangelogs -a dh_strip -ppython-pysqlite2 --dbg-package=python-pysqlite2-dbg rm -rf debian/python-pysqlite2-dbg/usr/share/doc/python-pysqlite2-dbg ln -s python-pysqlite2 debian/python-pysqlite2-dbg/usr/share/doc/python-pysqlite2-dbg dh_compress -a dh_fixperms -a dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary: binary-indep binary-arch .PHONY: build build-arch build-indep .PHONY: clean .PHONY: install install-prereq .PHONY: binary-indep binary-arch binary