Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > media > main-src > by-pkgid > 2e3a44b116107a7de92b29bcceee58ea > files > 8

hplip-0.9.4-6mdk.src.rpm

# Define if you want to build the sane backend (default)
%define sane_backend		1
%{?_with_sane:			%global sane_backend 1}
%{?_without_sane:		%global sane_backend 0}

%define hpip_major		0
%define hpip_libname		%mklibname hpip %{hpip_major}

%define sane_hpaio_major		1
%define sane_hpaio_libname	%mklibname sane-hpaio %{sane_hpaio_major}

# Suppress automatically generated Requires for devel packages
%define _requires_exceptions devel\(.*\)

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

Summary:	HP printer/all-in-one driver infrastructure
Name:		hplip
Version:	0.9.4
Release:	6mdk
License:	GPL/MIT/BSD
Group:		System/Servers


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

Source: http://cesnet.dl.sourceforge.net/sourceforge/hpinkjet/%{name}-%{version}.tar.bz2
# Icon for the Mandrake menu
Source1: hplip.png.bz2

##### PATCHES #####

# Let SNMP stuff really getting built
#Patch0: hplip-0.8.8.patch.bz2

# Support for HP PSC 750xi
#Patch1: hplip-0.9-HP-PSC_950xi.patch.bz2

# Fix battery level check for HP DeskJet 450
#Patch2: hplip-0.9.1-HP-DeskJet_450-Battery.patch.bz2

# Some HP PhotoSmart 7150 identify themselves as "hp photosmart 7150~"
Patch3: hplip-0.9.4-HP-PhotoSmart_7150tilde.patch.bz2

# 64-bit fixes
# NOTE: knowingly overflowing as on 32-bit platforms under certain conditions
Patch4: hplip-0.9.4-64bit-fixes.patch.bz2

# Remove "su" from startup script
Patch5: hplip-0.9.4-startup-script.patch.bz2

# Let the HPLIP toolbox start the browser to access the web interface
# of a LAN printer in the background, so that one can still work in
# the toolbox while the browser is open.
Patch6: hplip-0.9.4-browser-launch.patch.bz2

# Fix full-bleed on Letter, A4 or bigger paper
Patch7: hplip-0.9.4-letter-a4-full-bleed.patch.bz2

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

Url:		http://hpinkjet.sourceforge.net/
%if %{sane_backend}
BuildRequires:	libsane-devel, xsane
%endif
BuildRequires:	cups-devel, python-devel
BuildRequires:	PyQt-devel >= 3.13-2mdk, sip-devel >= 4.1.1
BuildRequires:	net-snmp-devel
#BuildRequires:	libusb-devel
BuildRequires:  ImageMagick
BuildRequires:  autoconf2.5
#Conflicts: 	hpoj
Prereq:		rpm-helper
Requires:	foomatic-filters, cups, PyQt >= 3.13-2mdk, sip >= 4.1.1
Requires:	hplip-model-data
# Needed for communicating with ethernet-connected printers
Requires:	net-snmp-mibs
BuildRoot:	%{_tmppath}/%{name}-buildroot

%description

This is the HP driver package to supply Linux support for most
Hewlett-Packard DeskJet, LaserJet, PSC, OfficeJet, and PhotoSmart
printers and all-in-one peripherals (also known as Multi-Function
Peripherals or MFPs), which can print, scan, copy, fax, and/or access
flash memory cards.

It is work in progress, but printing, scanning, memory card access,
ink/toner/battery/consumable level checking, and inkjet printer
maintenance are supported on most models, when either connected to the
USB or LAN (built-in interfaces or selected HP JetDirect models) on a
Linux workstation with CUPS printing system.

For status and consumable checking and also for inkjet maintenance
there is the graphical tool "hp-toolbox" available (Menu:
"System"/"Monitoring"/"HP Printer Toolbox").



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

%package -n %{hpip_libname}
Summary: Dynamic library for the "hplip" HP printer/all-in-one drivers
Group: System/Servers

