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

  ViewVC Help
Powered by ViewVC 1.1.30