2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
5 # Modified to make a template file for a multi-binary package with separated
6 # build-arch and build-indep targets by Bill Allombert 2001
8 # Uncomment this to turn on verbose mode.
11 # This has to be exported to make some magic below work.
14 PYVERS := $(shell pyversions -vr)
15 PY3VERS := $(shell py3versions -vr)
17 PKGROOT=$(CURDIR)/debian/python-pyxattr
18 DBGROOT=$(CURDIR)/debian/python-pyxattr-dbg
19 PKG3ROOT=$(CURDIR)/debian/python3-pyxattr
20 DBG3ROOT=$(CURDIR)/debian/python3-pyxattr-dbg
22 build: build-arch build-indep
25 build-arch: $(PYVERS:%=build-python%) $(PY3VERS:%=build-python%)
30 python$* setup.py build
31 python$*-dbg setup.py build
40 rm -f build-indep build-arch
42 rm -f $(PYVERS:%=build-python%)
43 rm -f $(PY3VERS:%=build-python%)
44 rm -rf pxattr.egg-info
47 install: build $(PYVERS:%=install-python%) $(PY3VERS:%=install-python%)
48 find $(DBGROOT) ! -type d ! -name '*_d.so' | xargs rm -f
49 find $(DBGROOT) -depth -empty -print0 | xargs -r0 rmdir
52 python2$* setup.py install --root $(PKGROOT) --install-layout=deb
53 python2$*-dbg setup.py install --root $(DBGROOT) --install-layout=deb
56 python3$* setup.py install --root $(PKG3ROOT) --install-layout=deb
57 python3$*-dbg setup.py install --root $(DBG3ROOT) --install-layout=deb
59 # Build architecture-dependent files here.
60 binary-arch: build install
66 dh_strip -ppython-pyxattr --dbg-package=python-pyxattr-dbg
67 dh_strip -ppython3-pyxattr --dbg-package=python3-pyxattr-dbg
68 rm -rf $(DBGROOT)/usr/share/doc/python-pyxattr-dbg
69 ln -s python-pyxattr $(DBGROOT)/usr/share/doc/python-pyxattr-dbg
70 rm -rf $(DBG3ROOT)/usr/share/doc/python3-pyxattr-dbg
71 ln -s python3-pyxattr $(DBG3ROOT)/usr/share/doc/python3-pyxattr-dbg
82 # Build architecture independant packages here.
83 binary-indep: build install
86 binary: binary-arch binary-indep
87 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure