hpoj-vl.spec 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. # Define if you want to build the sane backend (default)
  2. %define sane_backend 1
  3. Summary: HP OfficeJet low level driver infrastructure
  4. Name: hpoj
  5. Version: 0.91
  6. Release: 0vl2
  7. License: GPL
  8. Group: System Environment/Daemons
  9. Source: http://hpoj.sourceforge.net/download/%{name}-%{version}.tgz
  10. Source1: hpoj.png
  11. # Wrapper script to start "xojpanel" with device auto-detection
  12. Source2: allxojpanels
  13. Patch0: hpoj-ppc.patch
  14. Patch2: hpoj-lib64.patch
  15. Patch5: hpoj-0.90-quiet.patch
  16. Patch6: hpoj-0.90-perl.patch
  17. Patch7: hpoj-0.90-netsnmp.patch
  18. Patch8: hpoj-selinux.patch
  19. Patch9: hpoj-0.91-kernel26.patch
  20. Patch10: hpoj-pack.patch
  21. Url: http://hpoj.sourceforge.net
  22. Requires: net-snmp
  23. Prereq: glibc
  24. %if %{sane_backend}
  25. BuildRequires: sane-devel
  26. %endif
  27. BuildRequires: net-snmp-devel, qt-devel >= 3.0.0, openssl-devel, libusb-devel
  28. BuildRoot: %{_tmppath}/%{name}-buildroot
  29. ExcludeArch: s390 s390x
  30. %description
  31. This is an HP-sponsored project to add Linux support for most
  32. Hewlett-Packard OfficeJet, PSC, and LaserJet all-in-one peripherals
  33. (also known as Multi-Function Peripherals or MFPs), which can print,
  34. scan, copy, and (on some models) fax.
  35. It is work in progress, but printing, scanning, and photo-card access
  36. are supported on most models, when either connected to the parallel
  37. port or USB on a Linux (Intel or Alpha) workstation, or to a LAN with
  38. selected HP JetDirect print servers.
  39. %if %{sane_backend}
  40. %package -n libsane-hpoj
  41. Summary: SANE driver for scanners in HP's multi-function devices (from HPOJ)
  42. Group: System Environment/Daemons
  43. Requires: sane
  44. %endif
  45. %if %{sane_backend}
  46. %description -n libsane-hpoj
  47. SANE driver for scanners in HP's multi-function devices (from HPOJ)
  48. %endif
  49. %package -n hpoj-devel
  50. Summary: Headers required to compile against the "hpoj" library
  51. Group: Development/Libraries
  52. Requires: hpoj = %{version}-%{release}
  53. Provides: hpoj-devel = %{version}-%{release}
  54. %description -n hpoj-devel
  55. This package contains all the files which are required to compiles programs
  56. using the "hpoj" libraries.
  57. %package -n xojpanel
  58. Summary: Graphical tool displaying the contents of the LCD of HP printers
  59. Group: Applications/System
  60. Requires: hpoj
  61. Conflicts: hpoj < 0.90
  62. %description -n xojpanel
  63. Graphical tool displaying the contents of the LCD of HP multi-function
  64. devices and laser printers. Very useful to monitor the state (paper, ink,
  65. running job) of a printer directly on one's workstation's screen.
  66. %prep
  67. rm -rf $RPM_BUILD_DIR/%{name}-%{version}
  68. %setup -q -n %{name}-%{version}
  69. %ifarch ppc
  70. %patch0 -p1
  71. %endif
  72. # lib64 fixes
  73. %patch2 -p1 -b .lib64
  74. # Quieten init script (bug #79870).
  75. %patch5 -p1 -b .quiet
  76. # Work around bug #82652.
  77. %patch6 -p1 -b .perl
  78. # Use libnetsnmp not libsnmp (bug #105847).
  79. %patch7 -p1 -b .netsnmp
  80. # Fix up security contexts (bug #120054).
  81. %patch8 -p1 -b .selinux
  82. # Work with 2.6 kernel.
  83. %patch9 -p1 -b .kernel26
  84. # David Mosberger patch to avoid packing structs with fn ptrs.
  85. %patch10 -p1 -b .pack
  86. %build
  87. # Fix hard-coded paths, also take into account paths mentioned in the docs
  88. for i in `find . -type f -print`; do
  89. perl -p -i -e "s!doc/hpoj!doc/%{name}-%{version}!" $i
  90. done
  91. autoconf
  92. %if !%{sane_backend}
  93. WITHOUT_SANE="--without-sane"
  94. %endif
  95. unset QTDIR && . /etc/profile.d/qt.sh
  96. %configure --enable-mt $WITHOUT_SANE --with-snmp=%{_includedir}/net-snmp/ucd-snmp
  97. # Do not use the macro, it has parallelizing problems
  98. make etcdir=%{_sysconfdir} docdir=%{_docdir}/%{name}-%{version}
  99. %install
  100. rm -rf $RPM_BUILD_ROOT
  101. mkdir -p $RPM_BUILD_ROOT%{_initrddir}
  102. %makeinstall etcdir=%{buildroot}%{_sysconfdir}
  103. # install menu icon
  104. mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/Locolor/16x16/apps/
  105. install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/icons/Locolor/16x16/apps/
  106. # Install "xojpanel" wrapper
  107. install -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}
  108. # Install startup script
  109. cat <<"EOF" >> %{buildroot}%{_initrddir}/hpoj
  110. #!/bin/bash
  111. # chkconfig: 2345 54 61
  112. # description: ptal-init is the init script and device setup utility \
  113. # for the HP OfficeJet Linux driver.
  114. # Should be started before and stopped after your print spooler (lpd or CUPS).
  115. exec %{_sbindir}/ptal-init "$@"
  116. EOF
  117. chmod a+x %{buildroot}%{_initrddir}/hpoj
  118. # Backend filter for CUPS
  119. install -d %{buildroot}%{_libdir}/cups/backend
  120. mv %{buildroot}%{_sbindir}/ptal-cups %{buildroot}%{_libdir}/cups/backend/ptal
  121. # Make SANE scanner driver modules available in the right place (SANE
  122. # only finds them in /usr/lib/sane, not in /usr/lib
  123. %if %{sane_backend}
  124. install -d %{buildroot}%{_libdir}/sane
  125. ln -sf %{_libdir}/libsane-hpoj.so.1.0 %{buildroot}%{_libdir}/sane
  126. ln -sf %{_libdir}/libsane-hpoj.so.1 %{buildroot}%{_libdir}/sane
  127. ln -sf %{_libdir}/libsane-hpoj.so %{buildroot}%{_libdir}/sane
  128. %endif
  129. %post
  130. # Let HPOJ daemon be automatically started at boot time
  131. /sbin/chkconfig --add hpoj
  132. /sbin/ldconfig
  133. %if %{sane_backend}
  134. %post -n libsane-hpoj
  135. /sbin/ldconfig
  136. # Add HPOJ driver to /etc/sane.d/dll.conf
  137. if ! grep ^hpoj /etc/sane.d/dll.conf >/dev/null 2>/dev/null ; then \
  138. echo hpoj >> /etc/sane.d/dll.conf; \
  139. fi
  140. %endif
  141. %preun
  142. if [ "$1" = "0" ]; then
  143. /sbin/service hpoj stop > /dev/null 2>&1
  144. /sbin/chkconfig --del hpoj
  145. fi
  146. exit 0
  147. %postun
  148. /sbin/ldconfig
  149. if [ "$1" -ge "1" ]; then
  150. /sbin/service hpoj condrestart > /dev/null 2>&1
  151. fi
  152. exit 0
  153. %if %{sane_backend}
  154. %preun -n libsane-hpoj
  155. # Remove HPOJ driver from /etc/sane.d/dll.conf
  156. if [ "$1" = 0 ]; then \
  157. if grep ^hpoj %{_sysconfdir}/sane.d/dll.conf >/dev/null 2>&1 ; then \
  158. sed '/^hpoj$/d' %{_sysconfdir}/sane.d/dll.conf > \
  159. %{_sysconfdir}/sane.d/dll.conf.rpmmod; \
  160. mv -f %{_sysconfdir}/sane.d/dll.conf.rpmmod \
  161. %{_sysconfdir}/sane.d/dll.conf; \
  162. fi; \
  163. fi
  164. %endif
  165. %if %{sane_backend}
  166. %postun -n libsane-hpoj -p /sbin/ldconfig
  167. %endif
  168. %clean
  169. rm -rf $RPM_BUILD_ROOT
  170. %files
  171. %defattr(-,root,root)
  172. %config(noreplace) %{_initrddir}/*
  173. %{_sbindir}/*
  174. %{_bindir}/ptal*
  175. %{_bindir}/hpojip-test
  176. %doc %{_defaultdocdir}/%{name}-%{version}
  177. %{_libdir}/libptal*.so.*
  178. %{_libdir}/libhpojip*.so.*
  179. # CUPS backend
  180. %{_libdir}/cups/backend/ptal
  181. %if %{sane_backend}
  182. %files -n libsane-hpoj
  183. %defattr(-,root,root)
  184. %{_libdir}/libsane-hpoj*.so*
  185. %{_libdir}/sane/libsane-hpoj*.so*
  186. %endif
  187. %files -n xojpanel
  188. %defattr(-,root,root)
  189. %{_bindir}/xojpanel
  190. %{_bindir}/allxojpanels
  191. %{_datadir}/icons/Locolor/16x16/apps/*
  192. %files -n hpoj-devel
  193. %defattr(-,root,root)
  194. %{_includedir}/ptal*
  195. %{_includedir}/hpojip*
  196. %changelog
  197. * Tue Jan 04 2005 SAtoshi MACHINO <machino@vinelinux.org> 0.91-0vl2
  198. - rebuilt for VineSeed
  199. * Tue Jan 04 2005 Satoshi MACHINO <machino@vinelinux.org> 0.91-0vl0.31
  200. - rebuilt for VineLinux 3.1
  201. - fixed Requires of libsane-hpoj
  202. * Mon Jan 03 2005 Satoshi MACHINO <machino@vinelinux.org> 0.91-0vl1
  203. - rebuilt for VineLinux
  204. * Fri Dec 10 2004 Tim Waugh <twaugh@rehdat.com> 0.91-11
  205. - Ship CUPS backend in the right directory to avoid the need for a symbolic
  206. link (bug #123589).
  207. * Fri Nov 12 2004 Tim Waugh <twaugh@rehdat.com> 0.91-10
  208. - David Mosberger patch to avoid packing structs with fn ptrs.
  209. * Wed Sep 22 2004 Than Ngo <than@redhat.com> 0.91-9
  210. - add Prereq: /sbin/ldconfig
  211. * Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
  212. - rebuilt
  213. * Wed May 5 2004 Tim Waugh <twaugh@redhat.com> 0.91-7
  214. - Fix up security contexts (bug #120054).
  215. * Wed Mar 3 2004 Tim Waugh <twaugh@redhat.com> 0.91-6
  216. - Updated Till Kamppeter's 2.6 kernel patch.
  217. * Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
  218. - rebuilt
  219. * Mon Mar 1 2004 Tim Waugh <twaugh@redhat.com> 0.91-5
  220. - Really fix init script start-up order (bug #117206).
  221. * Mon Feb 23 2004 Tim Waugh <twaugh@redhat.com> 0.91-4
  222. - Apply Till Kamppeter's patch for 2.6 kernel support.
  223. * Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
  224. - rebuilt
  225. * Mon Dec 8 2003 Tim Waugh <twaugh@redhat.com> 0.91-2
  226. - Fix init script start-up order (bug #111633).
  227. * Mon Dec 1 2003 Tim Waugh <twaugh@redhat.com> 0.91-1
  228. - 0.91.
  229. * Tue Sep 30 2003 Tim Waugh <twaugh@redhat.com> 0.90-19
  230. - Fix postun scriptlet.
  231. * Mon Sep 29 2003 Tim Waugh <twaugh@redhat.com> 0.90-18
  232. - Use libnetsnmp not libsnmp (bug #105847).
  233. * Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> 0.90-17
  234. - rebuilt
  235. * Mon Apr 7 2003 Tim Waugh <twaugh@redhat.com> 0.90-16
  236. - Make the initscript a separate file on its own.
  237. * Mon Mar 24 2003 Tim Waugh <twaugh@redhat.com>
  238. - The initscript shouldn't be a symlink into /usr.
  239. * Tue Mar 18 2003 Tim Waugh <twaugh@redhat.com> 0.90-15
  240. - Really really work around bug #82652.
  241. * Mon Feb 24 2003 Elliot Lee <sopwith@redhat.com> 0.90-14
  242. - debuginfo rebuild
  243. * Sun Feb 23 2003 Tim Waugh <twaugh@redhat.com> 0.90-13
  244. - Really work around bug #82652.
  245. * Tue Feb 11 2003 Tim Waugh <twaugh@redhat.com> 0.90-12
  246. - Work around bug #82652.
  247. * Wed Jan 22 2003 Tim Powers <timp@redhat.com> 0.90-11
  248. - rebuilt
  249. * Thu Jan 9 2003 Tim Waugh <twaugh@redhat.com> 0.90-10
  250. - Fix rebuild problem.
  251. * Tue Jan 7 2003 Nalin Dahyabhai <nalin@redhat.com> 0.90-9
  252. - Rebuild
  253. * Sun Dec 29 2002 Florian La Roche <Florian.LaRoche@redhat.de>
  254. - exclude mainframe
  255. * Thu Dec 26 2002 Tim Waugh <twaugh@redhat.com> 0.90-7
  256. - Update description.
  257. - Don't create /dev/ptal-mlcd and ptal-printd. These aren't used by
  258. hpoj anymore.
  259. * Tue Dec 17 2002 Tim Waugh <twaugh@redhat.com> 0.90-6
  260. - Quieten init script (bug #79870).
  261. * Thu Dec 12 2002 Tim Waugh <twaugh@redhat.com> 0.90-5
  262. - Fix and apply the libdir patch.
  263. - Fix configure.in.
  264. * Wed Dec 11 2002 Tim Waugh <twaugh@redhat.com> 0.90-4
  265. - Adapted from contrib package (0.90-1).
  266. - Changed group.
  267. - Removed --with-qt=...
  268. - Fix scriptlets.
  269. * Sat Aug 10 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-3mdk
  270. - Rebuilt with gcc-3.2-0.3mdk.
  271. * Sat Aug 10 2002 Pixel <pixel@mandrakesoft.com> 0.90-2mdk
  272. - fix glob with spaces to please perl-base (especially for DrakX)
  273. * Thu Aug 8 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-1mdk
  274. - Updated to HPOJ 0.9 final.
  275. * Wed Aug 7 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-0.12mdk
  276. - BuildRequires: libopenssl-devel
  277. * Wed Aug 7 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-0.11mdk
  278. - The "xojpanel" package conflicts with older "hpoj" package versions, added
  279. appropriate "Conflicts:" entry.
  280. * Mon Aug 5 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-0.10mdk
  281. - Updated to current CVS (lock file name fix and documentation fixes).
  282. * Mon Jul 29 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 0.90-0.9mdk
  283. - Patch4: lib64 fixes in libraries lookup
  284. - Let it build without SANE circularae dependency
  285. * Sat Jul 27 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-0.8mdk
  286. - Updated to current CVS (Fixed xscanimage segfaulting when clicking
  287. on the preview area).
  288. * Wed Jul 24 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-0.7mdk
  289. - Updated to current CVS (2nd release candidate for HPOJ 0.90).
  290. - Corrected version number to 0.90.
  291. * Mon Jul 22 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.6mdk
  292. - Updated to current CVS (1st release candidate for HPOJ 0.90).
  293. * Thu Jun 27 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.5mdk
  294. - Updated to current CVS (last CVS broke printing after one or two
  295. printouts).
  296. * Mon Jun 24 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.4mdk
  297. - Moved menu updating in %%post and %%postun from main package to "xojpanel"
  298. sub package.
  299. * Mon Jun 24 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.3mdk
  300. - Updated to current CVS.
  301. - Separated off the xojpanel, so that the main package can easily be
  302. installed on an X-less server.
  303. * Tue Jun 18 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.2mdk
  304. - Updated to current CVS
  305. - Fixed setup for scanning (set links to scanner driver libraries, entry
  306. in /etc/sane.d/dll.conf)
  307. - "ptal" backend for CUPS is in this package now
  308. - Added "BuildRequires" line.
  309. * Tue May 28 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.1mdk
  310. - Corrected path to QT 3 to make "xojpanel" getting compiled.
  311. - Updated "allxojpanels" script.
  312. - Bumped version number to 0.9.
  313. * Tue May 28 2002 Till Kamppeter <till@mandrakesoft.com> 0.8-8mdk
  314. - Updated to current CVS, version 0.8 is not compatible to gcc 3.1.
  315. - Rebuilt for new libstdc++ and gcc 3.1.
  316. * Sat Mar 2 2002 Till Kamppeter <till@mandrakesoft.com> 0.8-7mdk
  317. - Fixed menu entry for "xojpanel", now a wrapper script searches for
  318. configured devices and starts "xojpanel" for these devices.
  319. * Fri Mar 1 2002 Till Kamppeter <till@mandrakesoft.com> 0.8-6mdk
  320. - Patches for known problems from http://hpoj.sourceforge.net/todo.shtml
  321. (Patch2, Patch3)
  322. * Wed Oct 24 2001 Vincent Saugey <vince@mandrakesoft.com> 0.8-5mdk
  323. - Replace ucd-snmp require by libsnmp0
  324. * Mon Oct 22 2001 Till Kamppeter <till@mandrakesoft.com> 0.8-4mdk
  325. - Added patch to generate directories for the HPOJ daemons in the DevFS
  326. file system
  327. * Sat Oct 20 2001 Stew Benedict <sbenedict@mandrakesoft.com> 0.8-3mdk
  328. - patch for PPC build
  329. * Wed Oct 10 2001 Till Kamppeter <till@mandrakesoft.com> 0.8-2mdk
  330. - Rebuilt for libpng3.
  331. * Wed Aug 8 2001 Till Kamppeter <till@mandrakesoft.com> 0.8-1mdk
  332. - initial release