%description -n %{hpip_libname}
Library needed for the "hplip" HP printer/all-in-one drivers

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

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

%if %{sane_backend}
%package -n %{sane_hpaio_libname}
Summary: SANE driver for scanners in HP's multi-function devices (from HPLIP)
Group: System/Servers
Requires: sane-backends
%define _requires_exceptions devel(libcrypto)\\|devel(libdl)\\|devel(libhpip)\\|devel(libm)\\|devel(libsnmp)
%endif

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

%if 0
%if %{sane_backend}
%package -n %{sane_hpaio_libname}-devel
Summary: Headers and links to compile against the "%{sane_hpaio_libname}" ("sane-hpaio") library
Group: Development/C
Requires: %{sane_hpaio_libname} >= %{version}-%{release}
Provides: libsane-hpaio-devel = %{version}-%{release}
%endif

%if %{sane_backend}
%description -n %{sane_hpaio_libname}-devel
This package contains all files which one needs to compile programs using
the "%{sane_hpaio_libname}" library.
%endif
%endif

%package model-data
Summary: XML file listing the HP printer models supported by HPLIP
Group: System/Servers

%description model-data
HPLIP supports most current HP printers and multifunction devices, but
there are some older models not supported. This package contains the
list of supported models. Printerdrake installs it automatically to
determine whether HPLIP has to be installed or not.

%package hpijs
Summary: HPs printer driver IJS plug-in for GhostScript
Group: System/Servers
Requires: ghostscript
Provides: hpijs
Conflicts: printer-filters < 10.2

%description hpijs

HPs printer driver IJS plug-in for GhostScript. This driver gives full
printing support for nearly all non-PostScript inkjet and laser
printers made by HP.

%package hpijs-ppds
Summary: PPD files for the HPIJS printer driver
Group: System/Servers
Requires: foomatic-filters, hplip-hpijs

%description hpijs-ppds

PPD files to use the HPIJS printer driver with foomatic-rip and a
printer spooler like CUPS, LPRng, PDQ, ...



##### PREP #####

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

# Support for HP PSC 750xi
#patch1 -p0

# Fix battery level check for HP DeskJet 450
#patch2 -p0

# Some HP PhotoSmart 7150 identify themselves as "hp photosmart 7150~"
%patch3 -p0 -b .hpps7150

%patch4 -p1 -b .64bit-fixes

%patch5 -p0 -b .startup

%patch6 -p0 -b .browser

%patch7 -p0 -b .fullbleed

# Load menu icon
bzcat %{SOURCE1} > hplip.png

##### BUILD #####

%build
%serverbuild

#export CFLAGS="-g"
#export CXXFLAGS="-g"

autoconf-2.5x
%if !%{sane_backend}
WITHOUT_SANE="--without-sane"
%endif
#configure2_5x --enable-rpm-install $WITHOUT_SANE
%configure2_5x $WITHOUT_SANE

%make

# convert icons to required sizes
mv %{name}.png %{name}.mini.png
convert %{name}.mini.png -resize 32x32 %{name}.png
convert %{name}.mini.png -resize 48x48 %{name}.large.png

##### INSTALL #####

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_initrddir}
mkdir -p %{buildroot}%{_sysconfdir}/hp

# Let %{buildroot} also be used when C libraries for Perl are installed
#perl -p -i -e 's:(setup.py install):$1 --root=%{buildroot}:' Makefile */Makefile */*/Makefile

# Do not use the macro here, use the standard DESTDIR method as it works
# with HPLIP, in contrary to the non-standard Mandriva method
#make test-destdir DESTDIR=%{buildroot}
make install DESTDIR=%{buildroot}

# Enter directories in startup file
perl -p -i -e 's:HPIODDIR=:HPIODDIR=%{_sbindir}:' %{buildroot}%{_datadir}/%{name}/%{name}.sh
perl -p -i -e 's:HPSSDDIR=:HPSSDDIR=%{_datadir}/%{name}:' %{buildroot}%{_datadir}/%{name}/%{name}.sh

