| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
# Uncomment this to turn on verbose mode. |
| 5 |
#export DH_VERBOSE=1 |
| 6 |
DPKG_EXPORT_BUILDFLAGS = 1 |
| 7 |
|
| 8 |
PY3VERS := $(shell py3versions -vs) |
| 9 |
PY3VER := $(shell py3versions -vd) |
| 10 |
|
| 11 |
include /usr/share/dpkg/pkg-info.mk |
| 12 |
include /usr/share/dpkg/buildflags.mk |
| 13 |
include /usr/share/python3/python.mk |
| 14 |
|
| 15 |
# Some locales trigger reproducibility issues in html documentation |
| 16 |
export LC_ALL=C.UTF-8 |
| 17 |
export LANG=C.UTF-8 |
| 18 |
|
| 19 |
prebuild: prebuild-stamp |
| 20 |
prebuild-stamp: src/lxml/etree.pyx src/lxml/objectify.pyx |
| 21 |
# cython src/lxml/etree.pyx src/lxml/objectify.pyx |
| 22 |
touch $@ |
| 23 |
|
| 24 |
build-arch: build |
| 25 |
build-indep: build |
| 26 |
build: build3-stamp |
| 27 |
|
| 28 |
build3-stamp: $(PY3VERS:%=build3-python%) doc-build3-python$(PY3VER) |
| 29 |
touch $@ |
| 30 |
build3-python%: prebuild |
| 31 |
python$* setup.py build |
| 32 |
touch $@ |
| 33 |
doc-build3-python$(PY3VER): build3-python$(PY3VER) |
| 34 |
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) |
| 35 |
PYTHONPATH=$(call py_builddir, $(PY3VER)) python$(PY3VER) doc/mkhtml.py doc/html . $(DEB_VERSION_UPSTREAM) |
| 36 |
endif |
| 37 |
touch $@ |
| 38 |
|
| 39 |
clean: |
| 40 |
dh_testdir |
| 41 |
dh_testroot |
| 42 |
rm -f build*-stamp build*-python* dbg-build*-python* prebuild-stamp |
| 43 |
rm -rf build dist __pycache__ |
| 44 |
# rm -f src/lxml/lxml.etree_api.h src/lxml/lxml.etree.c \ |
| 45 |
# src/lxml/lxml.etree.h src/lxml/lxml.objectify.c |
| 46 |
|
| 47 |
-find -name '*.py[co]' | xargs rm -f |
| 48 |
rm -rf [23].[0-9] |
| 49 |
rm -f src/lxml/lxml-version.h |
| 50 |
dh_clean |
| 51 |
|
| 52 |
install: build install-prereq $(PY3VERS:%=install3-python%) |
| 53 |
-find debian -name '*.py[co]' | xargs rm -f |
| 54 |
-find debian -name __pycache__ | xargs rm -rf |
| 55 |
rm -rf debian/python*-lxml/usr/lib/python |
| 56 |
|
| 57 |
install-prereq: |
| 58 |
dh_testdir |
| 59 |
dh_testroot |
| 60 |
dh_prep |
| 61 |
|
| 62 |
install3-python%: |
| 63 |
mkdir -p debian/python3-lxml/usr/bin |
| 64 |
mkdir -p debian/python3-lxml/$(call py_libdir, $*) |
| 65 |
python$* setup.py install \ |
| 66 |
--root=$(CURDIR)/debian/python3-lxml --install-layout=deb |
| 67 |
|
| 68 |
# Build architecture-independent files here. |
| 69 |
binary-indep: build install |
| 70 |
dh_testdir |
| 71 |
dh_testroot |
| 72 |
dh_installchangelogs -i |
| 73 |
dh_installdocs -i |
| 74 |
mkdir -p debian/python-lxml-doc/usr/share/doc/python-lxml |
| 75 |
cp -r doc/html debian/python-lxml-doc/usr/share/doc/python-lxml/ |
| 76 |
ln -sf ../python-lxml/html debian/python-lxml-doc/usr/share/doc/python-lxml-doc/html |
| 77 |
dh_installexamples -i samples/* |
| 78 |
dh_compress -i -X.xml -X.py \ |
| 79 |
-X.html -X.css -X.asc -X.png -Xapi-objects.txt |
| 80 |
dh_fixperms -i |
| 81 |
dh_installdeb -i |
| 82 |
dh_shlibdeps -i |
| 83 |
dh_gencontrol -i |
| 84 |
dh_md5sums -i |
| 85 |
dh_builddeb -i |
| 86 |
|
| 87 |
# Build architecture-dependent files here. |
| 88 |
binary-arch: build install |
| 89 |
dh_testdir |
| 90 |
dh_testroot |
| 91 |
dh_installchangelogs -a CHANGES.txt |
| 92 |
dh_installdocs -a CREDITS.txt README.rst TODO.txt |
| 93 |
dh_installexamples -a samples/* |
| 94 |
dh_python3 -a |
| 95 |
dh_strip -ppython3-lxml |
| 96 |
dh_compress -a -X.xml -X.py \ |
| 97 |
-X.html -X.css -X.asc -X.png -Xapi-objects.txt |
| 98 |
dh_fixperms -a |
| 99 |
dh_installdeb -a |
| 100 |
dh_shlibdeps -a |
| 101 |
dh_gencontrol -a |
| 102 |
dh_md5sums -a |
| 103 |
dh_builddeb -a |
| 104 |
|
| 105 |
binary: binary-indep binary-arch |
| 106 |
.PHONY: build clean binary-indep binary-arch binary install |