#!/usr/bin/make -f #export DH_VERBOSE=1 p_name=python-sqlalchemy PYVERS=$(shell pyversions -vr) PY3VERS=$(shell py3versions -vr '>= 3.0') pkgdir = $(CURDIR)/debian/python$(if $(patsubst 3.%,,$(1)),,3)-sqlalchemy include /usr/share/python/python.mk DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/buildflags.mk clean: dh_testdir dh_testroot rm -rf $(CURDIR)/lib/SQLAlchemy.egg-info $(CURDIR)/build/ find . -name '*\.py[co]' -delete dh_clean build-docs build-stamp install-docs \ $(PYVERS:%=install-python%) $(PYVERS:%=build-python%) \ $(PYVERS:%=install-debug-python%) $(PYVERS:%=build-debug-python%) \ $(PY3VERS:%=install-python%) $(PY3VERS:%=build-python%) \ $(PHONYY3VERS:%=install-debug-python%) $(PY3VERS:%=build-debug-python%) build: build-arch build-arch: $(PYVERS:%=build-python%) $(PY3VERS:%=build-python%) build-python%: python$* ./setup.py build touch $@ build-debug-python%: python$*-dbg setup.py build touch $@ build-indep: build-docs build-docs: dh_testdir dh_installdirs -i cd doc/build && python3 -m sphinx -N -E -b html . \ ../../debian/${p_name}-doc/usr/share/doc/${p_name}-doc/html/ rm -rf debian/${p_name}-doc/usr/share/doc/${p_name}-doc/html/.doctrees touch $@ install-docs: build-docs dh_testdir dh_installdirs -i cp -r doc/build/ debian/${p_name}-doc/usr/share/doc/${p_name}-doc/rst/ cd debian/${p_name}-doc/usr/share/doc/${p_name}-doc/rst/\ && rm -f '*.py' '*.html' '*.png' \ && rm -rf texinputs/ dh_link -p${p_name}-doc /usr/share/javascript/jquery/jquery.js \ /usr/share/doc/${p_name}-doc/html/_static/jquery.js dh_link -p${p_name}-doc /usr/share/javascript/underscore/underscore.js \ /usr/share/doc/${p_name}-doc/html/_static/underscore.js # link docs in python-sqlalchemy's dir dh_link -p${p_name}-doc /usr/share/doc/${p_name}-doc/html \ /usr/share/doc/${p_name}/html dh_link -p${p_name}-doc /usr/share/doc/${p_name}-doc/rst \ /usr/share/doc/${p_name}/rst dh_link -p${p_name}-doc /usr/share/doc/${p_name}-doc/html \ /usr/share/doc/python3-sqlalchemy/html dh_link -p${p_name}-doc /usr/share/doc/${p_name}-doc/rst \ /usr/share/doc/python3-sqlalchemy/rst touch $@ install: build $(PYVERS:%=install-python%) $(PY3VERS:%=install-python%) install-python%: build python$* ./setup.py install --skip-build \ --root $(call pkgdir,$*) $(py_setup_install_args) # move extensions to -ext binary package mkdir -p $(call pkgdir,$*)-ext$(call py_libdir,$*)/sqlalchemy mv $(call pkgdir,$*)$(call py_libdir,$*)/sqlalchemy/*so \ $(call pkgdir,$*)-ext$(call py_libdir,$*)/sqlalchemy/ touch $@ binary-indep: build install install-docs dh_testdir -i dh_testroot -i dh_installchangelogs -i -p python-sqlalchemy-doc -X doc/changelog -X CHANGES dh_installchangelogs -i -N python-sqlalchemy-doc -X doc/changelog -X CHANGES dh_installdocs -i dh_installexamples -i rm -rf debian/${p_name}-doc/usr/share/doc/${p_name}-doc/doc/build \ debian/${p_name}-doc/usr/share/doc/${p_name}-doc/examples/README rm -f debian/python3-sqlalchemy/usr/share/doc/python3-sqlalchemy/NEWS.Debian -find debian/python-sqlalchemy-doc/. -type d -name __pycache__ -exec rm -rf {} \; dh_python2 -i dh_python3 -i dh_compress -i -X.py -X.js -X.html -X.inv -Xrst dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i binary-arch: build install dh_testdir dh_testroot dh_installchangelogs -a -X doc/changelog -X CHANGES dh_installdocs -a dh_python2 -a dh_python3 -a dh_makeshlibs -a dh_strip -a dh_compress -a -X.py 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 clean binary-indep binary-arch binary install