# Set priority in startup file for HPLIP to get started before CUPS
perl -p -i -e 's/chkconfig: 2345 50 10/chkconfig: 2345 14 61/' %{buildroot}%{_datadir}/%{name}/%{name}.sh


# Install configuration and startup files
mv %{buildroot}%{_datadir}/%{name}/%{name}.conf %{buildroot}%{_sysconfdir}/hp
mv %{buildroot}%{_datadir}/%{name}/%{name}.sh %{buildroot}%{_initrddir}/%{name}

# Install files which the "make install" missed to install
install -m 644 ip/hpip.h %{buildroot}%{_includedir}
install -m 644 ip/xform.h %{buildroot}%{_includedir}

# Comment out all "setSizePolicy" calls, this function is incompatible with
# current PyQT/SIP
#perl -p -i -e 's/^(.*setSizePolicy.*)$/\#$1/' `grep -l setSizePolicy %{buildroot}%{_datadir}/%{name}/ui/*.py`

# 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-* .)
%else
rm -rf %{buildroot}/%{_libdir}/libsane-hpaio.so.*
%endif

# Remove static libraries of SANE driver
rm -f %{buildroot}%{_libdir}/libsane-hpaio*.so
rm -f %{buildroot}%{_libdir}/libsane-hpaio*.a
rm -f %{buildroot}%{_libdir}/libsane-hpaio*.la
rm -f %{buildroot}%{_libdir}/sane/libsane-hpaio*.so
rm -f %{buildroot}%{_libdir}/sane/libsane-hpaio*.a
rm -f %{buildroot}%{_libdir}/sane/libsane-hpaio*.la

# Remove foomatic-rip, as Mandrakelinux already contains Foomatic
rm -f %{buildroot}%{_bindir}/foomatic-rip
rm -f %{buildroot}%{_prefix}/lib/cups/filter/foomatic-rip

# Remove other unneeded files
rm -f %{buildroot}%{_sysconfdir}/init.d/hplip
rm -f %{buildroot}%{_sysconfdir}/sane.d/dll.conf

# install menu icons
mkdir -p %{buildroot}%{_iconsdir}/locolor/16x16/apps/
install -m 644 %{name}.png -D %{buildroot}%{_iconsdir}/%{name}.png
install -m 644 %{name}.mini.png -D %{buildroot}%{_miconsdir}/%{name}.png
install -m 644 %{name}.large.png -D %{buildroot}%{_liconsdir}/%{name}.png

# install menu entry
mkdir -p %{buildroot}%{_menudir}

cat <<EOF > %{buildroot}%{_menudir}/hplip
?package(hplip): needs=X11 \
section=Applications/Monitoring \
title="HP Printer Toolbox" \
longtitle="Maintenance and monitoring utility for HP printers" \
command="%{_bindir}/hp-toolbox" \
icon="%{name}.png"
EOF

# Set link for easy access to the toolbox
#ln -s %{_datadir}/hplip/toolbox %{buildroot}%{_bindir}

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

%post
# Let HPLIP daemons be automatically started at boot time
%_post_service hplip
# Menu update
%{update_menus}

# Reload the library lists when installing shared libraries
%post -n %{hpip_libname} -p /sbin/ldconfig

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

%preun
# Let HPLIP daemons not be automatically started at boot time any more
%_preun_service hplip

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

%postun
## Menu update
%{update_menus}

# Reload the library lists when uninstalling shared libraries
%postun -n %{hpip_libname} -p /sbin/ldconfig

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


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

%clean
rm -rf %{buildroot}


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

