source: projects/specs/trunk/h/hpoj/hpoj-vl.spec @ 521

Revision 521, 12.6 KB checked in by daisuke, 14 years ago (diff)

import VineSeed package specs

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