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