File: rules

package info (click to toggle)
ptouch-driver 1.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,420 kB
  • sloc: xml: 4,365; ansic: 1,838; sh: 867; perl: 195; makefile: 158; python: 8
file content (40 lines) | stat: -rwxr-xr-x 1,495 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

derives_from_ubuntu := $(shell (dpkg-vendor --derives-from Ubuntu && echo "yes") || echo "no")

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
else
	# Faster when testing on modern desktops, 1 task takes less than a full CPU
	NUMJOBS = 4
endif

%:
	dh $@ --with pyppd

override_dh_auto_clean:
	dh_auto_clean
	rm -rf foomatic-db

override_dh_auto_configure:
	dh_auto_configure -- --libdir=/usr/lib

override_dh_auto_install:
ifneq (,$(filter printer-driver-ptouch, $(shell dh_listpackages)))
	dh_auto_install --destdir=debian/printer-driver-ptouch/

	# Pre-build PPD files
	mkdir $(CURDIR)/foomatic-db
	cp -r $(CURDIR)/debian/printer-driver-ptouch/usr/share/foomatic/* $(CURDIR)/foomatic-db/
	echo '#' > $(CURDIR)/foomatic-db/db/oldprinterids
	rm -rf $(CURDIR)/debian/printer-driver-ptouch/usr/share/foomatic
	mkdir -p $(CURDIR)/debian/printer-driver-ptouch/usr/share/ppd
	FOOMATICDB=$(CURDIR)/foomatic-db foomatic-compiledb -j $(NUMJOBS) -t ppd -d $(CURDIR)/debian/printer-driver-ptouch/usr/share/ppd/ptouch-driver `ls -1 $(CURDIR)/foomatic-db/db/source/driver/*ptouch*.xml | perl -p -e 's:^.*db/source/driver/(\S*)\.xml\s*$$:\1\n:'`

ifeq ($(derives_from_ubuntu),yes)
        # Install Apport hook
	install -D -m 644 debian/local/apport-hook.py $(CURDIR)/debian/ptouch-driver/usr/share/apport/package-hooks/source_ptouch-driver.py
endif
endif