~ubuntu-branches/ubuntu/raring/hplip/raring

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-10-06 15:03:44 UTC
  • mfrom: (1.6.1) (20.1.16 quantal)
  • Revision ID: package-import@ubuntu.com-20121006150344-2p3xz26br0t3hu2q
Tags: 3.12.10-1
* New upstream release
  - Fixes "Network scanning fails (Closes: #683033)
* quilt refresh hplip-syslog-fix-debug-messages-to-error.dpatch
* Fix "error in clean build env" updated debian/rules (Closes: #687129)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
PACKAGE=hplip
8
8
BASEPKG=hplip
9
9
 
10
 
# DPatch
11
 
DEB_SOURCE_PACKAGE:=$(PACKAGE)
12
 
include /usr/share/dpatch/dpatch.make
13
 
 
14
10
# DebHelper control
15
11
export DH_ALWAYS_EXCLUDE=CVS:.cvsignore
16
12
#export DH_VERBOSE=1
30
26
PKGTMP:=$(CURDIR)/debian/tmp
31
27
PPDDIR:=$(PKGTMP)/usr/share/ppd
32
28
 
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
35
31
 
36
32
# Version information
62
58
ifeq ($(DEB_HOST_ARCH_OS), linux)
63
59
  CONFFLAGS += --enable-pp-build
64
60
else
65
 
  CONFFLAGS += --disable-pp-build
66
 
endif
67
 
 
68
 
DEBUGFLAGS=-g
69
 
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
70
 
        DEBUGFLAGS += -O0
71
 
else
72
 
        DEBUGFLAGS += -O2
73
 
endif
74
 
 
75
 
CFLAGS:=-Wall -pipe $(DEBUGFLAGS)
 
61
  CONFFLAGS += --disable-pp-build --enable-libusb01_build
 
62
endif
 
63
 
 
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`
77
69
 
78
70
##
79
71
##  Build-tree preparation
81
73
 
82
74
configure: Makefile.am configure.in
83
75
        dh_testdir
84
 
        touch NEWS README AUTHORS ChangeLog
 
76
        touch NEWS README AUTHORS ChangeLog INSTALL
85
77
        chmod +x debian/autogen.sh
86
 
        debian/autogen.sh
 
78
        dh_autoreconf debian/autogen.sh
87
79
 
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
 
82
clean:
92
83
        dh_testdir
93
84
        dh_testroot
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)
109
100
 
110
 
        rm -f NEWS README AUTHORS ChangeLog
 
101
        rm -f NEWS README AUTHORS ChangeLog INSTALL
111
102
 
112
103
        dh_clean
113
104
 
114
 
        rm -f debian/local/pyppd/*/*.pyc
115
 
        rm -f debian/local/pyppd/pyppd-ppdfile
116
 
 
117
105
##
118
106
##  Package build
119
107
##
120
108
 
121
 
configure-stamp: patch-stamp configure
 
109
configure-stamp: configure
122
110
        dh_testdir
123
111
 
124
112
        ln -sf /usr/share/misc/config.sub .
125
113
        ln -sf /usr/share/misc/config.guess .
126
114
        rm -f config.cache
127
115
 
128
 
        ./configure CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
 
116
        ./configure CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"\
129
117
                HPLIP_PPD_PATH=/usr/share/ppd \
130
118
                $(CONFFLAGS) \
131
119
                --config-cache \
188
176
        # 487695)
189
177
        sh debian/local/make-duplex-page-sizes-default.sh $(PKGTMP)/usr/share/cups/drv/hpcups.drv
190
178
 
 
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
 
182
 
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/; \
196
188
        fi
197
189
 
 
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
 
197
 
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
200
200
 
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
260
260
 
 
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`; \
 
264
        done
 
265
 
261
266
        # Remove all *.pyc files, they do not need to be shipped with the
262
267
        # package
263
268
        find ./debian/tmp/ -name '*.pyc' -print0 | xargs -0 rm -f
290
295
        install -m 755 hplipjs "$(PKGTMP)/usr/lib/cups/filter/"
291
296
 
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/"
299
304
 
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
 
308
 
 
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
302
312
 
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 )
322
332
 
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; \
328
341
          done \
329
342
        )
330
343
 
331
 
        # Compress the PPD files with Vitor Baptista's pyppd PPD
332
 
        # archiving tool. This makes the space needed for PPDs at least
333
 
        # 10 times smaller.
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 \
341
 
        )
 
344
        # Compress the PPD files with pyppd
 
345
        dh_pyppd -pprinter-driver-postscript-hp
342
346
 
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
365
369
        dh_compress -i
366
370
        dh_fixperms -i
367
371
#       dh_perl -i
368
 
        dh_pysupport -i
 
372
        dh_python2 -i /usr/share/hplip
369
373
#       dh_makeshlibs -i
370
374
        dh_installdeb -i
371
375
        dh_shlibdeps -i --dpkg-shlibdeps-params=--ignore-missing-info
383
387
binary-arch: install-arch
384
388
        dh_testdir -a
385
389
        dh_testroot
386
 
 
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
395
 
 
 
390
        dh_bugfiles
396
391
#       dh_installdebconf -a
397
392
        dh_installdocs -a
398
393
        dh_installexamples -a
414
409
        dh_compress -a
415
410
        dh_fixperms -a
416
411
        dh_makeshlibs -a
417
 
        dh_pysupport -a
 
412
        dh_python2 -a --no-guessing-versions
418
413
        dh_installdeb -a
419
414
        dh_shlibdeps -a --dpkg-shlibdeps-params=--ignore-missing-info
420
415
        dh_gencontrol -a -- \
428
423
        dh_builddeb -a
429
424
 
430
425
binary: binary-indep binary-arch
431
 
.PHONY: build clean clean-patched binary-indep binary-arch binary install install-arch install-indep
 
426
.PHONY: build clean binary-indep binary-arch binary install install-arch install-indep