File: rules

package info (click to toggle)
libxslt 1.1.32-2.2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 29,532 kB
  • sloc: xml: 75,487; ansic: 34,198; sh: 4,267; python: 3,045; makefile: 2,978; perl: 34
file content (107 lines) | stat: -rwxr-xr-x 3,676 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

# The versions of python currently supported
PYVERS=$(shell pyversions -s)
# The current default version of python
PYVER=$(shell pyversions -d)

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed

CONFIGURE_FLAGS := --with-history --cache-file="$(CURDIR)/builddir/config.cache"

TARGETS := main $(PYVERS) $(PYVERS:%=%-dbg)

override_dh_auto_configure: $(TARGETS:%=configure-%)

configure-%:
	-test -r /usr/share/misc/config.sub && \
	cp -f /usr/share/misc/config.sub config.sub
	-test -r /usr/share/misc/config.guess && \
	cp -f /usr/share/misc/config.guess config.guess
	dh_auto_configure --builddirectory=builddir/$* -- $(CONFIGURE_FLAGS)

configure-main: CONFIGURE_FLAGS += --without-python
configure-python%: CONFIGURE_FLAGS += --with-python=/usr/bin/$*

override_dh_auto_build: $(TARGETS:%=dobuild-%)

dobuild-%: BUILD_DIR=builddir/$*
dobuild-%:
	$(if $(filter $(BUILD_DIR),builddir/$*),,[ -d $(BUILD_DIR) ] || mv builddir/$*/python $(BUILD_DIR))
	dh_auto_build --builddirectory=$(BUILD_DIR) -- $(BUILD_FLAGS)

dobuild-python%: BUILD_DIR=builddir/main/$*
dobuild-python%-dbg doinstall-python%-dbg: BUILD_FLAGS = PYTHON_INCLUDES=/usr/include/$(*:-dbg=_d) \
    LDFLAGS="$(LDFLAGS) -L$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)" CFLAGS="$(CFLAGS) -Wall -O0"

override_dh_auto_clean:
	rm -rf builddir debian/tmp-dbg config.sub config.guess autogen.sh
	dh_auto_clean

override_dh_auto_install: $(TARGETS:%=doinstall-%)
	find debian/ -name *.la -delete

doinstall-main:
	dh_auto_install --builddirectory=builddir/main

	# https://lintian.debian.org/tags/non-empty-dependency_libs-in-la-file.html
	sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la

	# Move arch-specific headers into /usr/include/<triplet>/libxslt
	mkdir -pv debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/libxslt
	mv -v debian/tmp/usr/include/libxslt/xsltconfig.h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/libxslt

	# Properly install documentation in /usr/share/doc/libxslt1-dev
	install -d debian/tmp/usr/share/doc/libxslt1-dev/EXSLT
	install -m 644 \
		doc/*.html \
		doc/*.gif \
		doc/libxslt-*.xml debian/tmp/usr/share/doc/libxslt1-dev
	install -m 644 \
		doc/EXSLT/*.html \
		doc/EXSLT/libexslt-*.xml debian/tmp/usr/share/doc/libxslt1-dev
	cp -a \
		doc/html \
		doc/tutorial \
		doc/tutorial2 debian/tmp/usr/share/doc/libxslt1-dev
	cp -a \
		doc/EXSLT/html debian/tmp/usr/share/doc/libxslt1-dev/EXSLT

doinstall-python%-dbg:
	$(MAKE) -C builddir/main/python$*-dbg DESTDIR=$(CURDIR)/debian/tmp-dbg install-pythonLTLIBRARIES $(BUILD_FLAGS)
	prename 's/(?<!_d)\.so$$/_d.so/' debian/tmp-dbg/usr/lib/python$*/*-packages/*.so

doinstall-python%:
	dh_auto_install --builddirectory=builddir/main/python$*

override_dh_installdocs:
	dh_installdocs -a -A AUTHORS FEATURES NEWS README TODO

override_dh_installchangelogs:
	dh_installchangelogs -a ChangeLog

override_dh_install:
	dh_install -Npython-libxslt1-dbg
	dh_install -ppython-libxslt1-dbg --sourcedir=debian/tmp-dbg

override_dh_strip:
	dh_strip -a -Npython-libxslt1 -Npython-libxslt1-dbg
	dh_strip -ppython-libxslt1 --dbg-package=python-libxslt1-dbg
	$(foreach python, $(filter-out $(PYVER), $(PYVERS)),\
		cd $(CURDIR)/debian/python-libxslt1/usr/lib/pyshared; \
		if diff $(python)/libxsltmod.so $(PYVER)/libxsltmod.so > /dev/null 2>&1; then \
			rm -f $(python)/libxsltmod.so; \
			ln -s ../$(PYVER)/libxsltmod.so $(python)/libxsltmod.so; \
		fi;)

override_dh_compress:
	dh_compress -a -Xexamples/

override_dh_makeshlibs:
	dh_makeshlibs -a -V 'libxslt1.1 (>= 1.1.26)' -- -c4

%:
	dh $@ --with python2