Sophie

Sophie

distrib > Mandriva > 9.1 > i586 > by-pkgid > 88731f68ce242fc5842b1fc1dec0796c > files > 7

hpoj-0.90-4mdk.src.rpm

# Define if you want to build the sane backend (default)
%define sane_backend 1

##### GENERAL STUFF #####

Summary:	HP OfficeJet low level driver infrastructure
Name:		hpoj
Version:	0.90
Release:	4mdk
License:	GPL
Group:		System/Servers


##### SOURCE FILES #####

Source: http://hpoj.sourceforge.net/download/%{name}-%{version}.tar.bz2
#Source: http://hpoj.sourceforge.net/download/%{name}-cvs20020727.tar.bz2
# Icon for the Mandrake menu
Source3: hpoj.png.bz2
# Complete replacement for startup script to have it the
# Mandrake way
#Source5: hpoj.startup.bz2
# Wrapper script to start "xojpanel" with device auto-detection
Source6: allxojpanels.bz2
Patch0: hpoj-ppc.patch.bz2
# Patch to generate directories for the HPOJ daemons in the DevFS
# file system
#Patch1: ptal-init.in.patch.bz2
# Patches for known problems from http://hpoj.sourceforge.net/todo.shtml
#Patch2: hpoj-0.8-ptal-hp.patch.bz2
#Patch3: hpoj-0.8-ParPort.cpp.patch.bz2

# lib64 fixes
Patch4: hpoj-lib64.patch.bz2

Patch5: hpoj-0.90-split-the-glob-with-spaces-to-please-perl-base.patch.bz2

##### ADDITIONAL DEFINITIONS #####

Url: http://hpoj.sourceforge.net
Requires: libptal0 libhpojip0 libsnmp0
%if %{sane_backend}
BuildRequires: libsane-devel
%endif
BuildRequires: libsnmp-devel, libqt3-devel, libopenssl-devel
BuildRoot: %{_tmppath}/%{name}-buildroot
Conflicts: cups <= 1.1.14

%description

This is an HP-sponsored project to add Linux support for most
Hewlett-Packard OfficeJet, PSC, and LaserJet all-in-one peripherals
(also known as Multi-Function Peripherals or MFPs), which can print,
scan, copy, and (on some models) fax.

It is work in progress, but printing and scanning are supported on
most models, when either connected to the parallel port or USB on a
Linux (Intel or Alpha) workstation, or to a LAN with selected HP
JetDirect print servers.


##### SUB-PACKAGES #####

%package -n libptal0
Summary: Dynamic library for the "hpoj" HP Officejet low level drivers
Group: System/Servers
Requires: libsnmp0

%description -n libptal0
Library needed for the "hpoj" HP Officejet low level drivers.

%package -n libptal0-devel
Summary: Headers and links to compile against the "libptal0" ("hpoj") library
Group: Development/C
Requires: libptal0 >= %{version}-%{release}
Provides: libptal-devel = %{version}-%{release}

%description -n libptal0-devel
This package contains all files which one needs to compile programs using
the "libptal0" library.

%package -n libhpojip0
Summary: Dynamic library for the "hpoj" HP Officejet low level drivers
Group: System/Servers

%description -n libhpojip0
Library needed for the "hpoj" HP Officejet low level drivers.

%package -n libhpojip0-devel
Summary: Headers and links to compile against the "libhpojip0" ("hpoj") library
Group: Development/C
Requires: libhpojip0 >= %{version}-%{release}
Provides: libhpojip-devel = %{version}-%{release}

%description -n libhpojip0-devel
This package contains all files which one needs to compile programs using
the "libhpojip0" library.

%if %{sane_backend}
%package -n libsane-hpoj0
Summary: SANE driver for scanners in HP's multi-function devices (from HPOJ)
Group: System/Servers
Requires: sane-backends
%endif

%if %{sane_backend}
%description -n libsane-hpoj0
SANE driver for scanners in HP's multi-function devices (from HPOJ)
%endif

%package -n xojpanel
Summary: Graphical tool displaying the contents of the LCD of HP printers
Group: System/Servers
Requires: libptal0 libqt3
Conflicts: hpoj < 0.9-0.3mdk

%description -n xojpanel
Graphical tool displaying the contents of the LCD of HP multi-function
devices and laser printers. Very useful to monitor the state (paper, ink,
running job) of a printer directly on one's workstation's screen.

##### PREP #####

%prep
rm -rf $RPM_BUILD_DIR/%{name}-%{version}
%setup -q -n %{name}-%{version}
#rm -rf $RPM_BUILD_DIR/%{name}
#%setup -q -n %{name}

%ifarch ppc
%patch0 -p1
%endif

cd scripts
#patch1
cd ..
#patch2
#patch3
%patch4 -p1 -b .lib64
%patch5 -p1

# needed by Patch4
autoconf

