hplip-vl.spec 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  1. # %define python_platlib %(python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)')
  2. Summary: HP printer drivers & utilities for Linux
  3. Summary(ja): HP プリンタの Linux 向けドライバとユーティリティ
  4. Name: hplip
  5. Version: 3.22.6
  6. Release: 1%{?_dist_release}
  7. Group: publishing
  8. Vendor: Project Vine
  9. Distribution: Vine Linux
  10. Packager: kazutaka
  11. License: GPLv2+, MIT and BSD
  12. URL: https://developers.hp.com/hp-linux-imaging-and-printing
  13. # Source0: http://downloads.sourceforge.net/sourceforge/hplip/hplip-%{version}.tar.gz
  14. # ./hplip-repack.sh <version>
  15. Source0: hplip-%{version}-repack.tar.gz
  16. #Source1: hpcups-update-ppds.sh
  17. Source2: copy-deviceids.py
  18. Source3: %{name}.metainfo.xml
  19. Source4: hp-laserjet_cp_1025nw.ppd.gz
  20. Source5: hp-laserjet_professional_p_1102w.ppd.gz
  21. Source6: hplip-repack.sh
  22. Source7: hp-plugin.in
  23. Source1000: hplip.desktop.vine
  24. Patch1: hplip-pstotiff-is-rubbish.patch
  25. Patch2: hplip-strstr-const.patch
  26. Patch3: hplip-ui-optional.patch
  27. Patch4: hplip-no-asm.patch
  28. Patch5: hplip-deviceIDs-drv.patch
  29. Patch6: hplip-udev-rules.patch
  30. Patch7: hplip-retry-open.patch
  31. Patch8: hplip-snmp-quirks.patch
  32. Patch9: hplip-hpijs-marker-supply.patch
  33. Patch10: hplip-clear-old-state-reasons.patch
  34. Patch11: hplip-hpcups-sigpipe.patch
  35. Patch12: hplip-logdir.patch
  36. Patch13: hplip-bad-low-ink-warning.patch
  37. Patch14: hplip-deviceIDs-ppd.patch
  38. Patch15: hplip-ppd-ImageableArea.patch
  39. Patch16: hplip-scan-tmp.patch
  40. Patch17: hplip-log-stderr.patch
  41. Patch18: hplip-avahi-parsing.patch
  42. Patch19: hplip-dj990c-margin.patch
  43. Patch20: hplip-strncpy.patch
  44. Patch21: hplip-no-write-bytecode.patch
  45. Patch22: hplip-silence-ioerror.patch
  46. Patch23: hplip-sourceoption.patch
  47. Patch24: hplip-noernie.patch
  48. Patch25: hplip-appdata.patch
  49. Patch26: hplip-check-cups.patch
  50. Patch27: hplip-typo.patch
  51. # python3 - recent HP release removed encoding/decoding to utf-8 in fax/pmlfax.py -
  52. # that results in text string going into translate function in base/utils.py, which
  53. # expects binary string because of parameters. Remove this patch if base/utils.py
  54. # code gets fixed.
  55. Patch28: hplip-use-binary-str.patch
  56. # m278-m281 doesn't work correctly again
  57. Patch29: hplip-error-print.patch
  58. Patch30: hplip-hpfax-importerror-print.patch
  59. Patch31: hplip-wifisetup.patch
  60. # pgp.mit.edu keyserver got bad connection, so we need to have pool of keyservers
  61. # to choose (Bz#1641100, launchpad#1799212)
  62. Patch32: hplip-keyserver.patch
  63. # QMessagebox call was copy-pasted from Qt4 version, but Qt5 has different arguments,
  64. # This patch solves most of them
  65. Patch33: 0026-Call-QMessageBox-constructors-of-PyQT5-with-the-corr.patch
  66. # HP upstream introduced new binary blob, which is not open-source, so it violates
  67. # FPG by two ways - shipping binary blob and non open source code - so it needs to be removed.
  68. # Patch is taken from Debian.
  69. Patch34: 0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch
  70. # In hplip-3.18.10 some parts of UI code was commented out, which leaved hp-toolbox
  71. # unusable (crashed on the start). The patch removes usages of variables, which were
  72. # commented out.
  73. # The patch is taken from Debian.
  74. Patch35: 0027-Fixed-incomplete-removal-of-hp-toolbox-features-whic.patch
  75. # hp-setup crashed when user wanted to define a path to PPD file. It was due
  76. # byte + string variables incompatibility and it is fixed by decoding the
  77. # bytes-like variable
  78. # part of https://bugzilla.redhat.com/show_bug.cgi?id=1666076
  79. # reported upstream https://bugs.launchpad.net/hplip/+bug/1814272
  80. Patch36: hplip-add-ppd-crash.patch
  81. # external scripts, which are downloaded and run by hp-plugin, try to create links
  82. # in non-existing dirs. These scripts ignore errors, so plugin is installed fine
  83. # but then internal hp-plugin can check for plugin state, where links are checked too.
  84. # It results in corrupted plugin state, which breaks printer installation by GUI hp-setup.
  85. # Temporary workaround is to ignore these bad links and real fix should come from HP,
  86. # because their external scripts try to create links in non-existing dirs.
  87. # Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1671513
  88. # Reported upstream: https://bugs.launchpad.net/hplip/+bug/1814574
  89. Patch37: hplip-missing-links.patch
  90. # change in 3.18.9 in scanext.c caused broken scanning for HP LaserJet 3052. Since I cannot figure
  91. # it out what author wanted by the change (it sets option number 9 to true, but different handles
  92. # have different options, so I'm not sure what author wanted to set).
  93. # Remove the change for now, it works for user and me.
  94. Patch38: hplip-hplj-3052.patch
  95. # hpmud parses mdns txt record badly
  96. # upstream tickets: https://bugs.launchpad.net/hplip/+bug/1797501
  97. # https://bugs.launchpad.net/hplip/+bug/1817214
  98. # https://bugs.launchpad.net/hplip/+bug/1821932
  99. # with no response from upstream
  100. # Patch taken from Debian https://lists.debian.org/debian-printing/2018/11/msg00049.html
  101. Patch39: hplip-hpmud-string-parse.patch
  102. # Part of https://bugzilla.redhat.com/show_bug.cgi?id=1694663
  103. # It was found out that specific device needs plugin for scanning
  104. # Reported upstream as https://bugs.launchpad.net/hplip/+bug/1822762
  105. Patch40: hplip-m278-m281-needs-plugin.patch
  106. # hpcups crashes when a printer needs a plugin and does not have one installed
  107. # it crashes in destructor, because pointer is not initialized
  108. # bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1695716
  109. # reported upstream
  110. Patch41: hplip-hpcups-crash.patch
  111. # Fixing the issues found by coverity scan
  112. # reported upstream https://bugs.launchpad.net/hplip/+bug/1808145
  113. Patch42: hplip-covscan.patch
  114. # Segfault during logging to syslog because argument are switched
  115. # bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1727162
  116. # upstream https://bugs.launchpad.net/hplip/+bug/1837846
  117. Patch43: hplip-logging-segfault.patch
  118. # Traceback in hp-systray when there are no resource
  119. # wanted to report upstream, but launchpad ends with timeout error
  120. # bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1738321
  121. Patch44: hplip-systray-blockerror.patch
  122. # several printers were removed in 3.19.1, but actually someone still uses them
  123. # reported upstream https://bugs.launchpad.net/hplip/+bug/1843592
  124. # bugzillas 1742949, 1740132, 1739855
  125. Patch45: hplip-missing-drivers.patch
  126. # laserjet 2200 and other devices have different device id than HP expects...
  127. # https://bugzilla.redhat.com/show_bug.cgi?id=1772698
  128. # reported upstream https://bugs.launchpad.net/hplip/+bug/1853002
  129. Patch46: hplip-model-mismatch.patch
  130. # sixext has problems with python3 strings (bz#1573430)
  131. # reported https://bugs.launchpad.net/bugs/1480152
  132. Patch47: hplip-unicodeerror.patch
  133. # error with new gcc, already reported in upstream as
  134. # https://bugs.launchpad.net/hplip/+bug/1836735
  135. Patch48: hplip-fix-Wreturn-type-warning.patch
  136. # upstream check for python clears OS build system
  137. # CFLAGS
  138. # https://bugs.launchpad.net/hplip/+bug/1879445
  139. Patch49: hplip-configure-python.patch
  140. # taken from hplip upstream report - toolbox uses deprecated method
  141. # setMargin(), which generates an exception, resulting in a infinite loop
  142. # of request on cupsd
  143. # https://bugs.launchpad.net/hplip/+bug/1880275
  144. Patch50: hplip-dialog-infinite-loop.patch
  145. # searching algorithm did not expect '-' in model name and thought it is a new PDL
  146. # it resulted in incorrect PPD match, so e.g. hpijs driver was used instead of hpcups
  147. # bug: https://bugzilla.redhat.com/show_bug.cgi?id=1590014
  148. # reported upstream: https://bugs.launchpad.net/hplip/+bug/1881587
  149. Patch51: hplip-find-driver.patch
  150. # hp-clean didn't work for Photosmart C1410 because it was comparing
  151. # string length with buffer size for string object, which is different,
  152. # causing cleaning to fail - the fix is to make the object bytes-like,
  153. # then buffer size is the same as the length.
  154. # Thanks to Stefan Assmann we were able to fix level 1 cleaning
  155. # for the device, but there can be similar issues with other devices
  156. # bug https://bugzilla.redhat.com/show_bug.cgi?id=1833308
  157. # reported upstream https://bugs.launchpad.net/hplip/+bug/1882193
  158. Patch52: hplip-clean-ldl.patch
  159. # 3.20.6 turned off requirement for most devices which needed it
  160. # - it will cause malfunction of printing and scanning for them
  161. # https://bugs.launchpad.net/hplip/+bug/1883898
  162. Patch53: hplip-revert-plugins.patch
  163. # non-sudoers cannot authenticate
  164. # reported upstream https://bugs.launchpad.net/hplip/+bug/1904888
  165. Patch54: hplip-check-userperms.patch
  166. # 1919556 - hp-fab crashed: QFileDialog.getOpenFileName is not used correctly
  167. # getOpenFileName returns a tuple, but hp-fab expects a simple variable
  168. # reported upstream as https://bugs.launchpad.net/hplip/+bug/1914743
  169. Patch55: hplip-fab-import.patch
  170. # if an user tries to install scanner via hp-setup (printer/fax utility)
  171. # it fails further down - break out earlier with a message
  172. # reported upstream as https://bugs.launchpad.net/hplip/+bug/1916114
  173. Patch56: hplip-hpsetup-noscanjets.patch
  174. # 1963114 - patch for hplip firmware load timeout fix
  175. # reported upstream https://bugs.launchpad.net/hplip/+bug/1922404
  176. Patch57: hplip-hpfirmware-timeout.patch
  177. # 1985251 - Incorrect permission for gpg directory
  178. # reported upstream https://bugs.launchpad.net/hplip/+bug/1938442
  179. Patch58: hplip-gpgdir-perms.patch
  180. # 1987141 - hp-plugin installs malformed udev files
  181. # reported upstream https://bugs.launchpad.net/hplip/+bug/1847477
  182. Patch59: hplip-plugin-udevissues.patch
  183. # reported upstream https://bugs.launchpad.net/hplip/+bug/1938504
  184. Patch60: hplip-osname-mismatch.patch
  185. # 2080235 - Misleading errors about missing shared libraries when scanning
  186. # downstream patch to prevent errors:
  187. # - when loading libhpmud.so - unversioned .so files belong into devel packages,
  188. # but dlopen() in hplip was set to load the unversioned .so - so to remove rpmlint
  189. # error (when libhpmud.so is in non-devel package) and prevent runtime dependency on -devel
  190. # package (if libhpmud.so had been moved to -devel) the dlopen on unversioned .so file was
  191. # removed
  192. # - /lib64/libm.so is not symlink but ld script, which cannot be used in dlopen()
  193. Patch61: hplip-no-libhpmud-libm-warnings.patch
  194. # hplip 3.22.6 doesn't use the correct arguments for snprintf
  195. # reported as https://bugs.launchpad.net/hplip/+bug/1982185
  196. Patch62: hplip-snprintf-format.patch
  197. Patch63: hplip-plugin-script.patch
  198. # Vine Patches
  199. Patch70: hplip-drop-imageProcessor.patch
  200. Patch80: hplip-3.16.5-hpijs.patch
  201. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  202. Requires: cups
  203. Requires: dbus
  204. Requires: dbus-python3
  205. Requires: foomatic
  206. Requires: ghostscript
  207. Requires: openssl
  208. Requires: %{name}-libs = %{version}-%{release}
  209. BuildRequires: avahi-devel
  210. BuildRequires: cups-devel
  211. BuildRequires: dbus-devel
  212. BuildRequires: desktop-file-utils
  213. BuildRequires: libusb1-devel
  214. BuildRequires: libjpeg-devel
  215. BuildRequires: net-snmp-devel
  216. BuildRequires: openssl-devel
  217. BuildRequires: python3-devel
  218. BuildRequires: python3-rpm-macros
  219. BuildRequires: python3-cups, cups
  220. BuildRequires: sane-devel
  221. BuildRequires: python3-qt5
  222. BuildRequires: libappstream-glib
  223. BuildRequires: gsettings-desktop-schemas
  224. # to force to use Qt5
  225. BuildConflicts: PyQt
  226. BuildConflicts: PyQt4
  227. Provides: hpijs = %{version}-%{release}
  228. Obsoletes: hpijs < %{version}-%{release}
  229. %description
  230. The Hewlett-Packard Linux Imaging and Printing Project provides
  231. drivers for HP printers and multi-function peripherals.
  232. It supports the DeskJet 350C, 600C, 600C Photo, 630C, Apollo 2000,
  233. Apollo 2100, Apollo 2560, DeskJet 800C, DeskJet 825, DeskJet 900,
  234. PhotoSmart, DeskJet 990C, and PhotoSmart 100 series.
  235. %description -l ja
  236. Hewlett-Packard Linux Imaging and Printing Project は HP 製プリンタ及びプリンタ複合機用のドライバを提供します。
  237. これには DeskJet 350C, 600C, 600C Photo, 630C, Apollo 2000, Apollo 2100, Apollo 2560, DeskJet 800C, DeskJet 825, DeskJet 900, PhotoSmart, DeskJet 990C, and PhotoSmart 100 シリーズ等が含まれます。
  238. #---------------------------------------------------------------------
  239. %package libs
  240. Summary: HPLIP libraries
  241. Summary(ja): HPLIP ライブラリ
  242. Group: system
  243. License: GPLv2+ and MIT
  244. Requires: python3
  245. %description libs
  246. Libraries needed by HPLIP.
  247. %description libs -l ja
  248. HPLIP 用のライブラリです。
  249. #---------------------------------------------------------------------
  250. %package gui
  251. Summary: HPLIP graphical tools
  252. Summary(ja): HPLIP 用 GUI ツール
  253. Group: publishing
  254. License: BSD
  255. Requires: %{name} = %{version}-%{release}
  256. Requires: python3-qt5
  257. #Requires: python3-reportlab
  258. Requires: python3-pygobject
  259. Requires: python3-pillow
  260. Requires: %{name}%{?_isa} = %{version}-%{release}
  261. Requires: libsane-hpaio%{?_isa} = %{version}-%{release}
  262. %description gui
  263. HP Device manager (toolbox) is a graphical utility including
  264. maintenance tools, supplies levels, and status information.
  265. %description gui -l ja
  266. HP デバイスマネージャ (toolbox) は、各種設定やインクや紙の残量確
  267. 認、ステータス情報の確認が行える HPLIP 用の GUI ユーティリティです。
  268. #---------------------------------------------------------------------
  269. %package -n libsane-hpaio
  270. Summary: SANE driver for scanners in HP's multi-function devices
  271. Summary(ja): HP 複合機のスキャナ用 SANE ドライバ
  272. Group: system
  273. License: GPLv2+
  274. Requires: %{name}-libs = %{version}-%{release}
  275. Requires: sane
  276. %description -n libsane-hpaio
  277. SANE driver for scanners in HP inkjet and laser based multi-function
  278. printers.
  279. %description -n libsane-hpaio -l ja
  280. HP インクジェット及びレーザープリンタ複合機のスキャナ機能を利用する
  281. 為の SANE ドライバです。
  282. #---------------------------------------------------------------------
  283. %debug_package
  284. #---------------------------------------------------------------------
  285. %prep
  286. %setup -q
  287. # The pstotiff filter is rubbish so replace it (launchpad #528394).
  288. %patch1 -p1 -b .pstotiff-is-rubbish
  289. # Fix compilation.
  290. %patch2 -p1 -b .strstr-const
  291. # Make utils.checkPyQtImport() look for the gui sub-package (bug #243273).
  292. %patch3 -p1 -b .ui-optional
  293. # Make sure to avoid handwritten asm.
  294. %patch4 -p1 -b .no-asm
  295. # Corrected several IEEE 1284 Device IDs using foomatic data.
  296. # Color LaserJet 2500 series (bug #659040)
  297. # LaserJet 4100 Series/2100 Series (bug #659039)
  298. %patch5 -p1 -b .deviceIDs-drv
  299. chmod +x %{SOURCE2}
  300. mv prnt/drv/hpijs.drv.in{,.deviceIDs-drv-hpijs}
  301. %{SOURCE2} prnt/drv/hpcups.drv.in \
  302. prnt/drv/hpijs.drv.in.deviceIDs-drv-hpijs \
  303. > prnt/drv/hpijs.drv.in
  304. # Move udev rules from /etc/ to /usr/lib/ (bug #748208).
  305. %patch6 -p1 -b .udev-rules
  306. # Retry when connecting to device fails (bug #532112).
  307. %patch7 -p1 -b .retry-open
  308. # Mark SNMP quirks in PPD for HP OfficeJet Pro 8500 (bug #581825).
  309. %patch8 -p1 -b .snmp-quirks
  310. # Fixed bogus low ink warnings from hpijs driver (bug #643643).
  311. %patch9 -p1 -b .hpijs-marker-supply
  312. # Clear old printer-state-reasons we used to manage (bug #510926).
  313. %patch10 -p1 -b .clear-old-state-reasons
  314. # Avoid busy loop in hpcups when backend has exited (bug #525944).
  315. %patch11 -p1 -b .hpcups-sigpipe
  316. # CUPS filters should use TMPDIR when available (bug #865603).
  317. %patch12 -p1 -b .logdir
  318. # Fixed Device ID parsing code in hpijs's dj9xxvip.c (bug #510926).
  319. %patch13 -p1 -b .bad-low-ink-warning
  320. # Add Device ID for
  321. # HP LaserJet Color M451dn (bug #1159380)
  322. for ppd_file in $(grep '^diff' %{PATCH14} | cut -d " " -f 4);
  323. do
  324. gunzip ${ppd_file#*/}.gz
  325. done
  326. %patch14 -p1 -b .deviceIDs-ppd
  327. for ppd_file in $(grep '^diff' %{PATCH14} | cut -d " " -f 4);
  328. do
  329. gzip -n ${ppd_file#*/}
  330. done
  331. # Fix ImageableArea for Laserjet 8150/9000 (bug #596298).
  332. for ppd_file in $(grep '^diff' %{PATCH15} | cut -d " " -f 4);
  333. do
  334. gunzip ${ppd_file#*/}.gz
  335. done
  336. %patch15 -p1 -b .ImageableArea
  337. for ppd_file in $(grep '^diff' %{PATCH15} | cut -d " " -f 4);
  338. do
  339. gzip -n ${ppd_file#*/}
  340. done
  341. # Scan to /var/tmp instead of /tmp (bug #1076954).
  342. %patch16 -p1 -b .scan-tmp
  343. # Treat logging before importing of logger module (bug #984699).
  344. %patch17 -p1 -b .log-stderr
  345. # Fix parsing of avahi-daemon output (bug #1096939).
  346. %patch18 -p1 -b .parsing
  347. # Fixed left/right margins for HP DeskJet 990C (LP #1405212).
  348. %patch19 -p1 -b .dj990c-margin
  349. # Fixed uses of strncpy throughout.
  350. %patch20 -p1 -b .strncpy
  351. # Don't try to write bytecode cache for hpfax backend (bug #1192761)
  352. # or hp-config_usb_printer (bug #1266903)
  353. # or hpps filter (bug #1241548).
  354. %patch21 -p1 -b .no-write-bytecode
  355. # Ignore IOError when logging output (bug #712537).
  356. %patch22 -p1 -b .silence-ioerror
  357. # [abrt] hplip: hp-scan:663:<module>:NameError: name 'source_option' is not defined (bug #1341304)
  358. %patch23 -p1 -b .sourceoption
  359. # hplip license problem (bug #1364711)
  360. %patch24 -p1 -b .no-ernie
  361. # hplip appdata
  362. %patch25 -p1 -b .appdata
  363. # hp-check shows 'CUPS incompatible or not running' even if CUPS is running (bug #1456467)
  364. %patch26 -p1 -b .check-cups
  365. # hp-firmware:NameError: name 'INTERACTIVE_MODE4' is not defined (bug #1533869)
  366. %patch27 -p1 -b .typo
  367. %patch28 -p1 -b .use-binary-str
  368. # TypeError: 'Error' object does not support indexing (bug #1564770)
  369. # upstream bug: https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/1718129
  370. # in python2 it was possible to acces Exception message by index [0].
  371. # in python3 this is no longer possible and it causes TypeError.
  372. %patch29 -p1 -b .error-print-fix
  373. # TypeError: not all arguments converted during string formatting (bug #1566938)
  374. # upstream bug: https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/616450
  375. # bug caused by more arguments than argument specifiers in formatted string
  376. %patch30 -p1 -b .hpfax-import-error-print
  377. # 'WifiSetupDialog' object has no attribute 'wifiobj' (bug #1626877)
  378. # upstream bug: https://bugs.launchpad.net/hplip/+bug/1752060
  379. # bug caused by typo in wifisetupdialog wifiObj property call
  380. %patch31 -p1 -b .wifisetup-bad-call-fix
  381. # have pool of keyservers to choose
  382. %patch32 -p1 -b .keyserver
  383. # TypeError: argument 5 has unexpected type 'StandardButtons' (bug #1594602)
  384. # upstream bug: https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/1745383
  385. # bug caused by typo in QMessageBox constructor call
  386. # this patch fixes more of those typos - some fixed by tkorbar, some taken from ubuntu fix
  387. %patch33 -p1 -b .qmsgbox-typos-fix
  388. # removal of non open source code, taken from ubuntu
  389. %patch34 -p1 -b .libimageprocessor-removal
  390. rm prnt/hpcups/libImageProcessor-x86*
  391. %patch35 -p1 -b .toolbox-crash
  392. # part of https://bugzilla.redhat.com/show_bug.cgi?id=1666076
  393. %patch36 -p1 -b .add-ppd-crash
  394. # 1671513 - after 'successful' plugin installation it is not installed
  395. %patch37 -p1 -b .missing-links
  396. # 1684434 - Scanning broken for HP LaserJet 3052
  397. %patch38 -p1 -b .hp-laserjet-3052-broken-scanning
  398. # 1694663 - Cannot scan with M281fdw LaserJet - failed: Error during device I/O (part 1)
  399. %patch39 -p1 -b .hpmud-string-parse
  400. # 1694663 - Cannot scan with M281fdw LaserJet - failed: Error during device I/O (part 2)
  401. %patch40 -p1 -b .m278-m281-needs-plugin
  402. # 1695716 - hpcups crashes in Compressor destructor
  403. %patch41 -p1 -b .hpcups-crash
  404. # fixing issues found by coverity scan
  405. %patch42 -p1 -b .covscan
  406. # segfault during logging (1727162)
  407. %patch43 -p1 -b .logging-segfault
  408. # 1738321 - [abrt] hp-systray:BlockingIOError: [Errno 11] Resource temporarily unavailable
  409. %patch44 -p1 -b .systray-blockerror
  410. # 1742949, 1740132, 1739855 - missing drivers
  411. %patch45 -p1 -b .missing-drivers
  412. # 1772698 - Can't setup printer (HP LJ 2200): no attributes found in model.dat
  413. %patch46 -p1 -b .model-mismatch
  414. # 1573430 - sixext.py:to_string_utf8:UnicodeDecodeError: 'utf-8' codec can't decode bytes
  415. %patch47 -p1 -b .unicodeerror
  416. %patch48 -p1 -b .Wreturn-fix
  417. %patch49 -p1 -b .configure-python
  418. %patch50 -p1 -b .dialog-infinite-loop
  419. # 1590014 - hplip PPD search doesn't expect '-' in device name
  420. %patch51 -p1 -b .find-driver
  421. # 1833308 - hp-clean cannot clean HP PSC1410 - Device I/O error
  422. %patch52 -p1 -b .clean-ldl
  423. %patch53 -p1 -b .revert-plugins
  424. # 1899410 - non-sudoers cannot authenticate because of bad username in prompt
  425. %patch54 -p1 -b .check-userperms
  426. # 1919556 - hp-fab crashed: QFileDialog.getOpenFileName is not used correctly
  427. %patch55 -p1 -b .fab-import
  428. # if an user tries to install scanner via hp-setup (printer/fax utility)
  429. # it fails further down - break out earlier with a message
  430. %patch56 -p1 -b .hpsetup-noscanjets
  431. # 1963114 - patch for hplip firmware load timeout fix
  432. %patch57 -p1 -b .hpfirmware-timeout
  433. # 1985251 - Incorrect permission for gpg directory
  434. %patch58 -p1 -b .gpgdir-perms
  435. # 1987141 - hp-plugin installs malformed udev files
  436. %patch59 -p1 -b .hpplugin-udevperms
  437. # upstream bug https://bugs.launchpad.net/hplip/+bug/1938504
  438. %patch60 -p1 -b .osname-mismatch
  439. # 2080235 - Misleading errors about missing shared libraries when scanning
  440. %patch61 -p1 -b .no-libm-libhpmud-warn
  441. # hplip 3.22.6 doesn't use proper arguments for snprintf
  442. %patch62 -p1 -b .snprintf-format
  443. %patch63 -p1 -b .plugin-patch
  444. # vine
  445. %patch80 -p1 -b .hpijs
  446. sed -i.duplex-constraints \
  447. -e 's,\(UIConstraints.* \*Duplex\),//\1,' \
  448. prnt/drv/hpcups.drv.in
  449. # Change shebang /usr/bin/env python -> /usr/bin/python3 (bug #618351).
  450. find -name '*.py' -print0 | xargs -0 \
  451. sed -i.env-python -e 's,^#!/usr/bin/env python,#!%{__python3},'
  452. sed -i.env-python -e 's,^#!/usr/bin/env python,#!%{__python3},' \
  453. prnt/filters/hpps \
  454. fax/filters/pstotiff
  455. rm locatedriver
  456. cp -p %{SOURCE4} %{SOURCE5} ppd/hpcups
  457. # 2129849 - move hp-plugin script into srcdir
  458. cp -p %{SOURCE7} .
  459. %build
  460. # Work-around Makefile.am imperfections.
  461. sed -i 's|^AM_INIT_AUTOMAKE|AM_INIT_AUTOMAKE([foreign])|g' configure.in
  462. touch NEWS README AUTHORS ChangeLog
  463. autoreconf -fiv
  464. %configure \
  465. --disable-imageProcessor-build \
  466. --enable-scan-build --enable-gui-build --enable-fax-build \
  467. --disable-foomatic-rip-hplip-install --enable-pp-build \
  468. --disable-qt4 --enable-qt5 \
  469. --enable-hpcups-install --enable-cups-drv-install \
  470. --enable-foomatic-drv-install --enable-dbus-build \
  471. --enable-hpijs-install \
  472. --enable-policykit \
  473. --with-mimedir=%{_datadir}/cups/mime \
  474. --with-cupsbackenddir=%{_libdir}/cups/backend \
  475. --with-cupsfilterdir=%{_libdir}/cups/filter \
  476. --with-hpppddir=%{_datadir}/foomatic/db/source/PPD/HP \
  477. PYTHON=%{__python3}
  478. make %{?_smp_mflags}
  479. %install
  480. rm -rf $RPM_BUILD_ROOT
  481. make install DESTDIR=$RPM_BUILD_ROOT PYTHON=%{__python3} rulesdir=/lib/udev/rules.d
  482. # Create /run/hplip & /var/lib/hp
  483. mkdir -p $RPM_BUILD_ROOT/run/hplip
  484. mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/hp
  485. # install modified .desktop
  486. #{__install} -m 644 %{SOURCE1} ${RPM_BUILD_ROOT}/%{_datadir}/applications/hplip.desktop
  487. # install /usr/lib/tmpfiles.d/hplip.conf (bug #1015831)
  488. mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d
  489. cat > $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d/hplip.conf <<EOF
  490. # See tmpfiles.d(5) for details
  491. d /run/hplip 0775 root lp -
  492. EOF
  493. # remove unpacked files.
  494. rm -rf %{buildroot}%{_sysconfdir}/sane.d \
  495. %{buildroot}%{_docdir} \
  496. %{buildroot}%{_datadir}/hal/fdi \
  497. %{buildroot}%{_datadir}/hplip/pkservice.py \
  498. %{buildroot}%{_bindir}/hp-pkservice \
  499. %{buildroot}%{_datadir}/hplip/locatedriver* \
  500. %{buildroot}%{_datadir}/hplip/dat2drv*
  501. rm -f %{buildroot}%{_bindir}/hp-logcapture \
  502. %{buildroot}%{_bindir}/hp-doctor \
  503. %{buildroot}%{_bindir}/hp-pqdiag \
  504. %{buildroot}%{_datadir}/hplip/logcapture.py \
  505. %{buildroot}%{_datadir}/hplip/doctor.py \
  506. %{buildroot}%{_datadir}/hplip/pqdiag.py
  507. rm -f %{buildroot}%{_bindir}/foomatic-rip \
  508. %{buildroot}%{_libdir}/cups/filter/foomatic-rip \
  509. %{buildroot}%{_libdir}/*.la \
  510. %{buildroot}%{python3_sitearch}/*.la \
  511. %{buildroot}%{_libdir}/libhpip.so \
  512. %{buildroot}%{_libdir}/libhpipp.so \
  513. %{buildroot}%{_libdir}/libhpdiscovery.so \
  514. %{buildroot}%{_libdir}/sane/*.la \
  515. %{buildroot}%{_datadir}/cups/model/foomatic-ppds \
  516. %{buildroot}%{_datadir}/applications/hplip.desktop \
  517. %{buildroot}%{_datadir}/ppd/HP/*.ppd
  518. mkdir -p %{buildroot}%{_datadir}/metainfo
  519. cp %{SOURCE3} %{buildroot}%{_datadir}/metainfo/
  520. mkdir -p %{buildroot}%{_datadir}/icons/hicolor/{16x16,32x32,64x64}/apps
  521. install -p -m644 %{buildroot}%{_datadir}/hplip/data/images/16x16/hp_logo.png \
  522. %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/hp_logo.png
  523. install -p -m644 %{buildroot}%{_datadir}/hplip/data/images/32x32/hp_logo.png \
  524. %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/hp_logo.png
  525. install -p -m644 %{buildroot}%{_datadir}/hplip/data/images/64x64/hp_logo.png \
  526. %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/hp_logo.png
  527. mkdir -p %{buildroot}%{_datadir}/applications
  528. sed -i -e '/^Categories=/d' hplip.desktop
  529. # Encoding key is deprecated
  530. sed -i -e '/^Encoding=/d' hplip.desktop
  531. desktop-file-validate hplip.desktop
  532. desktop-file-install \
  533. --dir %{buildroot}/%{_datadir}/applications \
  534. --add-category System \
  535. --add-category Settings \
  536. --add-category HardwareSettings \
  537. hplip.desktop
  538. appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.metainfo.xml
  539. # install hp-uiscan desktop file
  540. sed -i 's/\/usr\/share\/icons\/Humanity\/devices\/48\/printer\.svg/hp_logo/' hp-uiscan.desktop
  541. # Regenerate hpcups PPDs on upgrade if necessary (bug #579355).
  542. #install -p -m755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/hpcups-update-ppds
  543. %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/sane.d/dll.d
  544. echo hpaio > $RPM_BUILD_ROOT%{_sysconfdir}/sane.d/dll.d/hpaio
  545. # Images in docdir should not be executable (bug #440552).
  546. find doc/images -type f -exec chmod 644 {} \;
  547. # Create an empty plugins directory to make sure it gets the right
  548. # SELinux file context (bug #564551).
  549. %{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/hplip/prnt/plugins
  550. # Remove files we don't want to package.
  551. rm -f $RPM_BUILD_ROOT%{_datadir}/hplip/hpaio.desc
  552. rm -f $RPM_BUILD_ROOT%{_datadir}/hplip/hplip-install
  553. rm -rf $RPM_BUILD_ROOT%{_datadir}/hplip/install.*
  554. rm -f $RPM_BUILD_ROOT%{_datadir}/hplip/uninstall.*
  555. rm -f $RPM_BUILD_ROOT%{_bindir}/hp-uninstall
  556. rm -f $RPM_BUILD_ROOT%{_datadir}/hplip/upgrade.*
  557. rm -f $RPM_BUILD_ROOT%{_bindir}/hp-upgrade
  558. rm -f $RPM_BUILD_ROOT%{_bindir}/hp-config_usb_printer
  559. rm -f $RPM_BUILD_ROOT%{_unitdir}/hplip-printer@.service
  560. rm -f $RPM_BUILD_ROOT%{_datadir}/hplip/config_usb_printer.*
  561. rm -f $RPM_BUILD_ROOT%{_datadir}/hplip/hpijs.drv.in.template
  562. rm -f $RPM_BUILD_ROOT%{_datadir}/cups/mime/pstotiff.types
  563. rm -f $RPM_BUILD_ROOT%{_datadir}/hplip/fax/pstotiff*
  564. rm -rf $RPM_BUILD_ROOT%{_prefix}/lib/systemd
  565. # The systray applet doesn't work properly (displays icon as a
  566. # window), so don't ship the launcher yet.
  567. rm -f $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
  568. %clean
  569. rm -rf $RPM_BUILD_ROOT
  570. %files
  571. %defattr(-,root,root)
  572. %doc COPYING doc/*
  573. #%doc %{_datadir}/doc/%{name}-%{version}
  574. %{_bindir}/hp-align
  575. %{_bindir}/hp-clean
  576. %{_bindir}/hp-colorcal
  577. %{_bindir}/hp-devicesettings
  578. %{_bindir}/hp-diagnose_plugin
  579. %{_bindir}/hp-diagnose_queues
  580. %{_bindir}/hp-fab
  581. %{_bindir}/hp-faxsetup
  582. %{_bindir}/hp-firmware
  583. %{_bindir}/hp-info
  584. %{_bindir}/hp-levels
  585. %{_bindir}/hp-linefeedcal
  586. %{_bindir}/hp-makecopies
  587. %{_bindir}/hp-makeuri
  588. %{_bindir}/hp-plugin
  589. %{_bindir}/hp-printsettings
  590. %{_bindir}/hp-probe
  591. %{_bindir}/hp-query
  592. %{_bindir}/hp-scan
  593. %{_bindir}/hp-sendfax
  594. %{_bindir}/hp-setup
  595. %{_bindir}/hp-testpage
  596. %{_bindir}/hp-timedate
  597. %{_bindir}/hp-unload
  598. %{_bindir}/hp-wificonfig
  599. %{_libdir}/cups/backend/hp
  600. %{_libdir}/cups/backend/hpfax
  601. %{_libdir}/cups/filter/hpcups
  602. %{_libdir}/cups/filter/hpcupsfax
  603. %{_libdir}/cups/filter/hpps
  604. %{_libdir}/cups/filter/pstotiff
  605. %{_datadir}/cups/mime/pstotiff.convs
  606. # Files
  607. %{_datadir}/hplip/align.py*
  608. %{_datadir}/hplip/check-plugin.py*
  609. %{_datadir}/hplip/clean.py*
  610. %{_datadir}/hplip/colorcal.py*
  611. %{_datadir}/hplip/devicesettings.py*
  612. %{_datadir}/hplip/diagnose_plugin.py*
  613. %{_datadir}/hplip/diagnose_queues.py*
  614. %{_datadir}/hplip/fab.py*
  615. %{_datadir}/hplip/fax
  616. %{_datadir}/hplip/faxsetup.py*
  617. %{_datadir}/hplip/firmware.py*
  618. %{_datadir}/hplip/hpdio.py*
  619. %{_datadir}/hplip/hplip_clean.sh
  620. %{_datadir}/hplip/hpssd*
  621. %{_datadir}/hplip/info.py*
  622. %{_datadir}/hplip/__init__.py*
  623. %{_datadir}/hplip/levels.py*
  624. %{_datadir}/hplip/linefeedcal.py*
  625. %{_datadir}/hplip/makecopies.py*
  626. %{_datadir}/hplip/makeuri.py*
  627. %{_datadir}/hplip/plugin.py*
  628. %{_datadir}/hplip/printsettings.py*
  629. %{_datadir}/hplip/probe.py*
  630. %{_datadir}/hplip/query.py*
  631. %{_datadir}/hplip/scan.py*
  632. %{_datadir}/hplip/sendfax.py*
  633. %{_datadir}/hplip/setup.py*
  634. %{_datadir}/hplip/testpage.py*
  635. %{_datadir}/hplip/timedate.py*
  636. %{_datadir}/hplip/unload.py*
  637. %{_datadir}/hplip/wificonfig.py*
  638. # Directories
  639. %{_datadir}/hplip/base
  640. %{_datadir}/hplip/copier
  641. %{_datadir}/hplip/data/ldl
  642. %{_datadir}/hplip/data/localization
  643. %{_datadir}/hplip/data/pcl
  644. %{_datadir}/hplip/data/ps
  645. %{_datadir}/hplip/installer
  646. %{_datadir}/hplip/pcard
  647. %{_datadir}/hplip/prnt
  648. %{_datadir}/hplip/scan
  649. %{_localstatedir}/lib/hp
  650. %dir %attr(0775,root,lp) /run/hplip
  651. %{_prefix}/lib/tmpfiles.d/hplip.conf
  652. %dir %{_sysconfdir}/hp
  653. %config(noreplace) %{_sysconfdir}/hp/hplip.conf
  654. /lib/udev/rules.d/56-hpmud.rules
  655. %dir %{_datadir}/hplip
  656. %dir %{_datadir}/hplip/data
  657. %{_datadir}/hplip/data/models
  658. %{_bindir}/hpijs
  659. #{_bindir}/hpcups-update-ppds
  660. %{_datadir}/cups/drv/*
  661. %dir %{_datadir}/foomatic/db/source/PPD/HP
  662. %{_datadir}/foomatic/db/source/PPD/HP/*
  663. %{_sysconfdir}/dbus-1/system.d/com.hp.hplip.conf
  664. %{_datadir}/dbus-1/system-services/com.hp.hplip.service
  665. %{_datadir}/polkit-1/actions/com.hp.hplip.policy
  666. %files libs
  667. %defattr(-,root,root)
  668. %{_libdir}/libhpip.so.*
  669. # The so symlink is required here (see bug #489059).
  670. %{_libdir}/libhpmud.so*
  671. %{_libdir}/libhpdiscovery.so*
  672. %{_libdir}/libhpipp.so*
  673. # Python extension
  674. %{python3_sitearch}/*
  675. %files gui
  676. %defattr(-,root,root)
  677. %{_bindir}/hp-check
  678. %{_bindir}/hp-print
  679. %{_bindir}/hp-systray
  680. %{_bindir}/hp-toolbox
  681. %{_bindir}/hp-uiscan
  682. %{_datadir}/applications/*.desktop
  683. %{_datadir}/metainfo/hplip.metainfo.xml
  684. # Files
  685. %{_datadir}/icons/hicolor/*/apps/*
  686. %{_datadir}/hplip/check.py*
  687. %{_datadir}/hplip/print.py*
  688. %{_datadir}/hplip/systray.py*
  689. %{_datadir}/hplip/toolbox.py*
  690. %{_datadir}/hplip/uiscan.py*
  691. # Directories
  692. %{_datadir}/hplip/data/images
  693. %{_datadir}/hplip/ui5
  694. %{_datadir}/hplip/uiscan.py*
  695. %files -n libsane-hpaio
  696. %defattr(-,root,root)
  697. %{_libdir}/sane/libsane-hpaio*
  698. %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
  699. %changelog
  700. * Sat Oct 29 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.22.6-1
  701. - new upstream release.
  702. - re-import all patches from rawhide.
  703. * Wed Nov 03 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.21.10-1
  704. - new upstream release.
  705. - dropped Patch37 and 57: fixed in upstream.
  706. - imported Patch59-69 from rawhide.
  707. - dropped ldconfig scriptlets.
  708. * Tue Sep 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.20.6-2
  709. - rebuilt with net-snmp-5.9.
  710. * Sun Aug 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.20.6-1
  711. - new upstream release.
  712. * Thu May 16 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.18.12-1
  713. - dropped R:gksu.
  714. - imported Patche36-47 from rawhide.
  715. - switched to python3.
  716. - switched gui to Qt5.
  717. * Wed Nov 07 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.18.10-1
  718. - new upstream release.
  719. - updated Patch12.
  720. - imported Patche24-35 from rawhide.
  721. * Sat Jul 2 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.16.5-1
  722. - new upstream release.
  723. - dropped all patches.
  724. - imported all patches from rawhide.
  725. - added Patch80 to fix error in building hpijs.
  726. * Sun May 15 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.15.2-2
  727. - rebuild with openssl-1.0.2
  728. * Thu Mar 19 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.15.2-1
  729. - updated to 3.15.2
  730. - updated Source1
  731. - renumbered former Patch 0 and 1 to Patch 70 and 6
  732. - built with libusb1
  733. - added BR: desktop-file-utils
  734. * Wed Mar 07 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.11.5-5
  735. - rebuild with net-snmp-5.7.1
  736. * Wed Mar 07 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.11.5-5
  737. - rebuild with net-snmp-5.7.1
  738. * Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.11.5-4
  739. - rebuild with python-2.7.2
  740. * Mon Jun 13 2011 Kazutaka HARADA <kazutaka@vinelinux.org> 3.11.5-3
  741. - add Obsoletes: hpijs < 3.10
  742. * Sun Jun 12 2011 Kazutaka HARADA <kazutaka@vinelinux.org> 3.11.5-2
  743. - change configure option to --enable-hpijs-install
  744. - add Provides: hpijs
  745. - change ppd installation path to %{_datadir}/foomatic/db/source/PPD/HP
  746. - update Source1 (hplip.desktop.vine)
  747. - update Patch0 (hplip-3.11.5-gksu.patch)
  748. - add Patch1 to fix udev old syntax (hplip-udev-rules.patch)
  749. * Tue Mar 15 2011 Kazutaka HARADA <kazutaka@vinelinux.org> 3.11.5-1
  750. - new upstream release
  751. - change configure option: disable qt3 and enable qt4
  752. - add configure option: --enable-foomatic-drv-install
  753. - add BuildRequires: openssl-devel
  754. - add Requires: dbus-python
  755. - add Requires: notify-python (gui)
  756. - change Requires: PyQt to PyQt4 (gui)
  757. - add BuildConflicts: PyQt
  758. - add ppds below %{_datadir}/cups/model/foomatic/hp-*
  759. because foomatic (>= 4.0.3) drop PPDs for HP printers.
  760. * Fri Jul 24 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 3.9.4b-3
  761. - add Patch0 to require root privilege (via gksu) when adding printer
  762. - add Requires: gksu
  763. * Mon Jun 08 2009 Shu KONNO <owa@bg.wakwak.com> 3.9.4b-2
  764. - added --with-cupsfilterdir to configure option
  765. - use python_sitearch macro instead of python_platlib
  766. * Sun Jun 07 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 3.9.4b-1
  767. - new upstream release
  768. - split libraries to -libs sub package
  769. - update configure option
  770. add --enable-dbus-build, --enable-qt3, --disable-qt4
  771. * Mon Jul 21 2008 Shu KONNO <owa@bg.wakwak.com> 2.7.12-1vl5
  772. - rebuilt with python-2.5.2
  773. - added python_platlib macro
  774. - applied new versioning policy and spec in utf-8
  775. * Sun Jan 6 2008 Shu KONNO <owa@bg.wakwak.com> 2.7.12-0vl2
  776. - added --with-cupsbackenddir=%%{_libdir}/cups/backend to configure
  777. * Thu Jan 3 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 2.7.12-0vl1
  778. - new upstream release
  779. - build with net-snmp-5.4.1
  780. * Thu Jun 28 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 2.7.6-0vl1
  781. - initial build for Vine Linux