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