/[packages]/cauldron/hplip/current/SPECS/hplip.spec
ViewVC logotype

Contents of /cauldron/hplip/current/SPECS/hplip.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30