# Load menu icon
bzcat %{SOURCE3} > hpoj.png
# Load Mandrake startup script
#bzcat %{SOURCE5} > hpoj.startup
# Load "xojpanel" wrapper script
bzcat %{SOURCE6} > allxojpanels

##### BUILD #####

%build
%serverbuild

# Fix hard-coded paths, also take into account paths mentioned in the docs
for i in `find . -type f -print`; do
    perl -p -i -e "s!doc/hpoj!doc/%{name}-%{version}!" $i
done
# Only needed for CVS snapshots
#autoconf

%if !%{sane_backend}
WITHOUT_SANE="--without-sane"
%endif
%configure --with-qt=/usr/lib/qt3 --enable-mt $WITHOUT_SANE
#--sysconfdir=/etc 

# Do not use the macro, it has parallelizing problems
make	etcdir=%{_sysconfdir} docdir=%{_docdir}/%{name}-%{version}

##### INSTALL #####

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_initrddir}

%makeinstall etcdir=%{buildroot}%{_sysconfdir}

# install menu icon
mkdir -p $RPM_BUILD_ROOT%{_iconsdir}/locolor/16x16/apps/
install -m 644 hpoj.png $RPM_BUILD_ROOT%{_iconsdir}/locolor/16x16/apps/

# install menu entry
mkdir -p $RPM_BUILD_ROOT%{_menudir}

cat <<EOF > $RPM_BUILD_ROOT%{_menudir}/xojpanel
?package(xojpanel): needs=X11 \
section=Applications/Monitoring \
title="X Office Jet Panel" \
longtitle="Displays the contents of the front panel LCD screen of your HP Office Jet in a window on your desktop" \
command="%{_bindir}/allxojpanels" \
icon="%{_iconsdir}/locolor/16x16/apps/hpoj.png"
EOF

# Install "xojpanel" wrapper
install -m 755 allxojpanels $RPM_BUILD_ROOT%{_bindir}

# Install startup script
#install -m 755 hpoj.startup $RPM_BUILD_ROOT%{_initrddir}/hpoj
#mv %{buildroot}%{_sbindir}/ptal-init %{buildroot}%{_initrddir}/hpoj
ln -sf %{_sbindir}/ptal-init %{buildroot}%{_initrddir}/hpoj

# Directories where the daemon will create device nodes
install -d %{buildroot}/dev/ptal-mlcd
install -d %{buildroot}/dev/ptal-printd

# Backend filter for CUPS
install -d %{buildroot}%{_libdir}/cups/backend
ln -sf %{_sbindir}/ptal-cups %{buildroot}%{_libdir}/cups/backend/ptal

# Make SANE scanner driver modules available in the right place (SANE
# only finds them in /usr/lib/sane, not in /usr/lib
%if %{sane_backend}
install -d %{buildroot}%{_libdir}/sane
(cd %{buildroot}%{_libdir}/sane/ && ln -sf ../libsane-* .)
%endif

##### PRE/POST INSTALL SCRIPTS #####

%post
# Let HPOJ daemon be automatically started at boot time
%_post_service hpoj

%post -n libptal0
/sbin/ldconfig

%post -n libhpojip0
/sbin/ldconfig

%if %{sane_backend}
%post -n libsane-hpoj0
/sbin/ldconfig
# Add HPOJ driver to /etc/sane.d/dll.conf
if ! grep ^hpoj /etc/sane.d/dll.conf >/dev/null 2>/dev/null ; then \
	echo hpoj >> /etc/sane.d/dll.conf; \
fi
%endif

%post -n xojpanel
# menu
%{update_menus}

%preun
# Let HPOJ daemon not be automatically started at boot time any more
%_preun_service hpoj

%if %{sane_backend}
%preun -n libsane-hpoj0
# Remove HPOJ driver from /etc/sane.d/dll.conf
if [ "$1" = 0 ]; then \
	if grep ^hpoj /etc/sane.d/dll.conf >/dev/null 2>/dev/null ; then \
		sed '/hpoj/d' /etc/sane.d/dll.conf > /tmp/$$; \
		cp -f /tmp/$$ /etc/sane.d/dll.conf; \
		rm -f /tmp/$$; \
	fi; \
fi
%endif

%postun -n libptal0
/sbin/ldconfig

%postun -n libhpojip0
/sbin/ldconfig

%if %{sane_backend}
%postun -n libsane-hpoj0
/sbin/ldconfig
%endif

%postun -n xojpanel
## menu
%{update_menus}

##### CLEAN UP #####

%clean
rm -rf $RPM_BUILD_ROOT


##### FILE LISTS FOR ALL BINARY PACKAGES #####

