Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 arch = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
4
5 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
6
7 %:
8 dh $@
9
10 execute_before_dh_autoreconf:
11 [ -d m4local ] || mkdir -p m4local
12
13 ifneq (,$(filter libgutenprint-doc, $(shell dh_listpackages)))
14 MAINTAINER_MODE += --enable-maintainer-mode
15 endif
16
17 DOTEST = --enable-test
18 ifeq ($(arch),s390x)
19 DOTEST =
20 endif
21
22 override_dh_auto_configure:
23 echo "architecture testing: ${arch} -> ${DOTEST}"
24 dh_auto_configure -- \
25 --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
26 --disable-static --enable-shared --disable-rpath \
27 --disable-static-genppd \
28 --with-modules=dlopen \
29 --disable-libgutenprintui2 --disable-gimp2 \
30 --with-cups --enable-cups-level3-ppds --enable-globalized-cups-ppds \
31 --enable-cups-1_2-enhancements --disable-cups-ppds \
32 $(DOTEST) --disable-testpattern \
33 $(MAINTAINER_MODE) \
34 --enable-nls
35
36 execute_after_dh_auto_build-indep:
37 # Build the gettext translations (#987457)
38 cd po && make update-gmo
39
40 execute_after_dh_install-indep:
41 rm -f debian/gutenprint-locales/usr/share/locale/*/*.po
42 # Make sure at least some locales are installed (#987457)
43 test -n "$$(find debian/gutenprint-locales/usr/share/locale -name gutenprint.mo)"
44
45 override_dh_installdocs:
46 dh_installdocs -pescputil --link-doc=libgutenprint9
47 dh_installdocs --remaining-packages
48 # Remove build directory from gutenprint.tag file to make
49 # build reproducible.
50 find
51 -sed -i -e 's,$(CURDIR),BUILDPATH,g' \
52 debian/libgutenprint-doc/usr/share/doc/libgutenprint-doc/reference/gutenprint.tag
53
54 override_dh_install-arch:
55 # Remove build path, timestamp, username, and uname output to
56 # make build reproducible.
57 sed -i -e 's,$(CURDIR),BUILDPATH,g' \
58 -e 's,Generated at.*,Generated at REDACTED,g' \
59 -e 's,uname -a output:.*,uname -a output: REDACTED,g' \
60 $(shell find debian/tmp/ -name config.summary)
61 ifeq ($(DEB_BUILD_ARCH_OS),linux)
62 dh_install -pprinter-driver-gutenprint usr/share/cups/usb
63 endif
64 dh_install -a --remaining-packages
65 # Remove rpath
66 find debian/printer-driver-gutenprint/usr/lib -type f -perm /0111 -print0 | xargs -0 chrpath --delete
67 # Install ppd-updater file
68 install -D --mode=644 debian/printer-driver-gutenprint.ppd-updater $(CURDIR)/debian/printer-driver-gutenprint/usr/share/cups/ppd-updaters/printer-driver-gutenprint.ppd-updater
69
70 override_dh_installchangelogs:
71 dh_installchangelogs NEWS
72
73 override_dh_compress:
74 dh_compress -X.pdf -X.odt
75
76 execute_before_dh_auto_test:
77 # As dgit doesn't support the executable bit in patches, set it here before running the test
78 chmod +x scripts/test-driver-verbose
79
80 override_dh_perl:
81 dh_perl -d
82
83 override_dh_makeshlibs:
84 dh_makeshlibs -a -V -X usr/lib/$(DEB_HOST_MULTIARCH)/gutenprint
85
86 override_dh_shlibdeps:
87 dh_shlibdeps -a -X usr/lib/$(DEB_HOST_MULTIARCH)/gutenprint -ldebian/libgutenprint9/usr/lib/$(DEB_HOST_MULTIARCH)
88
89 execute_after_dh_fixperms:
90 # Make the gutenprint52+usb backend run as root, since /dev/bus/usb/*
91 # are root:root in udev < 147, and the usblp kernel module is not used
92 # here; udev 147 makes most of those printers accessible to lp, but
93 # apparently not all of them
94 [ ! -f debian/printer-driver-gutenprint/usr/lib/cups/backend/gutenprint52+usb ] || \
95 chmod go-x debian/printer-driver-gutenprint/usr/lib/cups/backend/gutenprint52+usb