1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
#!/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 lxml-,,$(notdir $(CURDIR)))
include /usr/share/python3/python.mk
prebuild: prebuild-stamp
prebuild-stamp: src/lxml/etree.pyx src/lxml/objectify.pyx
# cython src/lxml/etree.pyx src/lxml/objectify.pyx
touch $@
build-arch: build
build-indep: build
build: build-stamp build3-stamp
build-stamp: $(PYVERS:%=build-python%) $(PYVERS:%=dbg-build-python%) $(PYVERS:%=check-python%)
touch $@
build-python%: prebuild
python$* setup.py build --with-cython
touch $@
dbg-build-python%: prebuild
python$*-dbg setup.py build --with-cython
touch $@
build3-stamp: $(PY3VERS:%=build3-python%) $(PY3VERS:%=dbg-build3-python%) $(PY3VERS:%=check-python%)
touch $@
build3-python%: prebuild
python$* setup.py build --with-cython
touch $@
dbg-build3-python%: prebuild
python$*-dbg setup.py build --with-cython
touch $@
check-python%:
python$* setup.py build_ext -i
-python$* test.py -vv
#python$*-dbg setup.py build_ext -i
#-python$*-dbg test.py -vv
touch $@
clean:
dh_testdir
dh_testroot
rm -f build*-stamp build*-python* dbg-build*-python* prebuild-stamp check-python*
rm -rf build dist __pycache__
# rm -f src/lxml/lxml.etree_api.h src/lxml/lxml.etree.c \
# src/lxml/lxml.etree.h src/lxml/lxml.objectify.c
-find -name '*.py[co]' | xargs rm -f
rm -rf [23].[0-9]
rm -f src/lxml/lxml-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*-lxml/usr/lib/python
install-prereq:
dh_testdir
dh_testroot
dh_prep
install-python%:
mkdir -p debian/python-lxml/usr/bin
mkdir -p debian/python-lxml/$(call py_libdir, $*)
python$* setup.py install \
--root=$(CURDIR)/debian/python-lxml --install-layout=deb
dbg-install-python%:
mkdir -p debian/python-lxml/usr/bin
mkdir -p debian/python-lxml-dbg/$(call py_libdir, $*)
python$*-dbg setup.py install \
--root=$(CURDIR)/debian/python-lxml-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-lxml/usr/bin
mkdir -p debian/python3-lxml/$(call py_libdir, $*)
python$* setup.py install \
--root=$(CURDIR)/debian/python3-lxml --install-layout=deb
dbg-install3-python%:
mkdir -p debian/python3-lxml/usr/bin
mkdir -p debian/python3-lxml-dbg/$(call py_libdir, $*)
python$*-dbg setup.py install \
--root=$(CURDIR)/debian/python3-lxml-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-lxml-doc/usr/share/doc/python-lxml
cp -r doc/html debian/python-lxml-doc/usr/share/doc/python-lxml/
ln -sf ../python-lxml/html debian/python-lxml-doc/usr/share/doc/python-lxml-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-lxml --dbg-package=python-lxml-dbg
rm -rf debian/python-lxml-dbg/usr/share/doc/python-lxml-dbg
ln -s python-lxml debian/python-lxml-dbg/usr/share/doc/python-lxml-dbg
dh_strip -ppython3-lxml --dbg-package=python3-lxml-dbg
rm -rf debian/python3-lxml-dbg/usr/share/doc/python3-lxml-dbg
ln -s python3-lxml debian/python3-lxml-dbg/usr/share/doc/python3-lxml-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
|