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 \
148
--enable-udev-acl-rules
142
150
touch configure-stamp
170
178
@cat debian/non-shipped-files.txt | \
171
179
( cd "$(PKGTMP)" && xargs -d '\n' -t -r rm -fv )
181
# Uncompress PPDs, this makes the package smaller for distribution
182
-find $(PPDDIR) -name '*.ppd.gz' | xargs gunzip -f
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); \
189
echo "Removing duplicate PPD file $$d, original is $$f"; \
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 ; \
240
260
install -m 755 hplipjs "$(PKGTMP)/usr/lib/cups/filter/"
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",' \
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",' \
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",' \
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"
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"
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"
276
# Uncompress PPDs, this makes the package smaller for distribution
277
-find $(PPDDIR) -name '*.ppd.gz' | xargs gunzip -f
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
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
279
# Fax PPDs: shipped by arch-dep hpijs package
280
find ppd -type f -name '*-hpijs*.ppd' | \
281
while read -r i ; do \
283
PPDVENDOR=$$(sed -r -n \
284
-e '/^[*]Manufacturer/ { s/[^:]+:[[:blank:]]+"([^"]*)".*/\1/;s/[[:blank:]]//g;p }' \
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",' \
301
> "$(PPDDIR)/$${PPDSUITE}/$${PPDVENDOR}/$${PPDFILE}.gz" ;\
302
chmod 644 "$(PPDDIR)/$${PPDSUITE}/$${PPDVENDOR}/$${PPDFILE}.gz" ;\
304
293
# Remove the Fax PPDs, we have handled them in the arch-dependent part
305
294
-find $(PPDDIR) -name '*Fax*.ppd*' | xargs rm
307
# Ubuntu: uncompress again, makes the package smaller for distribution
308
-find $(PPDDIR) -name '*.ppd.gz' | xargs gunzip -f
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 )