File: rules

package info (click to toggle)
foomatic-db 20100630-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 206,696 kB
  • ctags: 15
  • sloc: xml: 205,635; sh: 297; makefile: 103; python: 8
file content (48 lines) | stat: -rwxr-xr-x 1,713 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
#!/usr/bin/make -f

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

%:
	dh $@

override_dh_auto_configure:
	echo "#!/bin/sh\n/bin/gzip --best \$$1" > debian/mygzip
	chmod +x debian/mygzip
	GZIP='$(CURDIR)/debian/mygzip' dh_auto_configure -- --with-drivers=NOOBSOLETES,NOEMPTYCMDLINE

override_dh_auto_clean:
	dh_auto_clean
	rm -f debian/mygzip

override_dh_install:
	# Some files have executable bit set.
	find debian/tmp/ -executable -type f -print0 | xargs -0 chmod -x
	
	# Remove non-PPD files from PPD repositories, CUPS 1.4 reports errors
	# on these files.
	find $(CURDIR)/debian/tmp/usr/share/foomatic/db/source/PPD -type f \! -name '*.ppd.gz' -print0 | xargs -0 rm

	# Remove entries for drivers never shipped in Debian nor in Ubuntu
	( cd $(CURDIR)/debian/tmp/usr/share/foomatic/db/source/driver; \
	    rm ppmtomd.xml; \
	    rm lpstyl.xml; \
	    rm pbm2lwxl.xml; \
	    rm bjc800j.xml; \
	    rm pbm2l7k.xml; \
	    rm lm1100.xml; \
	    rm pbm2l2030.xml; \
	    rm c2070.xml; \
	    rm drv_x125.xml; \
	    rm pentaxpj.xml; \
	    rm ml85p.xml; \
	)

	# Fix common errors in PPDs that make CUPS choke (OpenPrinting
	# bug #164, Debian bug #493104)
	for f in `find $(CURDIR)/debian/tmp/usr/share/foomatic/db/source/PPD -name '*.ppd.gz'`; do gzip -cd $$f | perl -p -e 's/^\*CloseUI(\s+)/*CloseUI:\1/' | perl -p -e 's/\*1284DeviceId/*1284DeviceID/' | gzip --best>  $$f.tmp; rm $$f; mv $$f.tmp $$f; done
	
	dh_install --list-missing
	# Install the apport hook on Ubuntu and derivatives
ifeq ($(derives_from_ubuntu),yes)
	install -D -m 644 debian/ubuntu/apport-hook.py $(CURDIR)/debian/foomatic-db/usr/share/apport/package-hooks/source_foomatic-db.py
endif