1 |
%global _python_bytecompile_extra 0 |
2 |
# Define if you want to build the sane backend (default) |
3 |
%define sane_backend 1 |
4 |
%{?_with_sane: %global sane_backend 1} |
5 |
%{?_without_sane: %global sane_backend 0} |
6 |
|
7 |
%define hpip_major 0 |
8 |
%define hpip_libname %mklibname hpip %{hpip_major} |
9 |
|
10 |
%define sane_hpaio_major 1 |
11 |
%define sane_hpaio_libname %mklibname sane-hpaio %{sane_hpaio_major} |
12 |
|
13 |
# Suppress automatically generated Requires for devel packages |
14 |
%global __requires_exclude devel\\\(.*\\\) |
15 |
|
16 |
# we don't want to provide private python extension libs |
17 |
%global __provides_exclude %{python3_sitearch}/.*\\.so$ |
18 |
|
19 |
#define extraversion -RC1 |
20 |
%define extraversion %nil |
21 |
|
22 |
Summary: HP printer/all-in-one driver infrastructure |
23 |
Name: hplip |
24 |
Version: 3.21.12 |
25 |
Release: %mkrel 3 |
26 |
License: GPLv2+ and MIT |
27 |
Group: System/Printing |
28 |
Url: https://developers.hp.com/hp-linux-imaging-and-printing |
29 |
Source: https://downloads.sourceforge.net/sourceforge/hplip/%{name}-%{version}%{extraversion}.tar.gz |
30 |
Source1: hpcups-update-ppds.sh |
31 |
Source2: %{name}-tmpfiles.conf |
32 |
|
33 |
# (doktor5000) newer automake [>1.13.1] need option subdir-objects if one |
34 |
# source file is in a subdirectory, build does not complete otherwise |
35 |
Patch1: hplip-3.15.11-mga-automake-fix-subdir-objects.patch |
36 |
|
37 |
# (Anssi) Apply udev rules even on ACTION=="change", otherwise the permissions |
38 |
# do not get applied in %%post on a new installation: |
39 |
Patch2: hplip-apply-udev-rules-on-action-change.patch |
40 |
|
41 |
# Link patch |
42 |
Patch4: hplip-3.18.3-hp_ipp.patch |
43 |
|
44 |
# (akien) Start after panel in Plasma5 (mga#16946) |
45 |
Patch5: hplip-3.15.11-mga-plasma-delay-startup.patch |
46 |
|
47 |
### Fedora patches |
48 |
Patch101: hplip-pstotiff-is-rubbish.patch |
49 |
Patch102: hplip-strstr-const.patch |
50 |
Patch104: hplip-no-asm.patch |
51 |
Patch107: hplip-udev-rules.patch |
52 |
Patch108: hplip-retry-open.patch |
53 |
Patch109: hplip-snmp-quirks.patch |
54 |
|
55 |
Patch111: hplip-hpijs-marker-supply.patch |
56 |
Patch112: hplip-clear-old-state-reasons.patch |
57 |
Patch113: hplip-colorlaserjet-mfp-m278-m281.patch |
58 |
Patch114: hplip-hpcups-sigpipe.patch |
59 |
Patch115: hplip-logdir.patch |
60 |
Patch116: hplip-bad-low-ink-warning.patch |
61 |
Patch117: hplip-ui-optional.patch |
62 |
Patch121: hplip-ppd-ImageableArea.patch |
63 |
# error with new gcc, already reported in upstream as |
64 |
# https://bugs.launchpad.net/hplip/+bug/1836735 |
65 |
Patch122: hplip-fix-Wreturn-type-warning.patch |
66 |
# upstream check for python clears OS build system CFLAGS |
67 |
# https://bugs.launchpad.net/hplip/+bug/1879445 |
68 |
Patch123: hplip-configure-python.patch |
69 |
# non-sudoers cannot authenticate |
70 |
# reported upstream https://bugs.launchpad.net/hplip/+bug/1904888 |
71 |
Patch124: hplip-check-userperms.patch |
72 |
# 1919556 - hp-fab crashed: QFileDialog.getOpenFileName is not used correctly |
73 |
# getOpenFileName returns a tuple, but hp-fab expects a simple variable |
74 |
# reported upstream as https://bugs.launchpad.net/hplip/+bug/1914743 |
75 |
Patch125: hplip-fab-import.patch |
76 |
# if an user tries to install scanner via hp-setup (printer/fax utility) |
77 |
# it fails further down - break out earlier with a message |
78 |
# reported upstream as https://bugs.launchpad.net/hplip/+bug/1916114 |
79 |
Patch126: hplip-hpsetup-noscanjets.patch |
80 |
# 1951922 - hp-systray doesn't support a valid --qt5 option |
81 |
# reported upstream https://bugs.launchpad.net/hplip/+bug/1925480 |
82 |
Patch127: hplip-systray-qt5.patch |
83 |
# 2015910 - [GUI] hp-setup crashes when loading smart_install module |
84 |
# reported as https://bugs.launchpad.net/hplip/+bug/1957891 |
85 |
Patch163: hplip-qt5-smart-install.py.patch |
86 |
|
87 |
### Debian/Ubuntu patches |
88 |
# taken from latest version at http://patch-tracker.debian.org/package/hplip |
89 |
Patch201: 01_rss.dpatch |
90 |
Patch203: 14_charsign_fixes.dpatch |
91 |
# (doktor5000) rediff original debian patch for hplip 3.13.2 (due to Patch1) |
92 |
Patch204: hplip-3.15.11-mga-85_rebuild_python_ui.dpatch |
93 |
Patch205: 0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch |
94 |
|
95 |
Patch207: hplip-pjl-duplex-binding.patch |
96 |
# user should be member of group "lp" to scan/print/fax and lpadmin to manage? |
97 |
# check comment above patch application, currently not applied |
98 |
#Patch215: simple-scan-as-default.dpatch |
99 |
Patch219: try_libhpmud.so.0.dpatch |
100 |
Patch220: add-lidil-two-cartridge-modes.dpatch |
101 |
Patch222: hp-plugin-download-fix.dpatch |
102 |
Patch223: install-check-plugin.diff |
103 |
Patch224: pcardext-python3-workaround-upstream.dpatch |
104 |
Patch225: hpfax-bug-function-used-before-importing-log.dpatch |
105 |
Patch226: hp-systray-make-menu-title-visible-in-sni-qt-indicator.dpatch |
106 |
Patch227: hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde.dpatch |
107 |
Patch228: hpaio-option-duplex.diff |
108 |
Patch229: ui-patch-upstream-like.dpatch |
109 |
|
110 |
### Mageia patches |
111 |
Patch300: add-mga-support.patch |
112 |
Patch301: hplip-mga21945-disable-hp-upgrade-log-msg.patch |
113 |
# (daviddavid) set Qt5 in Help About Dialog |
114 |
Patch302: hplip-3.17.10-mga-set-qt5-in-HelpAboutDialog.patch |
115 |
# (daviddavid) fix HP systray destkop file |
116 |
Patch303: hplip-3.18.7-mga-fix-hp-systray-desktop-file.patch |
117 |
# (daviddavid) fix HP uiscan destkop file |
118 |
Patch304: hplip-3.18.12-mga-fix-hp-uiscan-desktop-file.patch |
119 |
# (ns80) fix ppd for HP Envy Photo 7800 series to allow US Letter size duplex printing |
120 |
Patch305: hplip-3.21.12-mga-allow-US-Letter-size-duplex-printing.patch |
121 |
|
122 |
%if %{sane_backend} |
123 |
BuildRequires: pkgconfig(sane-backends) |
124 |
BuildRequires: xsane |
125 |
%endif |
126 |
BuildRequires: openssl-devel |
127 |
BuildRequires: python3 |
128 |
BuildRequires: python3-sip >= 4.1.1 |
129 |
BuildRequires: python3-qt5-devel |
130 |
BuildRequires: pkgconfig(avahi-client) |
131 |
BuildRequires: pkgconfig(avahi-core) |
132 |
BuildRequires: pkgconfig(python3) |
133 |
BuildRequires: net-snmp-devel |
134 |
BuildRequires: pkgconfig(libusb) >= 0.1.8 |
135 |
BuildRequires: imagemagick |
136 |
BuildRequires: autoconf |
137 |
BuildRequires: libcups-devel |
138 |
BuildRequires: pkgconfig(libjpeg) |
139 |
BuildRequires: desktop-file-utils |
140 |
BuildRequires: pkgconfig(dbus-1) |
141 |
BuildRequires: pkgconfig(udev) |
142 |
BuildRequires: polkit |
143 |
BuildRequires: pkgconfig(libgphoto2) |
144 |
BuildRequires: libv4l-devel |
145 |
# Make sure we get postscriptdriver tags: |
146 |
BuildRequires: cups |
147 |
BuildRequires: python3-cups |
148 |
Requires(post): systemd >= %{systemd_required_version} |
149 |
Requires: cups |
150 |
# For dynamic ppd generation. |
151 |
Requires: cups-filters |
152 |
Requires: hplip-model-data |
153 |
Requires: hplip-hpijs |
154 |
Requires: hplip-hpijs-ppds |
155 |
Requires: python3-sip >= 4.1.1 |
156 |
# Needed for communicating with ethernet-connected printers |
157 |
Requires: net-snmp-mibs |
158 |
# Needed to generate fax cover pages |
159 |
Requires: python3-reportlab |
160 |
# Needed since 2.8.4 for IPC |
161 |
Requires: python3-dbus |
162 |
Requires: polkit-agent |
163 |
Requires: python3-gobject3 |
164 |
# Required by hp-scan for command line scanning |
165 |
Requires: python3-pillow |
166 |
Requires: sane-backends-hpaio |
167 |
# Needed to avoid misleading errors about network connectivity (RH bug #705843) |
168 |
Requires: wget |
169 |
# (cg) needed by at least hp-check |
170 |
Requires: acl |
171 |
# (doktor5000) lsusb is required for hp-check |
172 |
Requires: usbutils |
173 |
|
174 |
%description |
175 |
This is the HP driver package to supply Linux support for most |
176 |
Hewlett-Packard DeskJet, LaserJet, PSC, OfficeJet, and PhotoSmart |
177 |
printers and all-in-one peripherals (also known as Multi-Function |
178 |
Peripherals or MFPs), which can print, scan, copy, fax, and/or access |
179 |
flash memory cards. |
180 |
|
181 |
It is work in progress, but printing, scanning, memory card access, |
182 |
ink/toner/battery/consumable level checking, and inkjet printer |
183 |
maintenance are supported on most models, when either connected to the |
184 |
USB or LAN (built-in interfaces or selected HP JetDirect models) on a |
185 |
Linux workstation with CUPS printing system. |
186 |
|
187 |
For status and consumable checking and also for inkjet maintenance |
188 |
there is the graphical tool "hp-toolbox" available (Menu: |
189 |
"System"/"Monitoring"/"HP Printer Toolbox"). |
190 |
|
191 |
#---------------------------------------------------- |
192 |
|
193 |
%package -n %{hpip_libname} |
194 |
Summary: Dynamic library for the "hplip" HP printer/all-in-one drivers |
195 |
Group: System/Printing |
196 |
|
197 |
%description -n %{hpip_libname} |
198 |
Library needed for the "hplip" HP printer/all-in-one drivers. |
199 |
|
200 |
#---------------------------------------------------- |
201 |
|
202 |
%package -n %{hpip_libname}-devel |
203 |
Summary: Headers and links to compile against the "%{hpip_libname}" ("hplip") library |
204 |
Group: Development/C |
205 |
Requires: %{hpip_libname} >= %{version}-%{release} |
206 |
Provides: libhpip-devel = %{version}-%{release} |
207 |
|
208 |
%description -n %{hpip_libname}-devel |
209 |
This package contains all files which one needs to compile programs using |
210 |
the "%{hpip_libname}" library. |
211 |
|
212 |
#---------------------------------------------------- |
213 |
|
214 |
%if %{sane_backend} |
215 |
%package -n %{sane_hpaio_libname} |
216 |
Summary: SANE driver for scanners in HP's multi-function devices (from HPLIP) |
217 |
Group: System/Printing |
218 |
Requires: sane-backends |
219 |
Provides: sane-backends-hpaio = %{version}-%{release} |
220 |
# (cjw) for system-config-printer |
221 |
Provides: libsane-hpaio |
222 |
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}devel\\(libcrypto\\)|devel\\(libdl\\)|devel\\(libhpip\\)|devel\\(libm\\)|devel\\(libsnmp\\) |
223 |
%endif |
224 |
|
225 |
%if %{sane_backend} |
226 |
%description -n %{sane_hpaio_libname} |
227 |
SANE driver for scanners in HP's multi-function devices (from HPLIP). |
228 |
%endif |
229 |
|
230 |
#---------------------------------------------------- |
231 |
|
232 |
%if 0 |
233 |
%if %{sane_backend} |
234 |
%package -n %{sane_hpaio_libname}-devel |
235 |
Summary: Headers and links to compile against the "%{sane_hpaio_libname}" ("sane-hpaio") library |
236 |
Group: Development/C |
237 |
Requires: %{sane_hpaio_libname} >= %{version}-%{release} |
238 |
Provides: libsane-hpaio-devel = %{version}-%{release} |
239 |
%endif |
240 |
|
241 |
%if %{sane_backend} |
242 |
%description -n %{sane_hpaio_libname}-devel |
243 |
This package contains all files which one needs to compile programs using |
244 |
the "%{sane_hpaio_libname}" library. |
245 |
%endif |
246 |
%endif |
247 |
#---------------------------------------------------- |
248 |
|
249 |
%package model-data |
250 |
Summary: Data file listing the HP printer models supported by HPLIP |
251 |
Group: System/Printing |
252 |
|
253 |
%description model-data |
254 |
HPLIP supports most current HP printers and multifunction devices, but |
255 |
there are some older models not supported. This package contains the |
256 |
list of supported models. Printerdrake installs it automatically to |
257 |
determine whether HPLIP has to be installed or not. |
258 |
|
259 |
#---------------------------------------------------- |
260 |
|
261 |
%package gui |
262 |
Summary: HPLIP graphical tools |
263 |
Group: System/Printing |
264 |
Requires: python3-qt5-core |
265 |
Requires: python3-qt5-dbus |
266 |
Requires: python3-qt5-gui |
267 |
Requires: python3-qt5-widgets |
268 |
Requires: %{name} = %{version}-%{release} |
269 |
Requires: polkit-agent |
270 |
|
271 |
%description gui |
272 |
HPLIP graphical tools. |
273 |
|
274 |
#---------------------------------------------------- |
275 |
|
276 |
%package hpijs |
277 |
Summary: HPs printer driver IJS plug-in for GhostScript |
278 |
Group: System/Printing |
279 |
Requires: ghostscript |
280 |
Provides: hpijs |
281 |
|
282 |
%description hpijs |
283 |
HPs printer driver IJS plug-in for GhostScript. This driver gives full |
284 |
printing support for nearly all non-PostScript inkjet and laser |
285 |
printers made by HP. |
286 |
|
287 |
#---------------------------------------------------- |
288 |
|
289 |
%package hpijs-ppds |
290 |
Summary: PPD files for the HPIJS printer driver |
291 |
Group: System/Printing |
292 |
Requires: cups-filters |
293 |
Requires: hplip-hpijs |
294 |
|
295 |
%description hpijs-ppds |
296 |
PPD files to use the HPIJS printer driver with foomatic-rip and a |
297 |
printer spooler like CUPS, LPRng, PDQ, ... |
298 |
|
299 |
#---------------------------------------------------- |
300 |
|
301 |
%package doc |
302 |
Summary: Documentation for HPLIP |
303 |
Group: System/Printing |
304 |
|
305 |
%description doc |
306 |
This package contains documentation for the HPLIP driver. |
307 |
|
308 |
This is the HP driver package to supply Linux support for most |
309 |
Hewlett-Packard DeskJet, LaserJet, PSC, OfficeJet, and PhotoSmart |
310 |
printers and all-in-one peripherals (also known as Multi-Function |
311 |
Peripherals or MFPs), which can print, scan, copy, fax, and/or access |
312 |
flash memory cards. |
313 |
|
314 |
#---------------------------------------------------- |
315 |
|
316 |
%prep |
317 |
rm -rf $RPM_BUILD_DIR/%{name}-%{version}%{extraversion} |
318 |
%setup -q -n %{name}-%{version}%{extraversion} |
319 |
|
320 |
%patch1 -p1 -b .automake-subdir-objects |
321 |
|
322 |
%patch2 -p1 -b .udev-rules-on-action-change |
323 |
|
324 |
%patch4 -p1 -b .hp_ipp |
325 |
|
326 |
### Fedora patches |
327 |
|
328 |
# The pstotiff filter is rubbish so replace it (launchpad #528394). |
329 |
%patch101 -p1 -b .pstotiff-is-rubbish |
330 |
|
331 |
# Fix compilation. |
332 |
%patch102 -p1 -b .strstr-const |
333 |
|
334 |
# Make sure to avoid handwritten asm. |
335 |
%patch104 -p1 -b .no-asm |
336 |
|
337 |
# Removed SYSFS use in udev rules and actually made them work (bug #560754). |
338 |
# Move udev rules to /lib/udev/rules.d (bug #748208). |
339 |
%patch107 -p1 -b .udev-rules |
340 |
|
341 |
# Retry when connecting to device fails (RH bug #532112). |
342 |
%patch108 -p1 -b .retry-open |
343 |
|
344 |
# Mark SNMP quirks in PPD for HP OfficeJet Pro 8500 (RH bug #581825). |
345 |
%patch109 -p1 -b .snmp-quirks |
346 |
|
347 |
# Fixed bogus low ink warnings from hpijs driver (RH bug #643643). |
348 |
%patch111 -p1 -b .hpijs-marker-supply |
349 |
|
350 |
# Clear old printer-state-reasons we used to manage (RH bug #510926). |
351 |
%patch112 -p1 -b .clear-old-state-reasons |
352 |
|
353 |
# Add support for HP ColorLaserjet MFP M278-M281 (bug #1509394) |
354 |
#patch113 -p1 -b .colorlaserjet-mfp-m278-m281 |
355 |
|
356 |
# Avoid busy loop in hpcups when backend has exited (RH bug #525944). |
357 |
%patch114 -p1 -b .hpcups-sigpipe |
358 |
|
359 |
# CUPS filters should use TMPDIR when available (bug #865603). |
360 |
%patch115 -p1 -b .logdir |
361 |
|
362 |
# Fixed Device ID parsing code in hpijs's dj9xxvip.c (RH bug #510926). |
363 |
%patch116 -p1 -b .bad-low-ink-warning |
364 |
|
365 |
# Make utils.checkPyQtImport() look for the gui sub-package (bug #243273). |
366 |
%patch117 -p1 -b .ui-optional |
367 |
|
368 |
# Fix ImageableArea for Laserjet 8150/9000 (RH bug #596298). |
369 |
for ppd_file in $(grep '^diff' %{PATCH121} | cut -d " " -f 4); |
370 |
do |
371 |
gunzip ${ppd_file#*/}.gz |
372 |
done |
373 |
%patch121 -p1 -b .ImageableArea |
374 |
for ppd_file in $(grep '^diff' %{PATCH121} | cut -d " " -f 4); |
375 |
do |
376 |
gzip -n ${ppd_file#*/} |
377 |
done |
378 |
|
379 |
# Don't run 'chgrp lp /var/log/hp' in makefile (removes all lines with "chgrp") |
380 |
sed -i '/chgrp/d' Makefile.am |
381 |
|
382 |
sed -i.duplex-constraints \ |
383 |
-e 's,\(UIConstraints.* \*Duplex\),//\1,' \ |
384 |
prnt/drv/hpcups.drv.in |
385 |
|
386 |
%patch122 -p1 -b .Wreturn-fix |
387 |
%patch123 -p1 -b .configure-python |
388 |
# 1899410 - non-sudoers cannot authenticate because of bad username in prompt |
389 |
%patch124 -p1 -b .check-userperms |
390 |
# 1919556 - hp-fab crashed: QFileDialog.getOpenFileName is not used correctly |
391 |
%patch125 -p1 -b .fab-import |
392 |
# if an user tries to install scanner via hp-setup (printer/fax utility) |
393 |
# it fails further down - break out earlier with a message |
394 |
%patch126 -p1 -b .hpsetup-noscanjets |
395 |
# 1951922 - hp-systray doesn't support a valid --qt5 option |
396 |
%patch127 -p1 -b .systray-qt5 |
397 |
# 2015910 - [GUI] hp-setup crashes when loading smart_install module |
398 |
%patch163 -p1 -b .qt5-smart |
399 |
|
400 |
### Debian/Ubuntu patches |
401 |
|
402 |
# This patch tries to make sure that black is printed with just |
403 |
# the black pen, if the printer supports it |
404 |
%patch201 -p1 -b .01_rss |
405 |
|
406 |
# code cleanup related to char signedness |
407 |
%patch203 -p1 -b .14_charsign |
408 |
|
409 |
# compiling ui files to py |
410 |
%patch204 -p1 -b .85_rebuild_python_ui |
411 |
|
412 |
# Remove all ImageProcessor functionality, which is closed-source |
413 |
%patch205 -p1 -b .0025_ImageProcessor |
414 |
|
415 |
# Fixes Short-edge duplex printing if duplex is PJL-controlled |
416 |
# https://bugs.launchpad.net/hplip/+bug/244295 |
417 |
%patch207 -p1 -b .hplip-pjl-duplex-binding |
418 |
|
419 |
# disable for now, as this changes default hplip behavior |
420 |
# and change in default scanning application should be decided by a poll first |
421 |
#%%patch215 -p1 -b .simple-scan-as-default |
422 |
|
423 |
# dlopen libhpmud.so.0 instad of libhpmud.so, in order not to depend on |
424 |
# devel package (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548379) |
425 |
# obsoletes hplip-3.9.8-dlopen-libhpmud.patch, newer & extended version |
426 |
%patch219 -p1 -b .try_libhpmud.so.0 |
427 |
|
428 |
%patch220 -p1 -b .add-lidil-two-cartridge-modes |
429 |
|
430 |
%patch222 -p1 -b .plugin-download |
431 |
|
432 |
%patch223 -p1 -b .install-check-plugin |
433 |
|
434 |
%patch224 -p1 -b .pcardext-python3-workaround |
435 |
|
436 |
%patch225 -p1 -b .hpfax-bug-function-used-before-importing-log |
437 |
|
438 |
%patch226 -p1 -b .hp-systray-make-menu-title-visible-in-sni-qt-indicator |
439 |
|
440 |
%patch227 -p1 -b .hp-systray-make-menu-appear-in-sni-qt-indicator-with-kde |
441 |
|
442 |
%patch228 -p1 -b .hpaio-option-duplex |
443 |
|
444 |
%patch229 -p1 -b .ui-patch-upstream-like |
445 |
|
446 |
|
447 |
### Mageia patches |
448 |
%patch300 -p1 -b .add-mga-support |
449 |
%patch301 -p1 -b .remove-hp-upgrade-calls |
450 |
%patch302 -p1 -b .set_qt5 |
451 |
%patch303 -p1 -b .systray |
452 |
%patch304 -p1 -b .uiscan |
453 |
|
454 |
%if 0 |
455 |
# Use filter foomatic-rip instead of foomatic-rip-hplip (fix from Mandriva) |
456 |
for PPDGZ in ppd/hpijs/*.ppd.gz |
457 |
do |
458 |
mv -T "$PPDGZ" "$PPDGZ.old" |
459 |
zcat "$PPDGZ.old" | sed -e 's/foomatic-rip-hplip/foomatic-rip/' | gzip -c > "$PPDGZ" |
460 |
rm -f "$PPDGZ.old" |
461 |
done |
462 |
%endif |
463 |
|
464 |
# Make all files in the source user-writable |
465 |
chmod -R u+w . |
466 |
|
467 |
# Change shebang /usr/bin/env python -> /usr/bin/python3 |
468 |
find -name '*.py' -print0 | xargs -0 sed -i \ |
469 |
-e 's,^#!/usr/bin/env python,#!%{__python3},' \ |
470 |
-e 's,^#!/usr/bin/python$,#!%{__python3},' |
471 |
sed -i -e 's,^#!/usr/bin/env python,#!%{__python3},' \ |
472 |
prnt/filters/hpps \ |
473 |
fax/filters/pstotiff |
474 |
|
475 |
%build |
476 |
%serverbuild |
477 |
# create required files as placeholder, otherwise autoreconf fails |
478 |
touch NEWS README AUTHORS ChangeLog |
479 |
# needed by patches 204 and 205 |
480 |
autoreconf -ifv |
481 |
|
482 |
%if !%{sane_backend} |
483 |
WITHOUT_SANE="--without-sane" |
484 |
%endif |
485 |
%configure $WITHOUT_SANE \ |
486 |
--disable-foomatic-rip-hplip-install \ |
487 |
--disable-imageProcessor-build \ |
488 |
--enable-scan-build \ |
489 |
--enable-gui-build \ |
490 |
--enable-fax-build \ |
491 |
--enable-pp-build \ |
492 |
--enable-qt5 --disable-qt4 \ |
493 |
--enable-hpcups-install \ |
494 |
--enable-cups-ppd-install \ |
495 |
--enable-hpijs-install \ |
496 |
--enable-policykit \ |
497 |
--with-mimedir=%{_datadir}/cups/mime \ |
498 |
PYTHON=%{__python3} |
499 |
|
500 |
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool |
501 |
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool |
502 |
|
503 |
%make_build |
504 |
|
505 |
%install |
506 |
mkdir -p %{buildroot}%{_bindir} |
507 |
mkdir -p %{buildroot}%{_includedir} |
508 |
mkdir -p %{buildroot}%{_initrddir} |
509 |
mkdir -p %{buildroot}%{_sysconfdir}/hp |
510 |
|
511 |
%make_install |
512 |
|
513 |
# Install files which the "make install" missed to install |
514 |
install -m 644 ip/hpip.h %{buildroot}%{_includedir} |
515 |
install -m 644 ip/xform.h %{buildroot}%{_includedir} |
516 |
|
517 |
# Move doc in sub-package |
518 |
mv %{buildroot}%{_docdir}/%{name}-%{version}%{extraversion} %{buildroot}%{_docdir}/%{name}-doc-%{version}%{extraversion} |
519 |
|
520 |
# Remove static libraries of SANE driver |
521 |
rm -f %{buildroot}%{_libdir}/sane/libsane-hpaio*.so |
522 |
rm -f %{buildroot}%{_libdir}/sane/libsane-hpaio*.la |
523 |
rm -f %{buildroot}%{_sysconfdir}/sane.d/dll.conf |
524 |
|
525 |
# Remove other unneeded/unwanted files |
526 |
rm -f %{buildroot}%{_datadir}/hplip/uninstall.* |
527 |
rm -f %{buildroot}%{_bindir}/hp-uninstall |
528 |
# remove all upgrade-dialog files, also related to CVE-2013-6427 |
529 |
# previously we only removed the upgrade binary, but missed some upgrade dialog files |
530 |
rm -f %{buildroot}%{_datadir}/hplip/upgrade* |
531 |
rm -f %{buildroot}%{_bindir}/hp-upgrade |
532 |
rm -f %{buildroot}%{_bindir}/hp-config_usb_printer |
533 |
rm -f %{buildroot}%{_unitdir}/hplip-printer@.service |
534 |
rm -f %{buildroot}%{_datadir}/hplip/config_usb_printer.* |
535 |
rm -f %{buildroot}%{_datadir}/ipp-usb/quirks/HPLIP.conf |
536 |
|
537 |
mkdir -p %{buildroot}%{_datadir}/applications |
538 |
desktop-file-install --vendor='' \ |
539 |
--dir=%{buildroot}%{_datadir}/applications \ |
540 |
--remove-category='Application' \ |
541 |
--remove-category='Utility' \ |
542 |
--add-category='System' \ |
543 |
--add-category='Settings' \ |
544 |
--add-category='Printing' \ |
545 |
--add-category='Qt' \ |
546 |
--add-category='HardwareSettings' \ |
547 |
--remove-key='Encoding' \ |
548 |
%{buildroot}%{_datadir}/applications/hplip.desktop |
549 |
|
550 |
cat > %{buildroot}%{_datadir}/applications/hp-sendfax.desktop << EOF |
551 |
[Desktop Entry] |
552 |
Name=HP Sendfax |
553 |
Name[br]=Kas ur faks (HP) |
554 |
Name[ru]=Отправка факсов (HP) |
555 |
Name[zh_CN]=惠普发送传真 |
556 |
GenericName=Sending faxes (HP) |
557 |
GenericName[bg]=Изпращане на факсове (HP) |
558 |
GenericName[ca]=Enviant faxos (HP) |
559 |
GenericName[el]=Αποστολή φαξ (HP) |
560 |
GenericName[es]=Enviando faxes (HP) |
561 |
GenericName[hu]=Faxok küldése (HP) |
562 |
GenericName[it]=Inviare i fax (HP) |
563 |
GenericName[pl]=Wysyłanie faksu (HP) |
564 |
GenericName[ru]=Отправка факсов (МФУ HP) |
565 |
GenericName[sq]=Dërgim faksesh (HP) |
566 |
GenericName[sv]=Sändning av fax (HP) |
567 |
Comment=Utility for sending faxes with HP's multi-function devices |
568 |
Comment[bs]=Alat za slanje faksova putem HPovih višefunkcijskih uređaja |
569 |
Comment[cs]=Pomocný program pro posílání faxů pomocí multifunkčních zařízení HP |
570 |
Comment[cy]=Gwasanaeth anfon ffacs drwy ddyfeisiau amlbwrpas HP |
571 |
Comment[de]=Werkzeug um Faxe mit HP-Multifunktionsgeräten zu versenden |
572 |
Comment[et]=Tööriist fakside saatmiseks HP multifunktsionaalsetest seadmetest |
573 |
Comment[gl]=Utilidade para enviar faxes cos dispositivos multifunción de HP |
574 |
Comment[he]=יישום למשלוח פקסים עם מכשירים משולבים של HP |
575 |
Comment[hu]=Faxküldés a HP-féle többfunkciós eszközökkel |
576 |
Comment[id]=Utilitas untuk mengirimkan fax dengan divais multi fungsi HP |
577 |
Comment[is]=Forrit til að senda fax með fjölnotatækjum HP |
578 |
Comment[it]=Strumento per inviare fax con i dispositivi HP multi-funzione |
579 |
Comment[ja]=HP の多機能デバイスで FAX を送信するためのユーティリティ |
580 |
Comment[mk]=Алатка за праќање факсови со повеќе-функциски „HP“ уреди |
581 |
Comment[nb]=Verktøy for å sende fakser med HPs multifunksjonsenheter |
582 |
Comment[nl]=Hulpprogramma voor het sturen van faxen met HP multifunctionele apparaten |
583 |
Comment[nn]=Verktøy for sending av faksar med HPs multifunksjonseiningar |
584 |
Comment[pl]=Program do wysyłania faksów przez wielofunkcyjne urządzenia HP |
585 |
Comment[pt]=Utilitário para enviar faxes com dispositivos multi-funções HP |
586 |
Comment[pt_BR]=Utilitário para enviar faxes com multifuncionais HP |
587 |
Comment[ru]=Утилита для отправки факсов с помощью МФУ HP |
588 |
Comment[sl]=Program za pošiljanje faksov z večnamensko napravo HP |
589 |
Comment[sv]=Verktyg för att skicka fax med HPs multi-funktions-enheter |
590 |
Comment[tr]=HP'nin çok fonksiyonlu aygıtlarıyla faks göndermek için yardımcı program |
591 |
Comment[zh_CN]=使用惠普多功能一体机发送传真的工具 |
592 |
Comment[zh_TW]=使用 HP 多功能設備發送傳真的工具程式 |
593 |
Exec=%{_bindir}/hp-sendfax |
594 |
Icon=%{_datadir}/%{name}/data/images/32x32/fax_machine.png |
595 |
Terminal=false |
596 |
Type=Application |
597 |
Categories=TelephonyTools;Qt;Printing;Utility;X-Mageia-CrossDesktop; |
598 |
EOF |
599 |
|
600 |
# tmpfiles.d for folders on transient media |
601 |
%{__install} -D -p -m 0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf |
602 |
|
603 |
# switched to udev, no need for hal information |
604 |
rm -rf %{buildroot}%{_datadir}/hal/fdi |
605 |
|
606 |
rm -f %{buildroot}%{_libdir}/*.la \ |
607 |
%{buildroot}%{python3_sitearch}/*.la \ |
608 |
%{buildroot}%{_libdir}/sane/*.la |
609 |
|
610 |
# Regenerate hpcups PPDs on upgrade if necessary (bug #579355). |
611 |
install -p -m755 %{SOURCE1} %{buildroot}%{_bindir}/hpcups-update-ppds |
612 |
|
613 |
# Fedora pstotiff |
614 |
rm -f %{buildroot}%{_sysconfdir}/cups/pstotiff.types |
615 |
rm -f %{buildroot}%{_datadir}/cups/mime/pstotiff.types |
616 |
rm -f %{buildroot}%{_datadir}/hplip/fax/pstotiff* |
617 |
rm -f %{buildroot}%{_prefix}/lib/cups/filter/hpcac |
618 |
|
619 |
# bork? |
620 |
install -d %{buildroot}%{_sysconfdir}/cups |
621 |
cp -p %{buildroot}%{_datadir}/cups/mime/pstotiff.convs %{buildroot}%{_sysconfdir}/cups/pstotiff.convs |
622 |
|
623 |
# (cg) Create post consolehelper compatibility links |
624 |
mkdir -p %{buildroot}%{_sbindir} |
625 |
ln -sf %{_bindir}/hp-setup %{buildroot}%{_sbindir} |
626 |
|
627 |
# Make sure pyc files are generated, otherwise we can get |
628 |
# difficult to debug problems |
629 |
pushd %{buildroot}%{_datadir}/%{name} |
630 |
python -m compileall . |
631 |
popd |
632 |
|
633 |
# create empty /var/lip/hp/hplip.state to fix hp-plugin installation (mga#5395) |
634 |
mkdir -p %{buildroot}%{_localstatedir}/lib/hp/ |
635 |
touch %{buildroot}%{_localstatedir}/lib/hp/hplip.state |
636 |
|
637 |
# create empty log directory so that it can be owned |
638 |
mkdir -p %{buildroot}%{_localstatedir}/log/hp/tmp |
639 |
|
640 |
|
641 |
# Restart CUPS to make the Fax PPD known to it |
642 |
if [ -f /etc/init.d/cups ]; then |
643 |
/sbin/service cups condrestart || : |
644 |
fi |
645 |
|
646 |
pushd %{buildroot}%{_datadir}/ppd/HP |
647 |
gunzip hp-envy_photo_7800_series.ppd.gz |
648 |
/usr/bin/patch --no-backup-if-mismatch -f -p0 --fuzz=0 < %{PATCH305} |
649 |
gzip hp-envy_photo_7800_series.ppd |
650 |
popd |
651 |
|
652 |
# hp-setup needs to have cups service enabled and running for setups of queues |
653 |
%pre |
654 |
%{_bindir}/systemctl start cups &>/dev/null ||: |
655 |
%{_bindir}/systemctl enable cups &>/dev/null ||: |
656 |
|
657 |
%post |
658 |
%_tmpfilescreate %{name} |
659 |
|
660 |
%post -n hplip-hpijs-ppds |
661 |
# Restart CUPS to make the printing PPDs known to it |
662 |
if [ -f /etc/init.d/cups ]; then |
663 |
/sbin/service cups condrestart || : |
664 |
fi |
665 |
|
666 |
%post -n hplip-hpijs |
667 |
%{_bindir}/hpcups-update-ppds &>/dev/null ||: |
668 |
|
669 |
%post -n hplip-model-data |
670 |
/sbin/udevadm trigger --subsystem-match=usb --attr-match=idVendor=03f0 |
671 |
# ensure permissions are ready when installation completes |
672 |
/sbin/udevadm settle --timeout=15 |
673 |
: |
674 |
|
675 |
%if %{sane_backend} |
676 |
%post -n %{sane_hpaio_libname} |
677 |
|
678 |
# Add HPLIP driver to /etc/sane.d/dll.conf |
679 |
if ! grep ^hpaio /etc/sane.d/dll.conf >/dev/null 2>/dev/null ; then \ |
680 |
echo hpaio >> /etc/sane.d/dll.conf; \ |
681 |
fi |
682 |
%endif |
683 |
|
684 |
%if %{sane_backend} |
685 |
%preun -n %{sane_hpaio_libname} |
686 |
# Remove HPLIP driver from /etc/sane.d/dll.conf |
687 |
if [ "$1" = 0 ]; then \ |
688 |
if grep ^hpaio /etc/sane.d/dll.conf >/dev/null 2>/dev/null ; then \ |
689 |
sed '/hpaio/d' /etc/sane.d/dll.conf > /tmp/$$; \ |
690 |
cp -f /tmp/$$ /etc/sane.d/dll.conf; \ |
691 |
rm -f /tmp/$$; \ |
692 |
fi; \ |
693 |
fi |
694 |
%endif |
695 |
|
696 |
# Restart CUPS to make the removal of the Fax PPD known to it |
697 |
if [ -f /etc/init.d/cups ]; then |
698 |
/sbin/service cups condrestart || : |
699 |
fi |
700 |
|
701 |
%postun -n hplip-hpijs-ppds |
702 |
# Restart CUPS to make the removal of the printing PPDs known to it |
703 |
if [ -f /etc/init.d/cups ]; then |
704 |
/sbin/service cups condrestart || : |
705 |
fi |
706 |
|
707 |
%files |
708 |
#doc COPYING doc/* |
709 |
%config(noreplace) %{_sysconfdir}/hp |
710 |
%dir %{_localstatedir}/lib/hp/ |
711 |
%{_bindir}/hp-align |
712 |
%{_bindir}/hp-clean |
713 |
%{_bindir}/hp-colorcal |
714 |
%{_bindir}/hp-devicesettings |
715 |
%{_bindir}/hp-diagnose_plugin |
716 |
%{_bindir}/hp-diagnose_queues |
717 |
%{_bindir}/hp-doctor |
718 |
%{_bindir}/hp-fab |
719 |
%{_bindir}/hp-faxsetup |
720 |
%{_bindir}/hp-firmware |
721 |
%{_bindir}/hp-info |
722 |
%{_bindir}/hp-levels |
723 |
%{_bindir}/hp-logcapture |
724 |
%{_bindir}/hp-linefeedcal |
725 |
%{_bindir}/hp-makecopies |
726 |
%{_bindir}/hp-makeuri |
727 |
%{_bindir}/hp-pkservice |
728 |
%{_bindir}/hp-plugin |
729 |
%{_bindir}/hp-pqdiag |
730 |
%{_bindir}/hp-printsettings |
731 |
%{_bindir}/hp-probe |
732 |
%{_bindir}/hp-query |
733 |
%{_bindir}/hp-scan |
734 |
%{_bindir}/hp-sendfax |
735 |
%{_bindir}/hp-setup |
736 |
%{_sbindir}/hp-setup |
737 |
%{_bindir}/hp-testpage |
738 |
%{_bindir}/hp-timedate |
739 |
%{_bindir}/hp-unload |
740 |
%{_bindir}/hp-wificonfig |
741 |
|
742 |
%exclude %{_datadir}/hplip/data/models |
743 |
%exclude %{_datadir}/hplip/__pycache__ |
744 |
# C libraries for Python |
745 |
%{python3_sitearch}/*.so* |
746 |
# CUPS backends (0755 permissions, so that CUPS 1.2 runs these backends |
747 |
# as lp user) |
748 |
# Note: this must be /usr/lib not %%{_libdir}, since that's the |
749 |
# CUPS serverbin directory. |
750 |
%attr(0755,root,root) %{_prefix}/lib/cups/backend/hp* |
751 |
%{_prefix}/lib/cups/filter/hpcups |
752 |
%{_prefix}/lib/cups/filter/hpcupsfax |
753 |
%{_prefix}/lib/cups/filter/hpps |
754 |
%{_prefix}/lib/cups/filter/pstotiff |
755 |
%{_datadir}/cups/mime/pstotiff.convs |
756 |
%config(noreplace) %{_sysconfdir}/cups/pstotiff.convs |
757 |
%{_datadir}/ppd/HP/HP-Fax*.ppd* |
758 |
%{_datadir}/cups/drv/hp/hpcups.drv |
759 |
# Files |
760 |
%dir %{_datadir}/hplip |
761 |
%{_datadir}/hplip/align.py* |
762 |
%{_datadir}/hplip/check-plugin.py* |
763 |
%{_datadir}/hplip/clean.py* |
764 |
%{_datadir}/hplip/colorcal.py* |
765 |
%{_datadir}/hplip/dat2drv |
766 |
%{_datadir}/hplip/devicesettings.py* |
767 |
%{_datadir}/hplip/diagnose_plugin.py* |
768 |
%{_datadir}/hplip/diagnose_queues.py* |
769 |
%{_datadir}/hplip/doctor.py* |
770 |
%{_datadir}/hplip/fab.py* |
771 |
%{_datadir}/hplip/fax |
772 |
%{_datadir}/hplip/faxsetup.py* |
773 |
%{_datadir}/hplip/firmware.py* |
774 |
%{_datadir}/hplip/hpdio.py* |
775 |
%{_datadir}/hplip/hplip_clean.sh |
776 |
%{_datadir}/hplip/hpssd* |
777 |
%{_datadir}/hplip/info.py* |
778 |
%{_datadir}/hplip/__init__.py* |
779 |
%{_datadir}/hplip/levels.py* |
780 |
%{_datadir}/hplip/locatedriver |
781 |
%{_datadir}/hplip/logcapture.py* |
782 |
%{_datadir}/hplip/linefeedcal.py* |
783 |
%{_datadir}/hplip/makecopies.py* |
784 |
%{_datadir}/hplip/makeuri.py* |
785 |
%{_datadir}/hplip/pkservice.py* |
786 |
%{_datadir}/hplip/plugin.py* |
787 |
%{_datadir}/hplip/pqdiag.py* |
788 |
%{_datadir}/hplip/printsettings.py* |
789 |
%{_datadir}/hplip/probe.py* |
790 |
%{_datadir}/hplip/query.py* |
791 |
%{_datadir}/hplip/scan.py* |
792 |
%{_datadir}/hplip/sendfax.py* |
793 |
%{_datadir}/hplip/setup.py* |
794 |
%{_datadir}/hplip/testpage.py* |
795 |
%{_datadir}/hplip/timedate.py* |
796 |
%{_datadir}/hplip/unload.py* |
797 |
%{_datadir}/hplip/wificonfig.py* |
798 |
# Directories |
799 |
%{_datadir}/hplip/base |
800 |
%{_datadir}/hplip/copier |
801 |
%dir %{_datadir}/hplip/data |
802 |
%{_datadir}/hplip/data/ldl |
803 |
%{_datadir}/hplip/data/localization |
804 |
%{_datadir}/hplip/data/models |
805 |
%{_datadir}/hplip/data/pcl |
806 |
%{_datadir}/hplip/data/ps |
807 |
%{_datadir}/hplip/installer |
808 |
%{_datadir}/hplip/pcard |
809 |
%{_datadir}/hplip/prnt |
810 |
%{_datadir}/hplip/scan |
811 |
%{_datadir}/polkit-1/actions/com.hp.hplip.policy |
812 |
%{_datadir}/dbus-1/system-services/com.hp.hplip.service |
813 |
%{_tmpfilesdir}/%{name}.conf |
814 |
%{_localstatedir}/lib/hp/hplip.state |
815 |
%dir %attr(0774,root,lp) %{_logdir}/hp |
816 |
%dir %attr(1774,root,lp) %{_logdir}/hp/tmp |
817 |
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.hp.hplip.conf |
818 |
|
819 |
%files doc |
820 |
%doc %{_docdir}/%{name}-doc-%{version}%{extraversion} |
821 |
|
822 |
%files -n %{hpip_libname} |
823 |
%{_libdir}/libhpip*.so.* |
824 |
%{_libdir}/libhpmud.so.* |
825 |
%{_libdir}/libhpdiscovery.so.* |
826 |
|
827 |
%files -n %{hpip_libname}-devel |
828 |
%{_includedir}/hpip.h |
829 |
%{_includedir}/xform.h |
830 |
%{_libdir}/libhpip*.so |
831 |
%{_libdir}/libhpmud.so |
832 |
%{_libdir}/libhpdiscovery.so |
833 |
|
834 |
%if %{sane_backend} |
835 |
|
836 |
%files -n %{sane_hpaio_libname} |
837 |
%{_libdir}/sane/libsane-hpaio*.so.* |
838 |
|
839 |
%endif |
840 |
|
841 |
%files model-data |
842 |
%{_udevrulesdir}/*.rules |
843 |
%{_datadir}/hplip/data/models |
844 |
|
845 |
%files gui |
846 |
%{_bindir}/hp-check |
847 |
%{_bindir}/hp-check-plugin |
848 |
%{_bindir}/hp-print |
849 |
%{_bindir}/hp-systray |
850 |
%{_bindir}/hp-toolbox |
851 |
%{_bindir}/hp-uiscan |
852 |
%{_datadir}/applications/*.desktop |
853 |
%{_sysconfdir}/xdg/autostart/hplip-systray.desktop |
854 |
%{_datadir}/hplip/check.py* |
855 |
%{_datadir}/hplip/print.py* |
856 |
%{_datadir}/hplip/systray.py* |
857 |
%{_datadir}/hplip/toolbox.py* |
858 |
%{_datadir}/hplip/data/images |
859 |
%{_datadir}/hplip/ui5 |
860 |
%{_datadir}/hplip/uiscan.py* |
861 |
|
862 |
%files hpijs |
863 |
%{_bindir}/hpijs |
864 |
# Needed for both printing and fax PPDs. They all need HPIJS, therefore |
865 |
# the link is here |
866 |
%dir %{_datadir}/ppd |
867 |
%dir %{_datadir}/ppd/HP |
868 |
%{_bindir}/hpcups-update-ppds |
869 |
|
870 |
%files hpijs-ppds |
871 |
%{_datadir}/ppd/HP/apollo*.ppd* |
872 |
%{_datadir}/ppd/HP/hp-*.ppd* |
873 |
|