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

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2009-12-14 20:08:44 UTC
  • mfrom: (2.1.118 lucid)
  • Revision ID: james.westby@ubuntu.com-20091214200844-z8qhqwgppbu3t7ze
Tags: 3.9.10-4
KBSD patch from KiBi (Closes: #560796)

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
configure: Makefile.am configure.in
72
72
        dh_testdir
 
73
        touch NEWS README AUTHORS ChangeLog
73
74
        chmod +x debian/autogen.sh
74
75
        debian/autogen.sh
75
76
 
95
96
        # We prefer to regenerate these using pyuic
96
97
        (cd ui && for i in *.ui ; do rm -f $${i%.ui}.py ; done)
97
98
 
 
99
        rm -f NEWS README AUTHORS ChangeLog
 
100
 
98
101
        dh_clean
99
102
 
100
103
##
121
124
                --enable-foomatic-drv-install \
122
125
                --disable-foomatic-rip-hplip-install \
123
126
                --with-drvdir=\$${prefix}/share/cups/drv \
124
 
                --with-hpppddir=\$${prefix}/share/ppd/hpijs/HP \
 
127
                --with-hpppddir=\$${prefix}/share/ppd/hplip/HP \
125
128
                --datadir=\$${prefix}/share \
126
129
                --libexecdir=\$${prefix}/lib \
127
130
                --localstatedir=/var \
130
133
                --without-icondir \
131
134
                --disable-foomatic-xml-install \
132
135
                --disable-foomatic-ppd-install \
 
136
                --enable-hpcups-install \
133
137
                --enable-cups-drv-install \
 
138
                --enable-hpijs-install \
 
139
                --enable-foomatic-drv-install \
 
140
                --enable-foomatic-ppd-install \
134
141
                --enable-network-build \
135
142
                --enable-scan-build \
136
143
                --enable-gui-build \
137
144
                --enable-fax-build \
138
145
                --disable-qt3 \
139
146
                --enable-qt4 \
140
 
                --enable-policykit
 
147
                --enable-policykit \
 
148
                --enable-udev-acl-rules
141
149
 
142
150
        touch configure-stamp
143
151
 
170
178
        @cat debian/non-shipped-files.txt | \
171
179
                ( cd "$(PKGTMP)" && xargs -d '\n' -t -r rm -fv )
172
180
 
 
181
        # Uncompress PPDs, this makes the package smaller for distribution
 
182
        -find $(PPDDIR) -name '*.ppd.gz' | xargs gunzip -f
 
183
 
 
184
        # Remove identical PPD files shipped under different names
 
185
        ( cd "$(PKGTMP)" && fdupes -r1q usr/share/ppd | while read s; do \
 
186
              set -- $$(echo $$s | tr ' ' '\n' | sort); \
 
187
              f=$$1; shift; \
 
188
              for d; do \
 
189
                  echo "Removing duplicate PPD file $$d, original is $$f"; \
 
190
                  rm $$d; \
 
191
              done; \
 
192
          done )
 
193
 
173
194
        # Edit the generated hplip.conf
174
195
        ( cd "$(PKGTMP)/etc/hp" && \
175
196
          cat hplip.conf | \
204
225
                    dest=hp-$${file%.py}; \
205
226
                    ln -s /usr/share/hplip/$$file \
206
227
                        ../../bin/$$dest 2>/dev/null || :; \
207
 
                    ../../bin/$$dest --help-man > $(CURDIR)/$$dest.1 \
208
 
                        2>/dev/null || rm -f $(CURDIR)/$$dest.1 || :; \
 
228
                    PYTHONPATH=../../lib/python2.5/site-packages/:../../lib/python2.6/dist-packages/  LD_LIBRARY_PATH=../../lib/ ../../bin/$$dest --help-man > $(CURDIR)/$$dest.1 ; \
209
229
                fi; \
210
230
            done \
211
231
        )
240
260
        install -m 755 hplipjs "$(PKGTMP)/usr/lib/cups/filter/"
241
261
 
242
262
        # Fax PPDs, install to destdir directly
243
 
        mkdir -p "$(CURDIR)/debian/hpijs/usr/share/ppd/hpijs/HP"
244
 
        #sed < "fax/ppd/HP-Fax-hplip.ppd" \
245
 
        #       -e '/^[*]NickName:/ s/" *$$/ - HPLIP $(HPLIP_UPSTREAM_VERSION)"/' \
246
 
        #       | perl -p -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",' \
247
 
        #       | gzip -9 \
248
 
        #       > "$(CURDIR)/debian/hpijs/usr/share/ppd/hpijs/HP/HP-Fax-hplip.ppd.gz"
249
 
        zcat "fax/ppd/HP-Fax-hplip.ppd.gz" \
250
 
                | perl -p -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",' \
251
 
                | gzip -9 \
252
 
                > "$(CURDIR)/debian/hpijs/usr/share/ppd/hpijs/HP/HP-Fax-hplip.ppd.gz"
253
 
        zcat "fax/ppd/HP-Fax2-hplip.ppd.gz" \
254
 
                | perl -p -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",' \
255
 
                | gzip -9 \
256
 
                > "$(CURDIR)/debian/hpijs/usr/share/ppd/hpijs/HP/HP-Fax2-hplip.ppd.gz"
 
263
        mkdir -p "$(CURDIR)/debian/hpijs/usr/share/ppd/hplip/HP"
 
264
        mkdir -p "$(CURDIR)/debian/hplip-cups/usr/share/ppd/hplip/HP"
 
265
 
 
266
        cp "fax/ppd/HP-Fax-hpijs.ppd.gz" \
 
267
           "$(CURDIR)/debian/hpijs/usr/share/ppd/hplip/HP/HP-Fax-hpijs.ppd.gz"
 
268
        cp "fax/ppd/HP-Fax2-hpijs.ppd.gz" \
 
269
           "$(CURDIR)/debian/hpijs/usr/share/ppd/hplip/HP/HP-Fax2-hpijs.ppd.gz"
 
270
 
 
271
        cp "fax/ppd/HP-Fax-hpcups.ppd.gz" \
 
272
           "$(CURDIR)/debian/hplip-cups/usr/share/ppd/hplip/HP/HP-Fax-hpcups.ppd.gz"
 
273
        cp "fax/ppd/HP-Fax2-hpcups.ppd.gz" \
 
274
           "$(CURDIR)/debian/hplip-cups/usr/share/ppd/hplip/HP/HP-Fax2-hpcups.ppd.gz"
 
275
 
 
276
        # Uncompress PPDs, this makes the package smaller for distribution
 
277
        -find $(PPDDIR) -name '*.ppd.gz' | xargs gunzip -f
257
278
 
258
279
        # Generate .fdi file for HAL setting "scanner" capability to all
259
280
        # HPLIP-supported devices (also without scanner), so that permissions
269
290
# install arch-independent packages specific files
270
291
install-indep: install-indep-stamp
271
292
install-indep-stamp: install-stamp install-arch-stamp
272
 
        # PPDs
273
 
        # 1. Append hplip identifier to the long nickname
274
 
        # 2. Correct filter name from "foomatic-rip-hplip" to "foomatic-rip"
275
 
        # 3. Install to basedir/<Manufacturer>/
276
 
        # 4. Normalize case of PPD file names
277
 
        # 5. Compress all PPDs
278
 
        # 
279
 
        # Fax PPDs: shipped by arch-dep hpijs package
280
 
        find ppd -type f -name '*-hpijs*.ppd' | \
281
 
        while read -r i ; do \
282
 
                PPDSUITE="hpijs" ;\
283
 
                PPDVENDOR=$$(sed -r -n \
284
 
                        -e '/^[*]Manufacturer/ { s/[^:]+:[[:blank:]]+"([^"]*)".*/\1/;s/[[:blank:]]//g;p }' \
285
 
                        < "$$i" ) ;\
286
 
                mkdir -p "$(PPDDIR)/$${PPDSUITE}/$${PPDVENDOR}" ;\
287
 
                PPDFILE=$$(echo "$$i" | sed -r -e 's#.*/([^/]+)$$#\1#' \
288
 
                        -e 's#(^|/)hp[-_]#HP-#i' \
289
 
                        -e s/series/Series/i -e s/color/Color/i \
290
 
                        -e s/office/Office/i -e s/business/Business/i \
291
 
                        -e s/jet/Jet/i -e s/ink/Ink/i -e s/desk/Desk/i \
292
 
                        -e s/smart/Smart/i -e s/photo/Photo/i -e s/psc/PSC/i \
293
 
                        -e s/printer_scanner_copier/PSC/i \
294
 
                        -e s/laser/Laser/i -e s/design/Design/i \
295
 
                        -e s/mfp/MFP/i -e s/aio/AIO/i -e s/pro/Pro/i \
296
 
                        -e 's/[-_]hpijs/-hpijs/i' ) ;\
297
 
                sed < "$$i" -e '/^[*]NickName:/ s/" *$$/ - HPLIP $(HPLIP_UPSTREAM_VERSION)"/' \
298
 
                        -e s/foomatic-rip-hplip/foomatic-rip/ \
299
 
                        | perl -p -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",' \
300
 
                        | gzip -9 \
301
 
                        > "$(PPDDIR)/$${PPDSUITE}/$${PPDVENDOR}/$${PPDFILE}.gz" ;\
302
 
                chmod 644 "$(PPDDIR)/$${PPDSUITE}/$${PPDVENDOR}/$${PPDFILE}.gz" ;\
303
 
        done
304
293
        # Remove the Fax PPDs, we have handled them in the arch-dependent part
305
294
        -find $(PPDDIR) -name '*Fax*.ppd*' | xargs rm
306
295
 
307
 
        # Ubuntu: uncompress again, makes the package smaller for distribution
308
 
        -find $(PPDDIR) -name '*.ppd.gz' | xargs gunzip -f
309
 
 
310
296
        dh_install -i "--sourcedir=$(PKGTMP)" --list-missing >install-indep-stamp 2>&1 || \
311
297
                ( echo "Last five lines of error log:" ; tail -n 5 install-indep-stamp ; exit 1 )
312
298