Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 export DH_VERBOSE=1
3
4 DOPACKAGES = $(shell dh_listpackages)
5
6 ifneq (,$(filter python3-libxml2,$(DOPACKAGES)))
7 # The versions of python3 currently supported
8 PY3VERS=$(shell py3versions -s)
9 else
10 PY3VERS=
11 endif
12
13 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
14 export DEB_CFLAGS_MAINT_APPEND = -Wall -O3
15 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-as-needed
16
17 include /usr/share/dpkg/architecture.mk
18
19 TARGETS := main # $(PY3VERS)
20
21 CONFIGURE_FLAGS := --with-history --cache-file="$(CURDIR)/builddir/config.cache"
22
23 override_dh_auto_configure-arch: $(TARGETS:%=doconfigure-%)
24
25 override_dh_auto_configure-indep:
26 dh_auto_configure -- --docdir \$${prefix}/share/doc/libxml2 --enable-rebuild-docs --without-python
27
28 doconfigure-%:
29 dh_auto_configure --builddirectory=builddir/$(*) -- $(CONFIGURE_FLAGS)
30 touch $@
31
32 doconfigure-main: CONFIGURE_FLAGS += --without-python
33 doconfigure-python%: CONFIGURE_FLAGS += --with-python=/usr/bin/$(*) --with-python-install-dir=/usr/lib/$(*)/dist-packages
34
35 dobuild-%: BUILD_DIR=builddir/$(*)
36 dobuild-%: doconfigure-%
37 $(if $(filter $(BUILD_DIR),builddir/$(*)),,[ -d $(BUILD_DIR) ] || mv builddir/$(*)/python $(BUILD_DIR))
38 dh_auto_build --builddirectory=$(BUILD_DIR) -- $(BUILD_FLAGS)
39
40 dobuild-python%: BUILD_DIR=builddir/main/$(*)
41 dobuild-python%: BUILD_FLAGS=libxml2mod_la_LIBADD='$$(mylibs)' \
42 PYTHON_INCLUDES='$(shell $(DEB_HOST_GNU_TYPE)-$(*)-config --includes)' \
43 PYTHON_LIBS='$(shell $(DEB_HOST_GNU_TYPE)-$(*)-config --ldflags)'
44
45 override_dh_auto_build-arch: $(TARGETS:%=dobuild-%)
46
47 override_dh_auto_build-indep:
48 dh_auto_build -i
49
50 override_dh_auto_test-indep:
51 : Skipping tests during indep build
52
53 execute_after_dh_auto_clean:
54 rm -rf builddir
55 rm -f doconfigure-*
56
57 doinstall-main:
58 dh_auto_install --builddirectory=builddir/main
59 mv debian/tmp/usr/share/aclocal/libxml.m4 debian/tmp/usr/share/aclocal/libxml2.m4
60
61 override_dh_auto_install-arch: $(TARGETS:%=doinstall-%)
62 find debian/tmp -name *.la -delete
63
64 override_dh_auto_install-indep:
65 dh_auto_install -i
66 rm -v debian/tmp/usr/share/doc/libxml2/Copyright
67
68 doinstall-python%:
69 dh_auto_install --builddirectory=builddir/main/python$(*)
70
71 override_dh_compress:
72 dh_compress -Xexamples/ -Xtutorial/ -Xhtml/ -X.html
73
74 override_dh_installchangelogs:
75 dh_installchangelogs -k NEWS
76
77 override_dh_install-arch:
78 dh_install -a
79 sed -i -e 's,/lib/$(DEB_HOST_MULTIARCH),/lib,' debian/libxml2.9-dev/usr/bin/xml2-config
80
81 override_dh_makeshlibs:
82 dh_makeshlibs -plibxml2 -V 'libxml2 (>= 2.9.11)' -- -c4
83 dh_makeshlibs --remaining-packages
84
85
86 # I need to specify all the targets (build, binary, clean, etc) as
87 # otherwise dh may invoke them in a order that is not appropriate for the
88 # build system (the -indep part is done in-tree because rebuilding the
89 # docs out of tree is not supported. And once an in-tree build is done no
90 # out-of-tree builds can be done, so we wouldn't be able to do the -arch
91 # builds after the -indep one).
92 clean build-arch binary-arch build-indep binary-indep:
93 dh $@
94
95 build: build-arch build-indep
96 binary: binary-arch binary-indep