File: rules

package info (click to toggle)
foo2zjs 20200505dfsg0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,700 kB
  • sloc: ansic: 41,030; xml: 12,765; sh: 7,883; makefile: 1,722; objc: 573; tcl: 173; perl: 102; python: 8
file content (106 lines) | stat: -rwxr-xr-x 5,060 bytes parent folder | download
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
#!/usr/bin/make -f

derives_from_ubuntu := $(shell (dpkg-vendor --derives-from Ubuntu && echo "yes") || echo "no")
include /usr/share/dpkg/architecture.mk

%:
	dh $@

override_dh_auto_build:
	cp printer-profile.in printer-profile
	dh_auto_build -- all ppd

override_dh_auto_install:
	dh_auto_install -- PREFIX=$(CURDIR)/debian/tmp/usr MODEL=$(CURDIR)/debian/tmp/usr/share/cups/model FOODB=$(CURDIR)/debian/tmp/usr/share/foomatic/db/source PPD=$(CURDIR)/debian/tmp/usr/share/ppd CUPS_SERVERBIN=$(CURDIR)/debian/tmp/usr/lib/cups DOCDIR=$(CURDIR)/debian/tmp/usr/share/doc/printer-driver-foo2zjs

override_dh_install:
	### patches/20-honour-papersize.patch
	# Add support for /etc/papersize to all wrapper scripts. In contrary
	# to a patch this will automatically apply to every new wrapper script
	# which gets added to this package in the future.
	perl -p -i -e 's/^PAPER=(\d+)\s*$$/test -r \/etc\/papersize && PAPER=\x24\(cat \/etc\/papersize\)\ntest "\x24PAPER" || PAPER=\1\n/' $(CURDIR)/debian/tmp/usr/bin/*-wrapper
	# Add "-dNOINTERPOLATE" to the Ghostscript command lines to make
	# Ghostscript rendering the pages significantly faster
	perl -p -i -e 's/dNOPAUSE/dNOPAUSE -dNOINTERPOLATE/g' $(CURDIR)/debian/tmp/usr/bin/*-wrapper
	# Legacy dh_install
	dh_install
	dh_missing \
		-Xusb_printerid \
		-Xhplj10xx.rules \
		-XINSTALL \
		-XINSTALL.OSX \
		-XCOPYING \
		-XChangeLog \
		-Xcups/filter/command2foo2lava-pjl

ifneq (,$(filter printer-driver-foo2zjs, $(shell dh_listpackages)))
ifeq ($(DEB_HOST_ARCH_OS),linux)
	# usb_printerid is Linux-specific
	install -D -m 644 usb_printerid $(CURDIR)/debian/printer-driver-foo2zjs/usr/bin/usb_printerid
	install -D -m 644 usb_printerid.1 $(CURDIR)/debian/printer-driver-foo2zjs-common/usr/share/man/man1/usb_printerid.1
	# Use a policy-numbered name for the Linux-specific udev rules file
	install -D -m 644 hplj10xx.rules $(CURDIR)/debian/printer-driver-foo2zjs/usr/lib/udev/rules.d/85-hplj10xx.rules
endif
ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
	# /etc/devd/hplj10xx.conf is kFreeBSD-specific
	install -D -m 644 hplj10xx.conf $(CURDIR)/debian/printer-driver-foo2zjs/etc/devd/hplj10xx.conf
endif
endif

ifneq (,$(filter printer-driver-foo2zjs-common, $(shell dh_listpackages)))
	### patches/20-PDF-input-data-in-PPDs.patch
	# Add "*cupsFilter" line to accept PDF input data to the PPDs and compress them
	( cd $(CURDIR)/debian/printer-driver-foo2zjs-common/usr/share/ppd/foo2zjs; \
	  find -name '*.ppd.gz' -exec gunzip {} \; ; \
	  find -name '*.ppd' -exec perl -p -i -e 's,^\*cupsFilter:\s*\"application/vnd.cups-postscript\s+0\s+foomatic-rip\",*cupsFilter: "application/vnd.cups-postscript 100 foomatic-rip"\n*cupsFilter: "application/vnd.cups-pdf 0 foomatic-rip",' {} \; ; \
	)
	# Correct the name of the pyppd-compressed PPD set to correspond to the earlier ppd-updater driver name
	dh_pyppd --archive-filename=foo2zjs
endif
	# Install the apport hook on Ubuntu and derivatives
ifeq ($(derives_from_ubuntu),yes)
	install -D -m 644 debian/ubuntu/apport-hook.py $(CURDIR)/debian/printer-driver-foo2zjs/usr/share/apport/package-hooks/source_foo2zjs.py
endif

override_dh_auto_test:
	# Run the tests in non-failing mode (they fail…)
	- dh_auto_test

override_dh_compress:
	dh_compress -X.pdf

override_dh_gencontrol:
ifeq ($(derives_from_ubuntu),yes)
	# Ubuntu considers mscompress to be a Depends of printer-driver-foo2zjs
	echo "ubuntu:mscompress=mscompress" >> debian/printer-driver-foo2zjs.substvars
	# Ubuntu considers tix to be a Suggests of printer-driver-foo2zjs
	echo "ubuntu:tix=tix" >> debian/printer-driver-foo2zjs-common.substvars
	# Ubuntu considers tk to be a Suggests of printer-driver-foo2zjs
	echo "ubuntu:tk=tk" >> debian/printer-driver-foo2zjs-common.substvars
else
	# Debian considers mscompress to be a Recommends of printer-driver-foo2zjs
	echo "debian:mscompress=mscompress" >> debian/printer-driver-foo2zjs.substvars
	# Debian considers tix to be a Recommends of printer-driver-foo2zjs
	echo "debian:tix=tix" >> debian/printer-driver-foo2zjs-common.substvars
	# Debian considers tix to be a Recommends of printer-driver-foo2zjs
	echo "debian:tk=tk" >> debian/printer-driver-foo2zjs-common.substvars
endif
	dh_gencontrol

override_dh_auto_clean:
	dh_auto_clean
	- rm -f 85-hplj10xx.rules

UPSTREAM_VERSION ?= `date +%Y%m%d`

get-orig-source:
	- quilt pop -af ; rm -Rf .pc
	git checkout -f upstream/latest
	wget -O ../foo2zjs_$(UPSTREAM_VERSION).orig.tar.gz 'http://foo2zjs.rkkda.com/foo2zjs.tar.gz'
	gbp import-orig --no-pristine-tar --upstream-version=$(UPSTREAM_VERSION) --no-merge --upstream-branch=upstream/nodfsg ../foo2zjs_$(UPSTREAM_VERSION).orig.tar.gz
	git merge upstream/$(UPSTREAM_VERSION)
	git tag upstream/$(UPSTREAM_VERSION)dfsg0
	git archive --format=tar --prefix=foo2zjs-$(UPSTREAM_VERSION)dfsg0/ upstream/$(UPSTREAM_VERSION)dfsg0 | xz -6e > ../foo2zjs_$(UPSTREAM_VERSION)dfsg0.orig.tar.xz
	pristine-tar commit ../foo2zjs_$(UPSTREAM_VERSION)dfsg0.orig.tar.xz upstream/$(UPSTREAM_VERSION)dfsg0
	git checkout -f debian/master
	git merge upstream/$(UPSTREAM_VERSION)dfsg0