30
26
PKGTMP:=$(CURDIR)/debian/tmp
31
27
PPDDIR:=$(PKGTMP)/usr/share/ppd
33
SF_MIRRORS:= optusnet ovh puzzle superb-east
29
SF_MIRRORS:= ovh puzzle superb-east
34
30
-include /usr/share/gnome-pkg-tools/1/rules/sf-get-source.mk
36
32
# Version information
62
58
ifeq ($(DEB_HOST_ARCH_OS), linux)
63
59
CONFFLAGS += --enable-pp-build
65
CONFFLAGS += --disable-pp-build
69
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
75
CFLAGS:=-Wall -pipe $(DEBUGFLAGS)
61
CONFFLAGS += --disable-pp-build --enable-libusb01_build
64
CFLAGS:=-Wall -pipe -D_IPP_PRIVATE_STRUCTURES=1
65
CFLAGS += `dpkg-buildflags --get CFLAGS`
76
66
CXXFLAGS:=$(CFLAGS)
67
LDFLAGS = `dpkg-buildflags --get LDFLAGS`
68
CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
79
71
## Build-tree preparation
82
74
configure: Makefile.am configure.in
84
touch NEWS README AUTHORS ChangeLog
76
touch NEWS README AUTHORS ChangeLog INSTALL
85
77
chmod +x debian/autogen.sh
78
dh_autoreconf debian/autogen.sh
88
80
# Clean everything up, including everything auto-generated
89
81
# at build time that needs not to be kept around in the Debian diff
90
clean: clean-patched unpatch
91
clean-patched: configure
94
85
rm -f build-stamp configure-stamp
107
98
# We prefer to regenerate these using pyuic
108
99
(cd ui && for i in *.ui ; do rm -f $${i%.ui}.py ; done)
110
rm -f NEWS README AUTHORS ChangeLog
101
rm -f NEWS README AUTHORS ChangeLog INSTALL
114
rm -f debian/local/pyppd/*/*.pyc
115
rm -f debian/local/pyppd/pyppd-ppdfile
121
configure-stamp: patch-stamp configure
109
configure-stamp: configure
124
112
ln -sf /usr/share/misc/config.sub .
125
113
ln -sf /usr/share/misc/config.guess .
126
114
rm -f config.cache
128
./configure CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
116
./configure CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"\
129
117
HPLIP_PPD_PATH=/usr/share/ppd \
189
177
sh debian/local/make-duplex-page-sizes-default.sh $(PKGTMP)/usr/share/cups/drv/hpcups.drv
179
# Modify all Ghostscript command lines to have the "-dNOINTERPOLATE"
180
# coomand line option. This makes rendering the pages much faster
181
perl -p -i -e "s/(\-sDEVICE=)/-dNOINTERPOLATE \1/" $(PKGTMP)/usr/share/cups/drv/hpijs.drv $(PKGTMP)/usr/lib/cups/filter/pstotiff
191
183
# Install wrapper script for hp-plugin, to be called by update-notifier
192
184
# on udev signal (Ubuntu only)
193
185
if [ "`lsb_release -is 2>/dev/null`" = "Ubuntu" ]; then \
195
187
install -m 755 debian/local/scripts/hp-plugin-ubuntu $(CURDIR)/debian/hplip/usr/bin/; \
190
# Install the ppd updater data files so that CUPS can update the
191
# PPDs of the already existing queue after each update of HPLIP's
192
# printer driver/PPD packages
193
install -D -m 644 debian/printer-driver-postscript-hp.ppd-updater $(PKGTMP)/usr/share/cups/ppd-updaters/printer-driver-postscript-hp.ppd-updater
194
install -D -m 644 debian/printer-driver-hpcups.ppd-updater $(PKGTMP)/usr/share/cups/ppd-updaters/printer-driver-hpcups.ppd-updater
195
install -D -m 644 debian/printer-driver-hpijs.ppd-updater $(PKGTMP)/usr/share/cups/ppd-updaters/printer-driver-hpijs.ppd-updater
196
install -D -m 644 debian/hpijs-ppds.ppd-updater $(PKGTMP)/usr/share/cups/ppd-updaters/hpijs-ppds.ppd-updater
198
198
# Install Apport hook
199
199
install -D -m 644 debian/local/apport-hook.py $(PKGTMP)/usr/share/apport/package-hooks/source_hplip.py
248
248
[ $$file != hpssd.py ] && [ $$file != dat2drv.py ] && \
249
249
[ $$file != __init__.py ]; then \
250
250
dest=hp-$${file%.py}; \
251
ln -s /usr/share/hplip/$$file \
251
ln -s ../../usr/share/hplip/$$file \
252
252
../../bin/$$dest 2>/dev/null || :; \
253
253
PYTHONPATH=../../lib/python$(PYTHON_DEFAULT_VERSION)/$(PYTHON_SITENAME)/ \
254
254
LD_LIBRARY_PATH=../../lib/ ../../bin/$$dest --help-man > $(CURDIR)/$$dest.1 ; \
258
258
install -d ./debian/tmp/usr/sbin/
259
259
ln -s /usr/share/hplip/hpssd.py ./debian/tmp/usr/sbin/hpssd
261
# Correct Python interpreter path in all executables
262
for file in ./debian/tmp/usr/bin/* ./debian/tmp/usr/sbin/* ./debian/tmp/usr/lib/cups/*/*; do \
263
perl -p -i -e 's:^\s*\#\!/usr/bin/env\s+python.*:#!/usr/bin/python:' `readlink -f $$file`; \
261
266
# Remove all *.pyc files, they do not need to be shipped with the
263
268
find ./debian/tmp/ -name '*.pyc' -print0 | xargs -0 rm -f
290
295
install -m 755 hplipjs "$(PKGTMP)/usr/lib/cups/filter/"
292
297
# Fax PPDs, install to destdir directly
293
mkdir -p "$(CURDIR)/debian/hpijs/usr/share/ppd/hplip/HP"
294
mkdir -p "$(CURDIR)/debian/hplip-cups/usr/share/ppd/hplip/HP"
298
mkdir -p "$(CURDIR)/debian/printer-driver-hpijs/usr/share/ppd/hplip/HP"
299
mkdir -p "$(CURDIR)/debian/printer-driver-hpcups/usr/share/ppd/hplip/HP"
295
300
cp fax/ppd/HP-Fax*-hpijs.ppd.gz \
296
"$(CURDIR)/debian/hpijs/usr/share/ppd/hplip/HP/"
301
"$(CURDIR)/debian/printer-driver-hpijs/usr/share/ppd/hplip/HP/"
297
302
cp fax/ppd/HP-Fax*-hpcups.ppd.gz \
298
"$(CURDIR)/debian/hplip-cups/usr/share/ppd/hplip/HP/"
303
"$(CURDIR)/debian/printer-driver-hpcups/usr/share/ppd/hplip/HP/"
300
305
# Uncompress PPDs, this makes the package smaller for distribution
301
-find $(PPDDIR) -name '*.ppd.gz' | xargs gunzip -f
306
-find "$(CURDIR)/debian/printer-driver-hpijs/usr/share/ppd/" -name '*.ppd.gz' | xargs gunzip -f
307
-find "$(CURDIR)/debian/printer-driver-hpcups/usr/share/ppd/" -name '*.ppd.gz' | xargs gunzip -f
309
# Modify all Ghostscript command lines to have the "-dNOINTERPOLATE"
310
# coomand line option. This makes rendering the pages much faster
311
perl -p -i -e "s/(\-sDEVICE=)/-dNOINTERPOLATE \1/" $(CURDIR)/debian/*/usr/share/ppd/hplip/HP/HP-Fax*.ppd
303
313
# Generate .fdi file for HAL setting "scanner" capability to all
304
314
# HPLIP-supported devices (also without scanner), so that permissions
321
331
( echo "Last five lines of error log:" ; tail -n 5 install-indep-stamp ; exit 1 )
323
333
# Patch the PPDs for the hpijs-ppds package to use foomatic-rip
324
# as CUPS filter and not foomatic-rip-hplip
334
# as CUPS filter and not foomatic-rip-hplip. Also add
335
# "-dNOINTERPOLATE" to the Ghostscript command lines to make rendering
336
# by Ghostscript faster.
325
337
(cd $(CURDIR)/debian/hpijs-ppds/usr/share/ppd/hplip/HP/ && \
326
338
for ppd in *.ppd; do \
327
339
perl -p -i -e 's/foomatic-rip-hplip/foomatic-rip/g' $$ppd; \
340
perl -p -i -e "s/(\-sDEVICE=)/-dNOINTERPOLATE \1/" $$ppd; \
331
# Compress the PPD files with Vitor Baptista's pyppd PPD
332
# archiving tool. This makes the space needed for PPDs at least
334
(cd $(CURDIR)/debian/local/pyppd/ && \
335
chmod 755 bin/pyppd && \
336
touch pyppd/__init__.py && \
337
PYTHONPATH=. bin/pyppd $(CURDIR)/debian/hplip-data/usr/share/ppd/hplip && \
338
install -D -m 755 pyppd-ppdfile $(CURDIR)/debian/hplip-data/usr/lib/cups/driver/hplip && \
339
rm -rf $(CURDIR)/debian/hplip-data/usr/share/ppd && \
340
rm -f */*.pyc pyppd-ppdfile \
344
# Compress the PPD files with pyppd
345
dh_pyppd -pprinter-driver-postscript-hp
343
347
# Remove models.dat from hplip-data - we ship with libsane-hpaio
344
348
rm $(CURDIR)/debian/hplip-data/usr/share/hplip/data/models/models.dat
383
387
binary-arch: install-arch
387
mkdir -p debian/hplip/usr/share/bug/hplip
388
cp debian/bug/* debian/hplip/usr/share/bug/hplip
389
mkdir -p debian/hplip/usr/share/bug/hplip-cups
390
cp debian/bug/presubj debian/hplip/usr/share/bug/hplip-cups
391
mkdir -p debian/hplip/usr/share/bug/hplip-gui
392
cp debian/bug/presubj debian/hplip/usr/share/bug/hplip-gui
393
mkdir -p debian/hplip/usr/share/bug/hpijs
394
cp debian/bug/presubj debian/hplip/usr/share/bug/hpijs
396
391
# dh_installdebconf -a
397
392
dh_installdocs -a
398
393
dh_installexamples -a