Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > main-src > by-pkgid > 1be9dd1ecfe276a2f9dfd3c7dd726a26 > files > 7

hpoj-0.8-7mdk.src.rpm


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

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


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

Source: http://hpoj.sourceforge.net/download/%{name}-%{version}.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

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

Url: http://hpoj.sourceforge.net
Requires: libptal0 libsnmp0
BuildRoot: %{_tmppath}/%{name}-buildroot

%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.



##### PREP #####

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

%ifarch ppc
%patch0 -p1
%endif

cd scripts
%patch1
cd ..
%patch2
%patch3
# 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

# Fox 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!share/doc/%{name}-%{version}!" $i
    perl -p -i -e "s!\\\$\(prefix\)/etc!/etc!" $i
done

%configure --with-qt=/usr/lib/qt2
# 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}/hpoj
?package(hpoj): 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 -s %{_initrddir}/hpoj %{buildroot}%{_sbindir}/ptal-init

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


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

%post
# Let HPOJ daemon be automatically started at boot time
%_post_service hpoj
# menu
%{update_menus}

%post -n libptal0
/sbin/ldconfig

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

%postun
## menu
%{update_menus}

%postun -n libptal0
/sbin/ldconfig

##### 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}/*
%doc %{_defaultdocdir}/%{name}-%{version}
%dir /dev/ptal-mlcd
%dir /dev/ptal-printd
# menu entry
%{_iconsdir}/locolor/16x16/apps/*
%{_libdir}/menu/*

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

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


##### CHANGELOG #####

%changelog
* 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