hplip-vl.spec 30 KB

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