##### hplip
%files
%defattr(-,root,root)
#doc %{_defaultdocdir}/%{name}-%{version}
%doc COPYING ChangeLog hplip_overview.png hplip_readme.html
%config(noreplace) %{_sysconfdir}/hp
%config(noreplace) %{_initrddir}/*
%{_sbindir}/hpiod
#{_bindir}/toolbox
%{_bindir}/hp-*
%{_datadir}/hplip/[A-Za-c_]*
%{_datadir}/hplip/data/[a-w_]*
%{_datadir}/hplip/[e-z]*
# C libraries for Python
%{_libdir}/python*/*/*.so*
# CUPS backend
%{_libdir}/cups/backend/hp
# menu entry
%{_iconsdir}/*.png
%{_iconsdir}/*/*.png
%{_menudir}/*

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

##### %{hpip_libname}-devel
%files -n %{hpip_libname}-devel
%defattr(-,root,root)
%{_includedir}/hpip.h
%{_includedir}/xform.h
%{_libdir}/libhpip*.so
#%{_libdir}/libhpip*.a
%{_libdir}/libhpip*.la

%if %{sane_backend}

##### %{sane_hpaio_libname}
%files -n %{sane_hpaio_libname}
%defattr(-,root,root)
%{_libdir}/libsane-hpaio*.so.*
%{_libdir}/sane/libsane-hpaio*.so.*

%if 0
##### %{sane_hpaio_libname}-devel
%files -n %{sane_hpaio_libname}-devel
%defattr(-,root,root)
#%{_libdir}/libsane-hpaio*.so
#%{_libdir}/libsane-hpaio*.a
#%{_libdir}/libsane-hpaio*.la
#%{_libdir}/sane/libsane-hpaio*.so
#%{_libdir}/sane/libsane-hpaio*.a
#%{_libdir}/sane/libsane-hpaio*.la
%endif

%endif

##### model-data
%files model-data
%defattr(-,root,root)
%{_datadir}/hplip/data/xml

##### hpijs
%files hpijs
%defattr(-,root,root)
%doc %{_defaultdocdir}/hpijs*
%{_bindir}/hpijs

##### hpijs-ppds
%files hpijs-ppds
%defattr(-,root,root)
%{_datadir}/ppd/HP/*
%{_datadir}/cups/model/foomatic-ppds


##### CHANGELOG #####

%changelog
* Fri Sep  9 2005 Till Kamppeter <till@mandriva.com> 0.9.4-6mdk
- Fixed full-bleed on Letter, A4 or bigger paper (patch 7).
- Let the HPLIP toolbox start the browser to access the web interface
  of a LAN printer in the background, so that one can still work in
  the toolbox while the browser is open (patch 6).

* Thu Sep  8 2005 Till Kamppeter <till@mandriva.com> 0.9.4-5mdk
- Removed "su" from statup script, it can break things in certain cases
  (patch 5).

* Wed Sep  7 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 0.9.4-4mdk
- 64-bit fixes

* Tue Aug 30 2005 Till Kamppeter <till@mandriva.com> 0.9.4-3mdk
- Updated package summary and description.

* Tue Aug 30 2005 Till Kamppeter <till@mandriva.com> 0.9.4-2mdk
- Some HP PhotoSmart 7150 identify themselves as "hp photosmart 7150~",
  applied patch 3 as workaround (bug 16514).

* Tue Jul 26 2005 Till Kamppeter <till@mandrakesoft.com> 0.9.4-1mdk
- Updated to version 0.9.3 (Added support for HP Color LaserJet 2800, HP 
  Photosmart 8200, HP Photosmart 330, HP Photosmart 380, Deskjet 1280, 
  Deskjet 3040, Deskjet 3920, tons of bug fixes: 4-edge full-bleed 
  printing on postcard-sized PhotoSmarts, 64-bit issues, unidirectional
  printing, info querying, added some older HP devices which work with
  HPIJS/HPLIP to the models.xml file, and more).

* Tue May 17 2005 Till Kamppeter <till@mandrakesoft.com> 0.9.3-1mdk
- Updated to version 0.9.3 (4-edge full-bleed on all paper sizes should 
  now work on all appropriate models!! Fixes for HP LaserJet 1010, 1012,
  1015, 1022, 4050, DeskJet 1220C, OfficeJet K80xi, V40, 7200, 7300, 7400,
  margin correction on many recent DeskJets, fixed errors on "hp-probe -s*"
  and on accessing photo cards when no card is inserted, many other fixes).

* Tue Apr 19 2005 Till Kamppeter <till@mandrakesoft.com> 0.9.2-1mdk
- Updated to version 0.9.2 (Again tons of bug fixes, especially
  toner level and LCD contents display for network laser, simplified
  architecture of the Toolbox, new "FastDraft Grayscale" printout
  quality setting).
- Removed patch 2 (merged upstream).
- Commenting out "setSizePolicy" not needed any more, fixed upstream.

* Mon Apr 11 2005 Till Kamppeter <till@mandrakesoft.com> 0.9.1-2mdk
- Let /usr/bin/hp-* links be generated so that HPLIP tools can be easily
  accessed.

* Mon Apr  4 2005 Till Kamppeter <till@mandrakesoft.com> 0.9.1-1mdk
- Updated to version 0.9.1 (Again tons of bug fixes, especially a possible
  fix for bugs 13675 and 14179, ink level and status display fixes for
  several models, lockup fix for HP DeskJet 450, fixed missing support
  for OfficeJet 5110, support for new printer models: HP LaserJet 4240,
  HP LaserJet 9040, hp color LaserJet 4610, HP LaserJet 1022, HP Business
  Inkjet 1000).
- Fixed battery level check for HP DeskJet 450 (patch 2, toolbox would
  make hpssd crashing when HP DeskJet 450 is connected and this patch
  not applied.

* Thu Mar 31 2005 Till Kamppeter <till@mandrakesoft.com> 0.9-2mdk
- Added support for HP PSC 750xi.

* Wed Mar 30 2005 Till Kamppeter <till@mandrakesoft.com> 0.9-1mdk
- Updated to version 0.9 (Tons of bug fixes, should fix bugs 14179, 13675, 
  and 13671; Support for HP LaserJet 1010, 1012, HP Color LaserJet 35xx;
  status and toner level reporting for laser printers).
- Commented out all "setSizePolicy" calls in the .py files, this function 
  is incompatible with current PyQT/SIP (bug 13315).
- Removed patch 0 (merged upstream).

* Mon Mar  7 2005 Till Kamppeter <till@mandrakesoft.com> 0.8.8-5mdk
- Rebuilt for SIP 4.2.1 and PyQt 3.14.

* Mon Feb 14 2005 Till Kamppeter <till@mandrakesoft.com> 0.8.8-4mdk
- Added "Requires: net-snmp-mibs", otherwise communicating with ethernet-
  connected printers does not work.

* Thu Feb 10 2005 Till Kamppeter <till@mandrakesoft.com> 0.8.8-3mdk
- Corrected shutdown priority in startup script to be after CUPS.

* Thu Feb 10 2005 Till Kamppeter <till@mandrakesoft.com> 0.8.8-2mdk
- Let SNMP stuff really getting built (patch0).
- Correct priority in startup script so that the daemons get started
  before CUPS.

* Wed Feb  9 2005 Till Kamppeter <till@mandrakesoft.com> 0.8.8-1mdk
- Updated to version 0.8.8.

* Mon Feb  7 2005 Till Kamppeter <till@mandrakesoft.com> 0.8.7-4mdk
- Put XML file with list of supported models into extra package, so that
  printerdrake can install only this and then determine whether to install
  HPLIP.

* Fri Feb  4 2005 Till Kamppeter <till@mandrakesoft.com> 0.8.7-3mdk
- Added "Provides: hpijs" to hplip-hpijs package.
- Versioned conflict for hplip-hpijs package:
  "Conflicts: printer-filters < 10.2".

* Tue Feb  1 2005 Till Kamppeter <till@mandrakesoft.com> 0.8.7-2mdk
- Rebuilt with dependency on sip 4.1.1 or newer. With older sip PyQt
  GUIs segfault.

* Fri Jan 21 2005 Till Kamppeter <till@mandrakesoft.com> 0.8.7-1mdk
- Initial Mandrakelinux release.