##### hpoj
%files
%defattr(-,root,root)
#config(noreplace) %{_sysconfdir}/ptal*
%config(noreplace) %{_initrddir}/*
%{_sbindir}/*
%{_bindir}/ptal*
%{_bindir}/hpojip-test
%doc %{_defaultdocdir}/%{name}-%{version}
%dir /dev/ptal-mlcd
%dir /dev/ptal-printd
# CUPS backend
%{_libdir}/cups/backend/ptal

##### libptal0
%files -n libptal0
%defattr(-,root,root)
%{_libdir}/libptal*.so.*

##### libptal0-devel
%files -n libptal0-devel
%defattr(-,root,root)
%{_includedir}/ptal*
%{_libdir}/libptal*.so

##### libhpojip0
%files -n libhpojip0
%defattr(-,root,root)
%{_libdir}/libhpojip*.so.*

##### libhpojip0-devel
%files -n libhpojip0-devel
%defattr(-,root,root)
%{_includedir}/hpojip*
%{_libdir}/libhpojip*.so

##### libsane-hpoj0
%if %{sane_backend}
%files -n libsane-hpoj0
%defattr(-,root,root)
%{_libdir}/libsane-hpoj*.so*
%{_libdir}/sane/libsane-hpoj*.so*
%endif

##### xojpanel
%files -n xojpanel
%defattr(-,root,root)
%{_bindir}/xojpanel
%{_bindir}/allxojpanels
# menu entry
%{_iconsdir}/locolor/16x16/apps/*
%{_menudir}/*


##### CHANGELOG #####

%changelog
* Tue Nov 26 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 0.90-4mdk
- Fix build

* Sat Aug 10 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-3mdk
- Rebuilt with gcc-3.2-0.3mdk.

* Sat Aug 10 2002 Pixel <pixel@mandrakesoft.com> 0.90-2mdk
- fix glob with spaces to please perl-base (especially for DrakX)

* Thu Aug  8 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-1mdk
- Updated to HPOJ 0.9 final.

* Wed Aug  7 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-0.12mdk
- BuildRequires: libopenssl-devel

* Wed Aug  7 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-0.11mdk
- The "xojpanel" package conflicts with older "hpoj" package versions, added
  appropriate "Conflicts:" entry.

* Mon Aug  5 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-0.10mdk
- Updated to current CVS (lock file name fix and documentation fixes).

* Mon Jul 29 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 0.90-0.9mdk
- Patch4: lib64 fixes in libraries lookup
- Let it build without SANE circularae dependency

* Sat Jul 27 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-0.8mdk
- Updated to current CVS (Fixed xscanimage segfaulting when clicking
  on the preview area).

* Wed Jul 24 2002 Till Kamppeter <till@mandrakesoft.com> 0.90-0.7mdk
- Updated to current CVS (2nd release candidate for HPOJ 0.90).
- Corrected version number to 0.90.

* Mon Jul 22 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.6mdk
- Updated to current CVS (1st release candidate for HPOJ 0.90).

* Thu Jun 27 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.5mdk
- Updated to current CVS (last CVS broke printing after one or two 
  printouts).

* Mon Jun 24 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.4mdk
- Moved menu updating in %%post and %%postun from main package to "xojpanel"
  sub package.

* Mon Jun 24 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.3mdk
- Updated to current CVS.
- Separated off the xojpanel, so that the main package can easily be
  installed on an X-less server.

* Tue Jun 18 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.2mdk
- Updated to current CVS
- Fixed setup for scanning (set links to scanner driver libraries, entry
  in /etc/sane.d/dll.conf)
- "ptal" backend for CUPS is in this package now
- Added "BuildRequires" line.

* Tue May 28 2002 Till Kamppeter <till@mandrakesoft.com> 0.9-0.1mdk
- Corrected path to QT 3 to make "xojpanel" getting compiled.
- Updated "allxojpanels" script.
- Bumped version number to 0.9.

* Tue May 28 2002 Till Kamppeter <till@mandrakesoft.com> 0.8-8mdk
- Updated to current CVS, version 0.8 is not compatible to gcc 3.1.
- Rebuilt for new libstdc++ and gcc 3.1.

* Sat Mar  2 2002 Till Kamppeter <till@mandrakesoft.com> 0.8-7mdk
- Fixed menu entry for "xojpanel", now a wrapper script searches for
  configured devices and starts "xojpanel" for these devices. 

* Fri Mar  1 2002 Till Kamppeter <till@mandrakesoft.com> 0.8-6mdk
- Patches for known problems from http://hpoj.sourceforge.net/todo.shtml
  (Patch2, Patch3)

* Wed Oct 24 2001 Vincent Saugey <vince@mandrakesoft.com> 0.8-5mdk
- Replace ucd-snmp require by libsnmp0

* Mon Oct 22 2001 Till Kamppeter <till@mandrakesoft.com> 0.8-4mdk
- Added patch to generate directories for the HPOJ daemons in the DevFS
  file system

* Sat Oct 20 2001 Stew Benedict <sbenedict@mandrakesoft.com> 0.8-3mdk
- patch for PPC build

* Wed Oct 10 2001 Till Kamppeter <till@mandrakesoft.com> 0.8-2mdk
- Rebuilt for libpng3.

* Wed Aug  8 2001 Till Kamppeter <till@mandrakesoft.com> 0.8-1mdk
- initial release