Created
October 11, 2012 22:16
-
-
Save nightsh/3875880 to your computer and use it in GitHub Desktop.
debian/rules for python-virtkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/make -f | |
# -*- makefile -*- | |
# Uncomment this to turn on verbose mode. | |
export DH_VERBOSE=1 | |
PYVERS := $(shell pyversions -vs) | |
PYVER := $(shell pyversions -vd) | |
PY3VERS := $(shell py3versions -vs) | |
PY3VER := $(shell py3versions -vd) | |
UPSTREAMVER := $(subst virtkey-,,$(notdir $(CURDIR))) | |
include /usr/share/python3/python.mk | |
prebuild: prebuild-stamp | |
prebuild-stamp: src/virtkey/virtkey.etree.pyx src/virtkey/virtkey.objectify.pyx | |
touch $@ | |
build-arch: build | |
build-indep: build | |
build: build-stamp build3-stamp | |
build-stamp: $(PYVERS:%=build-python%) $(PYVERS:%=dbg-build-python%) | |
touch $@ | |
build-python%: prebuild | |
python$* setup.py build | |
touch $@ | |
dbg-build-python%: prebuild | |
python$*-dbg setup.py build | |
touch $@ | |
build3-stamp: $(PY3VERS:%=build3-python%) $(PY3VERS:%=dbg-build3-python%) | |
touch $@ | |
build3-python%: prebuild | |
python$* setup.py build | |
touch $@ | |
dbg-build3-python%: prebuild | |
python$*-dbg setup.py build | |
touch $@ | |
clean: | |
dh_testdir | |
dh_testroot | |
rm -f build*-stamp build*-python* dbg-build*-python* prebuild-stamp | |
rm -rf build dist __pycache__ | |
# rm -f src/virtkey/virtkey.etree_api.h src/virtkey/virtkey.etree.c \ | |
# src/virtkey/virtkey.etree.h src/virtkey/virtkey.objectify.c | |
-find -name '*.py[co]' | xargs rm -f | |
rm -rf [23].[0-9] | |
rm -f src/virtkey/virtkey-version.h | |
dh_clean | |
install: build install-prereq $(PYVERS:%=install-python%) $(PYVERS:%=dbg-install-python%) $(PY3VERS:%=install3-python%) $(PY3VERS:%=dbg-install3-python%) | |
-find debian -name '*.py[co]' | xargs rm -f | |
-find debian -name __pycache__ | xargs rm -rf | |
rm -rf debian/python*-virtkey/usr/lib/python | |
install-prereq: | |
dh_testdir | |
dh_testroot | |
dh_clean -k | |
install-python%: | |
mkdir -p debian/python-virtkey/usr/bin | |
mkdir -p debian/python-virtkey/$(call py_libdir, $*) | |
python$* setup.py install \ | |
--root=$(CURDIR)/debian/python-virtkey --install-layout=deb | |
dbg-install-python%: | |
mkdir -p debian/python-virtkey/usr/bin | |
mkdir -p debian/python-virtkey-dbg/$(call py_libdir, $*) | |
python$*-dbg setup.py install \ | |
--root=$(CURDIR)/debian/python-virtkey-dbg --install-layout=deb | |
find debian/python-*-dbg ! -type d ! -name '*.so' | xargs rm -f | |
find debian/python-*-dbg -depth -empty -exec rmdir {} \; | |
install3-python%: | |
mkdir -p debian/python3-virtkey/usr/bin | |
mkdir -p debian/python3-virtkey/$(call py_libdir, $*) | |
python$* setup.py install \ | |
--root=$(CURDIR)/debian/python3-virtkey --install-layout=deb | |
dbg-install3-python%: | |
mkdir -p debian/python3-virtkey/usr/bin | |
mkdir -p debian/python3-virtkey-dbg/$(call py_libdir, $*) | |
python$*-dbg setup.py install \ | |
--root=$(CURDIR)/debian/python3-virtkey-dbg --install-layout=deb | |
find debian/python3-*-dbg ! -type d ! -name '*.so' | xargs rm -f | |
find debian/python3-*-dbg -depth -empty -exec rmdir {} \; | |
# Build architecture-independent files here. | |
binary-indep: build install | |
dh_testdir | |
dh_testroot | |
dh_installchangelogs -i | |
dh_installdocs -i | |
mkdir -p debian/python-virtkey-doc/usr/share/doc/python-virtkey | |
cp -r doc/html debian/python-virtkey-doc/usr/share/doc/python-virtkey/ | |
ln -sf ../python-virtkey/html debian/python-virtkey-doc/usr/share/doc/python-virtkey-doc/html | |
dh_installexamples -i samples/* | |
dh_compress -i -X.xml -X.py \ | |
-X.html -X.css -X.asc -X.png -Xapi-objects.txt | |
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 | |
dh_testroot | |
dh_installchangelogs -a CHANGES.txt | |
dh_installdocs -a CREDITS.txt README.rst TODO.txt | |
dh_installexamples -a samples/* | |
dh_python2 -a | |
dh_python3 -a | |
dh_strip -ppython-virtkey --dbg-package=python-virtkey-dbg | |
rm -rf debian/python-virtkey-dbg/usr/share/doc/python-virtkey-dbg | |
ln -s python-virtkey debian/python-virtkey-dbg/usr/share/doc/python-virtkey-dbg | |
dh_strip -ppython3-virtkey --dbg-package=python3-virtkey-dbg | |
rm -rf debian/python3-virtkey-dbg/usr/share/doc/python3-virtkey-dbg | |
ln -s python3-virtkey debian/python3-virtkey-dbg/usr/share/doc/python3-virtkey-dbg | |
dh_compress -a -X.xml -X.py \ | |
-X.html -X.css -X.asc -X.png -Xapi-objects.txt | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment