/[packages]/updates/1/hplip/current/SPECS/hplip.spec
ViewVC logotype

Annotation of /updates/1/hplip/current/SPECS/hplip.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 137952 - (hide annotations) (download)
Fri Sep 2 10:47:12 2011 UTC (12 years, 7 months ago) by doktor5000
Original Path: cauldron/hplip/current/SPECS/hplip.spec
File size: 26536 byte(s)
- disable simple-scan-as-default.patch for now, as it changes default scanning application
1 spuhler 49621 # Define if you want to build the sane backend (default)
2     %define sane_backend 1
3     %{?_with_sane: %global sane_backend 1}
4     %{?_without_sane: %global sane_backend 0}
5    
6     %define hpip_major 0
7     %define hpip_libname %mklibname hpip %{hpip_major}
8    
9     %define sane_hpaio_major 1
10     %define sane_hpaio_libname %mklibname sane-hpaio %{sane_hpaio_major}
11    
12     # Suppress automatically generated Requires for devel packages
13     %define _requires_exceptions devel\(.*\)
14    
15     #define extraversion -RC1
16     %define extraversion %nil
17    
18     Summary: HP printer/all-in-one driver infrastructure
19     Name: hplip
20 doktor5000 137692 Version: 3.11.7
21     Release: %mkrel 1
22 spuhler 49621 License: GPLv2+ and MIT
23     Group: System/Printing
24 cjw 85144 Source: http://heanet.dl.sourceforge.net/sourceforge/hplip/%{name}-%{version}%{extraversion}.tar.gz
25     Source1: hpcups-update-ppds.sh
26 doktor5000 137692 Source2: copy-deviceids.py
27 spuhler 49621
28 doktor5000 137692
29     # (doktor5000) fix linking with python and libsane
30     # taken from mandriva
31     Patch1: hplip-3.11.3-mdv-link.patch
32    
33 spuhler 49621 # Fedora patches
34     Patch101: hplip-pstotiff-is-rubbish.patch
35     Patch102: hplip-strstr-const.patch
36     Patch103: hplip-ui-optional.patch
37     Patch104: hplip-no-asm.patch
38     Patch105: hplip-deviceIDs-drv.patch
39     Patch106: hplip-mucks-with-spooldir.patch
40     Patch107: hplip-udev-rules.patch
41     Patch108: hplip-retry-open.patch
42 doktor5000 137692 Patch109: hplip-snmp-quirks.patch
43 spuhler 49621 Patch110: hplip-discovery-method.patch
44 doktor5000 137692 Patch111: hplip-hpijs-marker-supply.patch
45 spuhler 49621 Patch112: hplip-clear-old-state-reasons.patch
46     Patch114: hplip-hpcups-sigpipe.patch
47 doktor5000 137692 Patch115: hplip-fax-ppd.patch
48 spuhler 49621 Patch116: hplip-bad-low-ink-warning.patch
49     Patch117: hplip-deviceIDs-ppd.patch
50     Patch118: hplip-skip-blank-lines.patch
51     Patch119: hplip-dbglog-newline.patch
52     Patch120: hplip-no-system-tray.patch
53 doktor5000 137692 Patch122: hplip-ppd-ImageableArea.patch
54     Patch125: hplip-raw_deviceID-traceback.patch
55     Patch126: hplip-UnicodeDecodeError.patch
56     Patch127: hplip-emit-SIGNAL.patch
57     Patch128: hplip-fab-root-crash.patch
58     Patch129: hplip-addprinter.patch
59     Patch130: hplip-dbus-exception.patch
60     Patch131: hplip-hpaio-segfault.patch
61     Patch132: hplip-newline.patch
62     Patch133: hplip-dbus-threads.patch
63     Patch134: hplip-notification-exception.patch
64 spuhler 49621 Patch135: hplip-CVE-2010-4267.patch
65 doktor5000 137692 Patch136: hplip-wifisetup.patch
66     Patch137: hplip-CVE-2011-2722.patch
67 spuhler 49621
68     # Debian/Ubuntu patches
69 doktor5000 137692 # taken from http://patch-tracker.debian.org/package/hplip/3.11.5-2
70     Patch201: 01_rss.dpatch
71     Patch202: 10_shebang_fixes.dpatch
72     Patch203: 14_charsign_fixes.dpatch
73     Patch204: 85_rebuild_python_ui.dpatch
74     Patch205: 87_move_documentation.dpatch
75     Patch206: hplip-photosmart_b9100_support.patch
76     Patch207: hplip-pjl-duplex-binding.patch
77     Patch208: mga-kde4-kdesudo-support.dpatch
78     Patch209: hp-check-groups.dpatch
79     Patch210: hp-check_debian.dpatch
80     Patch211: hp-setup-prompt-for-custom-PPD.dpatch
81     # (doktor5000) rediff original debian patch for hplip 3.11.7
82     Patch212: mga-udev-rules-use-attrs-not-sysfs-and-hp-mkuri-call-fix.patch
83     Patch213: hp-mkuri-take-into-account-already-installed-plugin-also-for-exit-value.dpatch
84     Patch214: ubuntu-hp-mkuri-notification-text.dpatch
85     Patch215: simple-scan-as-default.dpatch
86     Patch216: make-commafy-correctly-work-with-python-2.dpatch
87     # (doktor5000) rediff original debian patch for hplip 3.11.7
88     Patch217: mga-remove-duplicate-entry-for-cp1700-in-drv-files.patch
89     #already applied
90     Patch218: black-stripes-on-pcl5c-printouts.dpatch
91     Patch219: try_libhpmud.so.0.dpatch
92     Patch220: add-lidil-two-cartridge-modes.dpatch
93     Patch221: add_missing_newline_for_error_log.dpatch
94     Patch222: large-sizes-borderless-on-photosmart-pro-b-series.dpatch
95     Patch223: more-user-friendly-choice-names-for-installed-cartridges.dpatch
96 spuhler 49621
97     Url: http://hplip.sourceforge.net/
98     %if %{sane_backend}
99     BuildRequires: libsane-devel, xsane
100     %endif
101     %py_requires -d
102     BuildRequires: python-sip >= 4.1.1
103     BuildRequires: net-snmp-devel
104     BuildRequires: libusb-devel >= 0.1.8
105     BuildRequires: imagemagick
106     BuildRequires: autoconf
107     BuildRequires: libcups-devel
108     BuildRequires: libjpeg-devel
109     BuildRequires: python-devel
110     BuildRequires: desktop-file-utils
111     BuildRequires: libdbus-devel
112     BuildRequires: udev-devel
113     BuildRequires: polkit
114     BuildRequires: gphoto2-devel
115     BuildRequires: libv4l-devel
116     Requires: cups
117     # For dynamic ppd generation.
118     Requires: cupsddk-drivers >= 1.2.3-2mdv
119     Requires: foomatic-filters
120     Requires: hplip-model-data hplip-hpijs
121     Requires: hplip-hpijs-ppds
122     Requires: python-sip >= 4.1.1
123     # Needed for communicating with ethernet-connected printers
124     Requires: net-snmp-mibs
125     # Needed to generate fax cover pages
126     Requires: python-reportlab
127     # Needed since 2.8.4 for IPC
128     Requires: python-dbus
129     Requires: polkit-agent
130     Requires: usermode-consoleonly
131     Requires: python-gobject
132     # Required by hp-scan for command line scanning
133 cjw 95747 Requires: python-imaging
134     Requires: sane-backends-hpaio
135 doktor5000 137692 # Needed to avoid misleading errors about network connectivity (RH bug #705843)
136     Requires: wget
137 cjw 95747 # Some HP ppds are in foomatic-db and foomatic-db-hpijs (mdv bug #47415)
138 spuhler 49621 Suggests: foomatic-db-hpijs
139    
140     # foomatic-db-hpijs drivers are provided by hp and by this package now
141     # NOTE: remove the foomatic-db-hpijs deps sometime in 2010-10-?? ?
142     Provides: foomatic-db-hpijs = %{version}-%{release}
143     Obsoletes: foomatic-db-hpijs
144    
145 spuhler 49623
146 spuhler 49621 %description
147     This is the HP driver package to supply Linux support for most
148     Hewlett-Packard DeskJet, LaserJet, PSC, OfficeJet, and PhotoSmart
149     printers and all-in-one peripherals (also known as Multi-Function
150     Peripherals or MFPs), which can print, scan, copy, fax, and/or access
151     flash memory cards.
152    
153     It is work in progress, but printing, scanning, memory card access,
154     ink/toner/battery/consumable level checking, and inkjet printer
155     maintenance are supported on most models, when either connected to the
156     USB or LAN (built-in interfaces or selected HP JetDirect models) on a
157     Linux workstation with CUPS printing system.
158    
159     For status and consumable checking and also for inkjet maintenance
160     there is the graphical tool "hp-toolbox" available (Menu:
161     "System"/"Monitoring"/"HP Printer Toolbox").
162    
163     %package -n %{hpip_libname}
164     Summary: Dynamic library for the "hplip" HP printer/all-in-one drivers
165     Group: System/Printing
166    
167     %description -n %{hpip_libname}
168     Library needed for the "hplip" HP printer/all-in-one drivers
169    
170     %package -n %{hpip_libname}-devel
171     Summary: Headers and links to compile against the "%{hpip_libname}" ("hplip") library
172     Group: Development/C
173     Requires: %{hpip_libname} >= %{version}-%{release}
174     Provides: libhpip-devel = %{version}-%{release}
175    
176     %description -n %{hpip_libname}-devel
177     This package contains all files which one needs to compile programs using
178     the "%{hpip_libname}" library.
179    
180     %if %{sane_backend}
181     %package -n %{sane_hpaio_libname}
182     Summary: SANE driver for scanners in HP's multi-function devices (from HPLIP)
183     Group: System/Printing
184     Requires: sane-backends
185 cjw 95747 Provides: sane-backends-hpaio = %{version}-%{release}
186 cjw 106663 # (cjw) for system-config-printer
187     Provides: libsane-hpaio
188 spuhler 49621 %define _requires_exceptions devel(libcrypto)\\|devel(libdl)\\|devel(libhpip)\\|devel(libm)\\|devel(libsnmp)
189     %endif
190    
191     %if %{sane_backend}
192     %description -n %{sane_hpaio_libname}
193     SANE driver for scanners in HP's multi-function devices (from HPLIP)
194     %endif
195    
196     %if 0
197     %if %{sane_backend}
198     %package -n %{sane_hpaio_libname}-devel
199     Summary: Headers and links to compile against the "%{sane_hpaio_libname}" ("sane-hpaio") library
200     Group: Development/C
201     Requires: %{sane_hpaio_libname} >= %{version}-%{release}
202     Provides: libsane-hpaio-devel = %{version}-%{release}
203     %endif
204    
205     %if %{sane_backend}
206     %description -n %{sane_hpaio_libname}-devel
207     This package contains all files which one needs to compile programs using
208     the "%{sane_hpaio_libname}" library.
209     %endif
210     %endif
211    
212     %package model-data
213     Summary: Data file listing the HP printer models supported by HPLIP
214     Group: System/Printing
215    
216     %description model-data
217     HPLIP supports most current HP printers and multifunction devices, but
218     there are some older models not supported. This package contains the
219     list of supported models. Printerdrake installs it automatically to
220     determine whether HPLIP has to be installed or not.
221    
222     %package gui
223     Summary: HPLIP graphical tools
224     Group: System/Printing
225     Requires:python-qt4-gui
226     Requires: %{name} = %{version}-%{release}
227     Requires: usermode
228    
229     %description gui
230     HPLIP graphical tools.
231    
232    
233     %package hpijs
234     Summary: HPs printer driver IJS plug-in for GhostScript
235     Group: System/Printing
236     Requires: ghostscript
237     Provides: hpijs
238    
239     %description hpijs
240     HPs printer driver IJS plug-in for GhostScript. This driver gives full
241     printing support for nearly all non-PostScript inkjet and laser
242     printers made by HP.
243    
244     %package hpijs-ppds
245     Summary: PPD files for the HPIJS printer driver
246     Group: System/Printing
247     Requires: foomatic-filters, hplip-hpijs
248    
249     %description hpijs-ppds
250     PPD files to use the HPIJS printer driver with foomatic-rip and a
251     printer spooler like CUPS, LPRng, PDQ, ...
252    
253     %package doc
254     Summary: Documentation for HPLIP
255     Group: System/Printing
256    
257     %description doc
258     This package contains documentation for the HPLIP driver.
259    
260     This is the HP driver package to supply Linux support for most
261     Hewlett-Packard DeskJet, LaserJet, PSC, OfficeJet, and PhotoSmart
262     printers and all-in-one peripherals (also known as Multi-Function
263     Peripherals or MFPs), which can print, scan, copy, fax, and/or access
264     flash memory cards.
265    
266     %prep
267     rm -rf $RPM_BUILD_DIR/%{name}-%{version}%{extraversion}
268     %setup -q -n %{name}-%{version}%{extraversion}
269    
270     # Fedora patches
271    
272     # The pstotiff filter is rubbish so replace it (launchpad #528394).
273     %patch101 -p1 -b .pstotiff-is-rubbish
274    
275     # Fix compilation.
276     %patch102 -p1 -b .strstr-const
277    
278     # Make utils.checkPyQtImport() look for the gui sub-package (RH bug #243273).
279     %patch103 -p1 -b .ui-optional
280    
281     # Make sure to avoid handwritten asm.
282     %patch104 -p1 -b .no-asm
283    
284     # Corrected several IEEE 1284 Device IDs using foomatic data.
285 doktor5000 137692 # HP LaserJet P1007 (RH bug #585272).
286     # HP LaserJet P1505 (RH bug #680951).
287     # HP Color LaserJet CM1312nfi (RH bug #581005).
288     # HP Color LaserJet 3800 (RH bug #581935).
289     # HP Color LaserJet 2840 (RH bug #582215).
290     # HP Color LaserJet CP1518ni (RH bug #613689).
291     # HP Color LaserJet 2600n (RH bug #613712).
292     # HP LaserJet 4050 Series/4100 Series/2100 Series/4350/5100 Series/8000 Series
293     # P3005/P3010 Series/P4014/P4515 (RH bug #659039).
294     # HP Color LaserJet 2500/3700/4550/4600/4650/4700/5550/CP1515n/CP2025n
295     # CP3525/CP4520 Series/CM2320nf (RH bug #659040).
296     # HP Color LaserJet CP2025dn (RH bug #651509).
297     # HP Color LaserJet CM4730 MFP (RH bug #658831).
298     # HP Color LaserJet CM3530 MFP (RH bug #659381).
299     # HP LaserJet Professional P1606dn (RH bug #708472).
300     %patch105 -p1 -b .deviceIDs-drv
301 spuhler 49621
302 doktor5000 137692 mv prnt/drv/hpijs.drv.in{,.deviceIDs-drv-hpijs}
303     python %{SOURCE2} prnt/drv/hpcups.drv.in \
304     prnt/drv/hpijs.drv.in.deviceIDs-drv-hpijs \
305     > prnt/drv/hpijs.drv.in
306    
307 spuhler 49621 # Stopped hpcups pointlessly trying to read spool files
308     # directly (RH bug #552572).
309     %patch106 -p1 -b .mucks-with-spooldir
310    
311     # Retry when connecting to device fails (RH bug #532112).
312     %patch108 -p1 -b .retry-open
313    
314 doktor5000 137692 # Mark SNMP quirks in PPD for HP OfficeJet Pro 8500 (RH bug #581825).
315     %patch109 -p1 -b .snmp-quirks
316    
317 spuhler 49621 # Fixed hp-setup traceback when discovery page is skipped (RH bug #523685).
318     %patch110 -p1 -b .discovery-method
319    
320 doktor5000 137692 # Fixed bogus low ink warnings from hpijs driver (RH bug #643643).
321     %patch111 -p1 -b .hpijs-marker-supply
322 spuhler 49621
323 doktor5000 137692 # Clear old printer-state-reasons we used to manage (RH bug #510926).
324 spuhler 49621 %patch112 -p1 -b .clear-old-state-reasons
325    
326     # Avoid busy loop in hpcups when backend has exited (RH bug #525944).
327     %patch114 -p1 -b .hpcups-sigpipe
328    
329 doktor5000 137692 # Use correct fax PPD name for Qt3 UI.
330     %patch115 -p1 -b .fax-ppd
331    
332 spuhler 49621 # Fixed Device ID parsing code in hpijs's dj9xxvip.c (RH bug #510926).
333     %patch116 -p1 -b .bad-low-ink-warning
334    
335     # Add Device ID for
336 doktor5000 137692 # HP LaserJet 1200 (RH bug #577308)
337     # HP LaserJet 1320 series (RH bug #579920)
338     # HP LaserJet 2300 (RH bug #576928)
339     # HP LaserJet P2015 Series (RH bug #580231)
340     # HP LaserJet 4250 (RH bug #585499).
341     # HP Color LaserJet 2605dn (RH bug #583953).
342     # HP Color LaserJet 3800 (RH bug #581935).
343     # HP Color LaserJet 2840 (RH bug #582215).
344     # HP LaserJet 4050 Series/4100 Series/2100 Series/2420/4200/4300/4350/5100 Series
345     # 8000 Series/M3027 MFP/M3035 MFP/P3005/P3010 Series (RH bug #659039).
346     # HP Color LaserJet 2500/2550/2605dn/3700/4550/4600
347     # 4650/4700/5550/CP3525 (RH bug #659040).
348     # HP Color LaserJet CM4730 MFP (RH bug #658831).
349     # HP Color LaserJet CM3530 MFP (RH bug #659381).
350 spuhler 49621 for ppd_file in $(grep '^diff' %{PATCH117} | cut -d " " -f 4);
351     do
352     gunzip ${ppd_file#*/}.gz
353     done
354     %patch117 -p1 -b .deviceIDs-ppd
355     for ppd_file in $(grep '^diff' %{PATCH117} | cut -d " " -f 4);
356     do
357     gzip -n ${ppd_file#*/}
358     done
359    
360     # Hpcups (ljcolor) was putting black lines where should be blank lines (RH bug #579461).
361     %patch118 -p1 -b .skip-blank-lines
362    
363 doktor5000 137692 # Added missing newline to string argument in dbglog() call (RH bug #585275).
364 spuhler 49621 %patch119 -p1 -b .dbglog-newline
365    
366 doktor5000 137692 # Wait longer to see if a system tray becomes available (RH bug #569969).
367 spuhler 49621 %patch120 -p1 -b .no-system-tray
368    
369 doktor5000 137692 # Fix ImageableArea for Laserjet 8150/9000 (RH bug #596298).
370     for ppd_file in $(grep '^diff' %{PATCH122} | cut -d " " -f 4);
371     do
372     gunzip ${ppd_file#*/}.gz
373     done
374     %patch122 -p1 -b .ImageableArea
375     for ppd_file in $(grep '^diff' %{PATCH122} | cut -d " " -f 4);
376     do
377     gzip -n ${ppd_file#*/}
378     done
379 spuhler 49621
380 doktor5000 137692 # Fixed traceback on error condition in device.py (RH bug #628125).
381     %patch125 -p1 -b .raw_deviceID-traceback
382 spuhler 49621
383 doktor5000 137692 # Avoid UnicodeDecodeError in printsettingstoolbox.py (RH bug #645739).
384     %patch126 -p1 -b .UnicodeDecodeError
385 spuhler 49621
386 doktor5000 137692 # Don't emit SIGNALs in ui4.setupdialog.SetupDialog the PyQt3 way (RH bug #623834).
387     %patch127 -p1 -b .emit-SIGNAL
388 spuhler 49621
389     # Prevent hp-fab traceback when run as root.
390 doktor5000 137692 %patch128 -p1 -b .fab-root-crash
391 spuhler 49621
392     # Call cupsSetUser in cupsext's addPrinter method before connecting so
393 doktor5000 137692 # that we can get an authentication callback (RH bug #538352).
394     %patch129 -p1 -b .addprinter
395 spuhler 49621
396 doktor5000 137692 # Catch D-Bus exceptions in fax dialog (RH bug #645316).
397     %patch130 -p1 -b .dbus-exception
398 spuhler 49621
399 doktor5000 137692 # Prevent hpaio segfaulting on invalid URIs (RH bug #649092).
400     %patch131 -p1 -b .hpaio-segfault
401 spuhler 49621
402     # Another missing newline in filter output (Ubuntu #418053).
403 doktor5000 137692 %patch132 -p1 -b .newline
404 spuhler 49621
405 doktor5000 137692 # Enable D-Bus threading (and require pygobject2) (RH bug #600932).
406     %patch133 -p1 -b .dbus-threads
407 spuhler 49621
408 doktor5000 137692 # Catch GError exception when notification showing failed (RH bug #665577).
409     %patch134 -p1 -b .notification-exception
410 spuhler 49621
411     # Applied patch to fix CVE-2010-4267, remote stack overflow
412 doktor5000 137692 # vulnerability (RH bug #670252).
413 spuhler 49621 %patch135 -p1 -b .CVE-2010-4267
414    
415 doktor5000 137692 # Avoid KeyError in ui4/wifisetupdialog.py (RH bug #680939).
416     %patch136 -p1 -b .wifisetup
417     %patch137 -p1 -b .CVE-2011-2722
418 spuhler 49621
419 doktor5000 137692 sed -i.duplex-constraints \
420     -e 's,\(UIConstraints.* \*Duplex\),//\1,' \
421     prnt/drv/hpcups.drv.in
422 spuhler 49621
423 doktor5000 137692 # Debian/Ubuntu patches
424 spuhler 49621
425     # This patch tries to make sure that black is printed with just
426     # the black pen, if the printer supports it
427 doktor5000 137692 %patch201 -p1 -b .01_rss
428 spuhler 49621
429 doktor5000 137692 # shebang fixes
430     %patch202 -p1 -b .10_shebang_fixes
431    
432 spuhler 49621 # code cleanup related to char signedness
433 doktor5000 137692 %patch203 -p1 -b .14_charsign
434 spuhler 49621
435 doktor5000 137692 # compiling ui files to py
436     %patch204 -p1 -b .85_rebuild_python_ui
437 spuhler 49621
438     # place html documentation under hplip-doc/HTML/
439 doktor5000 137692 %patch205 -p1 -b .87_move_documentation
440 spuhler 49621
441 doktor5000 137692 # Corrections on the models.dat entry for the HP PhotoSmart Pro B9100,
442     # especially for the correct color calibration mode.
443     %patch206 -p1 -b .hplip-photosmart_b9100_support
444    
445     # Fixes Short-edge duplex printing if duplex is PJL-controlled
446     # https://bugs.launchpad.net/hplip/+bug/244295
447     %patch207 -p1 -b .hplip-pjl-duplex-binding
448    
449     # original patch from debian, path to kdesu added for %%_libdir on x86_64
450     %patch208 -p1 -b .mga-kde4-kdesudo-support
451    
452     # https://bugs.launchpad.net/debian/+source/hplip/+bug/530746
453     %patch209 -p1 -b .hp-check-groups
454    
455 spuhler 49621 # Check for hpaio module in /etc/sane.d/dll.d/hplip too
456 doktor5000 137692 %patch210 -p1 -b .hp-check_debian
457 spuhler 49621
458 doktor5000 137692 %patch211 -p1 -b .hp-setup-prompt-for-custom-PPDs
459 spuhler 49621
460 doktor5000 137692 # Fix use of deprecated udev syntax
461     # https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/491346
462     %patch212 -p1 -b .mga-udev-rules-use-attrs-not-sysfs-and-hp-mkuri-call-fix
463 cjw 98894
464 doktor5000 137692 %patch213 -p1 -b .hp-mkuri-take-into-account-already-installed-plugin-also-for-exit-value
465    
466 doktor5000 137952 # disable for now, as this changes default hplip behavior
467     # and change in default scanning application should be decided by a poll first
468     #%patch215 -p1 -b .simple-scan-as-default
469 doktor5000 137692
470     %patch216 -p1 -b .make-commafy-correctly-work-with-python-2
471    
472     %patch217 -p1 -b .mga-remove-duplicate-entry-for-cp1700-in-drv-files
473    
474     # dlopen libhpmud.so.0 instad of libhpmud.so, in order not to depend on
475     # devel package (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548379)
476     # obsoletes hplip-3.9.8-dlopen-libhpmud.patch, newer & extended version
477     %patch219 -p1 -b .try_libhpmud.so.0
478    
479     %patch220 -p1 -b .add-lidil-two-cartridge-modes
480    
481     %patch222 -p1 -b .large-sizes-borderless-on-photosmart-pro-b-series
482    
483     %patch223 -p1 -b .more-user-friendly-choice-names-for-installed-cartridges
484    
485 spuhler 49621 # Make all files in the source user-writable
486     chmod -R u+w .
487    
488     %build
489     %serverbuild
490     #needed by patch205
491     libtoolize --copy --force
492     aclocal --force
493     autoconf -f
494     #needed by patches 205 and 210
495     automake -f --foreign
496    
497     %if !%{sane_backend}
498     WITHOUT_SANE="--without-sane"
499     %endif
500     %configure2_5x $WITHOUT_SANE \
501     --disable-foomatic-rip-hplip-install \
502     --enable-scan-build \
503     --enable-gui-build \
504     --enable-fax-build \
505     --enable-pp-build \
506     --enable-qt4 --disable-qt3 \
507     --enable-hpcups-install \
508     --enable-cups-drv-install \
509     --enable-cups-ppd-install \
510     --enable-hpijs-install \
511     --enable-udev-acl-rules \
512     --enable-policykit \
513     --with-mimedir=%{_datadir}/cups/mime
514    
515     sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
516     sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
517    
518     %make
519    
520     # convert icons to required sizes
521     #convert data/images/print.png -resize 16x16 %{name}.mini.png
522     #convert data/images/print.png -resize 32x32 %{name}.png
523     #convert data/images/print.png -resize 48x48 %{name}.large.png
524    
525     %install
526     rm -rf %{buildroot}
527     mkdir -p %{buildroot}%{_bindir}
528     mkdir -p %{buildroot}%{_includedir}
529     mkdir -p %{buildroot}%{_initrddir}
530     mkdir -p %{buildroot}%{_sysconfdir}/hp
531     mkdir -p %{buildroot}/var/run/hplip
532    
533     # Do not use the macro here, use the standard DESTDIR method as it works
534     # with HPLIP, in contrary to the non-standard Mandriva method
535     #make test-destdir DESTDIR=%{buildroot}
536     make install DESTDIR=%{buildroot}
537    
538     # Install files which the "make install" missed to install
539     install -m 644 ip/hpip.h %{buildroot}%{_includedir}
540     install -m 644 ip/xform.h %{buildroot}%{_includedir}
541    
542     # Move doc in sub-package
543     mv %{buildroot}%{_docdir}/%{name}-%{version}%{extraversion} %{buildroot}%{_docdir}/%{name}-doc-%{version}%{extraversion}
544    
545     # Remove static libraries of SANE driver
546     rm -f %{buildroot}%{_libdir}/sane/libsane-hpaio*.so
547     rm -f %{buildroot}%{_libdir}/sane/libsane-hpaio*.la
548     rm -f %{buildroot}%{_sysconfdir}/sane.d/dll.conf
549    
550     # Remove other unneeded files
551     rm -f %{buildroot}%{py_platsitedir}/*.la
552    
553     # install menu icons
554     #mkdir -p %{buildroot}%{_iconsdir}/locolor/16x16/apps/
555     #install -m 644 %{name}.png -D %{buildroot}%{_iconsdir}/%{name}.png
556     #install -m 644 %{name}.mini.png -D %{buildroot}%{_miconsdir}/%{name}.png
557     #install -m 644 %{name}.large.png -D %{buildroot}%{_liconsdir}/%{name}.png
558    
559     mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
560     desktop-file-install --vendor='' \
561     --dir=%{buildroot}%{_datadir}/applications \
562     --remove-category='Application' \
563     --remove-category='Utility' \
564     --add-category='System' \
565     --add-category='Settings' \
566     --add-category='Printing' \
567     --add-category='Qt' \
568     --add-category='HardwareSettings' \
569     --add-category='X-MandrivaLinux-CrossDesktop' \
570     --remove-key='Version' \
571     %{buildroot}%{_datadir}/applications/hplip.desktop
572    
573 wally 91745 cat > $RPM_BUILD_ROOT%{_datadir}/applications/%{_real_vendor}-hp-sendfax.desktop << EOF
574 spuhler 49621 [Desktop Entry]
575     Name=HP Sendfax
576     Comment=Utility for sending faxes with HP's multi-function devices
577     Exec=%{_bindir}/hp-sendfax
578     Icon=%{_datadir}/%{name}/data/images/32x32/fax_machine.png
579     Terminal=false
580     Type=Application
581     Categories=TelephonyTools;Qt;Printing;Utility;X-MandrivaLinux-CrossDesktop;
582     EOF
583     #' #Fix vim's stupid syntax
584    
585 doktor5000 137692 # The systray applet doesn't work properly (displays icon as a
586     # window), so don't ship the launcher yet.
587 spuhler 49621 rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
588    
589 dmorgan 106333
590 spuhler 49621 # switched to udev, no need for hal information
591 dmorgan 106333 rm -rf %{buildroot}%{_datadir}/hal/fdi
592 spuhler 49621
593 dmorgan 106333 rm -f %{buildroot}%{_libdir}/*.la \
594     %{buildroot}%{python_sitearch}/*.la \
595     %{buildroot}%{_libdir}/sane/*.la
596    
597 spuhler 49621 # Regenerate hpcups PPDs on upgrade if necessary (bug #579355).
598     install -p -m755 %{SOURCE1} %{buildroot}%{_bindir}/hpcups-update-ppds
599    
600     # Fedora pstotiff
601     rm -f %{buildroot}%{_sysconfdir}/cups/pstotiff.types
602     rm -f %{buildroot}%{_datadir}/cups/mime/pstotiff.types
603     rm -f %{buildroot}%{_datadir}/hplip/fax/pstotiff*
604     rm -f %{buildroot}%{_prefix}/lib/cups/filter/hpcac
605    
606     # bork?
607     install -d %{buildroot}%{_sysconfdir}/cups
608     cp -p %{buildroot}%{_datadir}/cups/mime/pstotiff.convs %{buildroot}%{_sysconfdir}/cups/pstotiff.convs
609    
610     # set up consolehelper
611     mkdir -p %{buildroot}%{_sbindir}
612     mv %{buildroot}%{_bindir}/hp-setup %{buildroot}%{_sbindir}/hp-setup
613     ln -s consolehelper %{buildroot}%{_bindir}/hp-setup
614    
615     # Make sure pyc files are generated, otherwise we can get
616     # difficult to debug problems
617     pushd %{buildroot}%{_datadir}/%{name}
618     python -m compileall .
619     popd
620    
621     %triggerin -- hplip < 2.7.7
622     chkconfig --del hplip
623    
624     # Restart CUPS to make the Fax PPD known to it
625     if [ -f /etc/init.d/cups ]; then
626     /sbin/service cups condrestart || :
627     fi
628    
629     %post -n hplip-hpijs-ppds
630     # Restart CUPS to make the printing PPDs known to it
631     if [ -f /etc/init.d/cups ]; then
632     /sbin/service cups condrestart || :
633     fi
634    
635     %post -n hplip-hpijs
636     %{_bindir}/hpcups-update-ppds &>/dev/null ||:
637    
638     %post -n hplip-model-data
639     /sbin/udevadm trigger --subsystem-match=usb --attr-match=idVendor=03f0
640    
641    
642     %if %{sane_backend}
643     %post -n %{sane_hpaio_libname}
644 spuhler 49623
645 spuhler 49621 # Add HPLIP driver to /etc/sane.d/dll.conf
646     if ! grep ^hpaio /etc/sane.d/dll.conf >/dev/null 2>/dev/null ; then \
647     echo hpaio >> /etc/sane.d/dll.conf; \
648     fi
649     %endif
650    
651     %if %{sane_backend}
652     %preun -n %{sane_hpaio_libname}
653     # Remove HPLIP driver from /etc/sane.d/dll.conf
654     if [ "$1" = 0 ]; then \
655     if grep ^hpaio /etc/sane.d/dll.conf >/dev/null 2>/dev/null ; then \
656     sed '/hpaio/d' /etc/sane.d/dll.conf > /tmp/$$; \
657     cp -f /tmp/$$ /etc/sane.d/dll.conf; \
658     rm -f /tmp/$$; \
659     fi; \
660     fi
661     %endif
662    
663     # Restart CUPS to make the removal of the Fax PPD known to it
664     if [ -f /etc/init.d/cups ]; then
665     /sbin/service cups condrestart || :
666     fi
667    
668     %postun -n hplip-hpijs-ppds
669     # Restart CUPS to make the removal of the printing PPDs known to it
670     if [ -f /etc/init.d/cups ]; then
671     /sbin/service cups condrestart || :
672     fi
673    
674    
675     %if %{sane_backend}
676     %postun -n %{sane_hpaio_libname}
677     %endif
678    
679     %clean
680     rm -rf %{buildroot}
681    
682     %files
683     %defattr(-,root,root)
684     #doc COPYING doc/*
685     %config(noreplace) %{_sysconfdir}/hp
686     %dir /var/run/hplip/
687     %{_bindir}/hp-align
688     %{_bindir}/hp-clean
689     %{_bindir}/hp-colorcal
690     %{_bindir}/hp-devicesettings
691     %{_bindir}/hp-fab
692     %{_bindir}/hp-faxsetup
693     %{_bindir}/hp-firmware
694     %{_bindir}/hp-info
695     %{_bindir}/hp-levels
696     %{_bindir}/hp-linefeedcal
697     %{_bindir}/hp-makecopies
698     %{_bindir}/hp-makeuri
699     %{_bindir}/hp-mkuri
700     %{_bindir}/hp-pkservice
701     %{_bindir}/hp-plugin
702     %{_bindir}/hp-pqdiag
703     %{_bindir}/hp-printsettings
704     %{_bindir}/hp-probe
705     %{_bindir}/hp-query
706     %{_bindir}/hp-scan
707     %{_bindir}/hp-sendfax
708     %{_bindir}/hp-setup
709     %{_sbindir}/hp-setup
710     %{_bindir}/hp-testpage
711     %{_bindir}/hp-timedate
712     %{_bindir}/hp-unload
713     %{_bindir}/hp-wificonfig
714    
715     %exclude %{_datadir}/hplip/data/models
716     # C libraries for Python
717     %{_libdir}/python*/*/*.so*
718     # CUPS backends (0755 permissions, so that CUPS 1.2 runs these backends
719     # as lp user)
720     # Note: this must be /usr/lib not %{_libdir}, since that's the
721     # CUPS serverbin directory.
722     %attr(0755,root,root) %{_prefix}/lib/cups/backend/hp*
723     %{_prefix}/lib/cups/filter/hplipjs
724     %{_prefix}/lib/cups/filter/hpcups
725     %{_prefix}/lib/cups/filter/hpcupsfax
726 cjw 85139 %{_prefix}/lib/cups/filter/hpps
727 spuhler 49621 %{_prefix}/lib/cups/filter/pstotiff
728     %{_datadir}/cups/mime/pstotiff.convs
729     %config(noreplace) %{_sysconfdir}/cups/pstotiff.convs
730     %{_datadir}/ppd/HP/HP-Fax*.ppd*
731     %{_datadir}/cups/drv/hp/hpcups.drv
732     # Files
733     %dir %{_datadir}/hplip
734     %{_datadir}/hplip/align.py*
735     %{_datadir}/hplip/clean.py*
736     %{_datadir}/hplip/colorcal.py*
737     %{_datadir}/hplip/devicesettings.py*
738     %{_datadir}/hplip/fab.py*
739     %{_datadir}/hplip/fax
740     %{_datadir}/hplip/faxsetup.py*
741     %{_datadir}/hplip/firmware.py*
742     %{_datadir}/hplip/hpdio.py*
743     %{_datadir}/hplip/hpssd*
744     %{_datadir}/hplip/info.py*
745     %{_datadir}/hplip/__init__.py*
746     %{_datadir}/hplip/levels.py*
747     %{_datadir}/hplip/linefeedcal.py*
748     %{_datadir}/hplip/makecopies.py*
749     %{_datadir}/hplip/makeuri.py*
750     %{_datadir}/hplip/pkservice.py*
751     %{_datadir}/hplip/plugin.py*
752     %{_datadir}/hplip/pqdiag.py*
753     %{_datadir}/hplip/printsettings.py*
754     %{_datadir}/hplip/probe.py*
755     %{_datadir}/hplip/query.py*
756     %{_datadir}/hplip/scan.py*
757     %{_datadir}/hplip/sendfax.py*
758     %{_datadir}/hplip/setup.py*
759     %{_datadir}/hplip/testpage.py*
760     %{_datadir}/hplip/timedate.py*
761     %{_datadir}/hplip/unload.py*
762     %{_datadir}/hplip/wificonfig.py*
763     # Directories
764     %{_datadir}/hplip/base
765     %{_datadir}/hplip/copier
766     %dir %{_datadir}/hplip/data
767     %{_datadir}/hplip/data/ldl
768     %{_datadir}/hplip/data/localization
769     %{_datadir}/hplip/data/models
770     %{_datadir}/hplip/data/pcl
771     %{_datadir}/hplip/data/ps
772     %{_datadir}/hplip/installer
773     %{_datadir}/hplip/pcard
774     %{_datadir}/hplip/prnt
775     %{_datadir}/hplip/scan
776     %{_datadir}/polkit-1/actions/com.hp.hplip.policy
777     %{_datadir}/dbus-1/system-services/com.hp.hplip.service
778     %{_localstatedir}/lib/hp/hplip.state
779     %config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.hp.hplip.conf
780    
781     %files doc
782     %defattr(-,root,root)
783     %doc %{_docdir}/%{name}-doc-%{version}%{extraversion}
784    
785     %files -n %{hpip_libname}
786     %defattr(-,root,root)
787     %{_libdir}/libhpip*.so.*
788     %{_libdir}/libhpmud.so.*
789    
790     %files -n %{hpip_libname}-devel
791     %defattr(-,root,root)
792     %{_includedir}/hpip.h
793     %{_includedir}/xform.h
794     %{_libdir}/libhpip*.so
795     %{_libdir}/libhpmud.so
796    
797     %if %{sane_backend}
798    
799     %files -n %{sane_hpaio_libname}
800     %defattr(-,root,root)
801     %{_libdir}/sane/libsane-hpaio*.so.*
802    
803     %endif
804    
805     %files model-data
806     %defattr(-,root,root)
807     %{_sysconfdir}/udev/rules.d/*.rules
808     %{_datadir}/hplip/data/models
809    
810     %files gui
811     %{_bindir}/hp-check
812     %{_bindir}/hp-print
813     %{_bindir}/hp-systray
814     %{_bindir}/hp-toolbox
815     %{_datadir}/applications/*.desktop
816     # Files
817     %{_datadir}/hplip/check.py*
818     %{_datadir}/hplip/print.py*
819     %{_datadir}/hplip/systray.py*
820     %{_datadir}/hplip/toolbox.py*
821     # Directories
822     %{_datadir}/hplip/data/images
823     %{_datadir}/hplip/ui4
824    
825     %files hpijs
826     %defattr(-,root,root)
827     %{_bindir}/hpijs
828     # Needed for both printing and fax PPDs. They all need HPIJS, therefore
829     # the link is here
830     %dir %{_datadir}/ppd
831     %dir %{_datadir}/ppd/HP
832     %{_bindir}/hpcups-update-ppds
833    
834     %files hpijs-ppds
835     %defattr(-,root,root)
836     %{_datadir}/ppd/HP/apollo*.ppd*
837     %{_datadir}/ppd/HP/hp-*.ppd*
838    
839    

  ViewVC Help
Powered by ViewVC 1.1.30