summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 899002aa457825840640e61a48814ebaff6afcb1 (plain)
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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_autoreconf:
	[ -d m4local ] || mkdir -p m4local
	dh_autoreconf

ifneq (,$(filter libgutenprint-doc, $(shell dh_listpackages)))
MAINTAINER_MODE += "--enable-maintainer-mode"
endif

override_dh_auto_configure:
	dh_auto_configure -- \
	  --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
	  --disable-static --enable-shared --disable-rpath \
	  --disable-static-genppd \
	  --with-modules=dlopen \
	  --enable-libgutenprintui2 --with-gimp2 \
	  --with-cups --enable-cups-level3-ppds --enable-globalized-cups-ppds \
	  --enable-cups-1_2-enhancements --disable-cups-ppds \
	  --disable-test \
	  $(MAINTAINER_MODE) \
	  --enable-nls

override_dh_install-indep:
	dh_install -i
	rm -f debian/gutenprint-locales/usr/share/locale/*/*.po

override_dh_installdocs:
	# Let it be installed by dh_installdocs
	cp src/cups/README debian/README.cups
	dh_installdocs -pescputil --link-doc=libgutenprint9
	dh_installdocs -plibgutenprintui2-dev --link-doc=libgutenprintui2-2
	dh_installdocs --remaining-packages

override_dh_clean:
	- rm -f debian/README.cups
	dh_clean

override_dh_install-arch:
ifeq ($(DEB_BUILD_ARCH_OS),linux)
	dh_install -pprinter-driver-gutenprint usr/share/cups/usb
endif
	dh_install -a --remaining-packages
# Remove rpath
	find debian/printer-driver-gutenprint/usr/lib -type f -perm /0111 -print0 | xargs -0 chrpath --delete
# Install ppd-updater file
	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

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_compress:
	dh_compress -X.pdf -X.odt

override_dh_auto_test:
	- dh_auto_test

override_dh_perl:
	dh_perl -d

override_dh_makeshlibs:
	dh_makeshlibs -a -V -X usr/lib/$(DEB_HOST_MULTIARCH)/gutenprint

override_dh_shlibdeps:
	dh_shlibdeps -a -X usr/lib/$(DEB_HOST_MULTIARCH)/gutenprint -ldebian/libgutenprint9/usr/lib/$(DEB_HOST_MULTIARCH):debian/libgutenprintui2-2/usr/lib/$(DEB_HOST_MULTIARCH)

override_dh_fixperms:
	dh_fixperms
# Make the gutenprint52+usb backend run as root, since /dev/bus/usb/*
# are root:root in udev < 147, and the usblp kernel module is not used
# here; udev 147 makes most of those printers accessible to lp, but
# apparently not all of them
	[ ! -f debian/printer-driver-gutenprint/usr/lib/cups/backend/gutenprint52+usb ] || \
		chmod go-x debian/printer-driver-gutenprint/usr/lib/cups/backend/gutenprint52+usb