#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # # Modified to make a template file for a multi-binary package with separated # build-arch and build-indep targets by Bill Allombert 2001 # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This has to be exported to make some magic below work. export DH_OPTIONS PYVERS := $(shell pyversions -vr) PY3VERS := $(shell py3versions -vr) PKGROOT=$(CURDIR)/debian/python-pyxattr DBGROOT=$(CURDIR)/debian/python-pyxattr-dbg PKG3ROOT=$(CURDIR)/debian/python3-pyxattr DBG3ROOT=$(CURDIR)/debian/python3-pyxattr-dbg export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk build: build-arch build-indep touch $@ build-arch: $(PYVERS:%=build-python%) $(PY3VERS:%=build-python%) $(MAKE) doc touch $@ build-python%: python$* setup.py build python$*-dbg setup.py build touch $@ build-indep: touch $@ clean: dh_testdir dh_testroot rm -f build-indep build-arch $(MAKE) clean rm -f $(PYVERS:%=build-python%) rm -f $(PY3VERS:%=build-python%) rm -rf pxattr.egg-info dh_clean install: build $(PYVERS:%=install-python%) $(PY3VERS:%=install-python%) find $(DBGROOT) ! -type d ! -name '*_d.so' | xargs rm -f find $(DBGROOT) -depth -empty -print0 | xargs -r0 rmdir install-python2%: python2$* setup.py install --root $(PKGROOT) --install-layout=deb python2$*-dbg setup.py install --root $(DBGROOT) --install-layout=deb install-python3%: python3$* setup.py install --root $(PKG3ROOT) --install-layout=deb python3$*-dbg setup.py install --root $(DBG3ROOT) --install-layout=deb # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_sphinxdoc dh_strip -ppython-pyxattr --dbg-package=python-pyxattr-dbg dh_strip -ppython3-pyxattr --dbg-package=python3-pyxattr-dbg rm -rf $(DBGROOT)/usr/share/doc/python-pyxattr-dbg ln -s python-pyxattr $(DBGROOT)/usr/share/doc/python-pyxattr-dbg rm -rf $(DBG3ROOT)/usr/share/doc/python3-pyxattr-dbg ln -s python3-pyxattr $(DBG3ROOT)/usr/share/doc/python3-pyxattr-dbg dh_compress -X.js dh_fixperms dh_python2 dh_python3 dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb # Build architecture independant packages here. binary-indep: build install # Nothing to do binary: binary-arch binary-indep .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure