Blob Blame History Raw
Summary: Foomatic printer database.
Name:		foomatic
Version:	1.9
%define release_date 20020617
%define sub_release 5
Release: 1.%{release_date}.%{sub_release}
License:	GPL
Group: System Environment/Libraries

# Generated by:
# NOW=`date '+%Y%m%d'`
# cvs -d:pserver:anonymous@cvs.linuxprinting.org:/usr/local/cvs export -D $NOW foomatic
# tar cjf foomatic-1.9-$NOW.tar.bz2 foomatic
Source0: foomatic-%{version}-%{release_date}.tar.bz2

# Build Omni first to get this (you'll have to create the tarball by hand):
Source1: Omni-printers.tar.bz2

# The foomatic-db info from gimp-print-4.2.1 (--with-ijs --with-foomatic)
Source2: gimp-print.tar.bz2

# Script for generating cups-drivers package
Source3: gen-ppds

# Look in /usr/local/bin last, not first, in lpdomatic (bug #57915).
Patch0: foomatic-1.9-20020517-path.patch

# Allow libdir and bindir to be overridden.
Patch1: foomatic-1.9-20020517-libdir.patch

# Fix autodetect information for HPLJ2100/2100M.
Patch2: foomatic-1.9-20020617-67973.patch

Url:		http://www.linuxprinting.org
BuildRequires:	perl
Requires:	perl >= 5.6.1
BuildRoot:	%_tmppath/%name-%version-%release-root
Provides:	perl(Foomatic::GrovePath)
Requires:	perl-DateManip >= 5.39, perl-libxml-enno >= 1.02
Requires:	perl-libxml-perl >= 0.07, perl-Parse-Yapp >= 1.04, perl-XML-Dumper >= 0.4
Requires:	perl-XML-Encoding >= 1.01, perl-XML-Parser >= 2.29
# For 'rm' and '/sbin/service' in post
PreReq: fileutils initscripts
BuildRequires:	perl-DateManip >= 5.39, perl-libxml-enno >= 1.02
BuildRequires:	perl-libxml-perl >= 0.07, perl-Parse-Yapp >= 1.04, perl-XML-Dumper >= 0.4
BuildRequires:	perl-XML-Encoding >= 1.01, perl-XML-Parser >= 2.29, perl-XML-Twig >= 2.02
BuildRequires:	perl-XML-Grove, perl-libwww-perl
BuildRequires:  perl-URI

# We need ghostscript to have the gimp-print-4.2.0 driver, and hpijs 1.1.
Conflicts: ghostscript < 7.05

%description
Foomatic is a comprehensive, spooler-independent database of printers,
printer drivers, and driver descriptions. It contains utilities to
generate driver description files and printer queues for CUPS, LPD,
LPRng, and PDQ using the database. There is also the possibility to
read the PJL options out of PJL-capable laser printers and take them
into account at the driver description file generation.

There are spooler-independent command line interfaces to manipulate
queues (foomatic-configure) and to print files/manipulate jobs
(foomatic printjob).

The site http://www.linuxprinting.org/ is based on this database.

%package -n cups-drivers
Summary: Printer drivers for CUPS
Requires: cups >= 1.1.10-3
Requires: ghostscript
Prereq: /sbin/service
Group: System Environment/Daemons

%description -n cups-drivers
Printer drivers for the CUPS printing system

%package -n cups-drivers-pnm2ppa
Summary: CUPS drivers for PPA (HP-compatible GDI) printers
Requires: pnm2ppa
Requires: ghostscript
Prereq: /sbin/service
Group: System Environment/Daemons

%description -n cups-drivers-pnm2ppa
CUPS drivers for PPA (HP-compatible GDI) printers

%package -n cups-drivers-hpijs
Summary: CUPS drivers for HP printers using the optimized hpijs driver
Requires: hpijs >= 1.1
Requires: ghostscript >= 7.05
Prereq: /sbin/service
Group: System Environment/Daemons

%description -n cups-drivers-hpijs
CUPS drivers for HP printers using the optimized hpijs driver

%prep
%setup -q -n foomatic
%patch0 -p1 -b .path
%patch1 -p1 -b .libdir
%patch2 -p1 -b .67973

# Omni printers
tar xjf %{SOURCE1}

# Gimp-print-4.2.0 driver info
rm db/source/driver/stp.xml
( cd db/source; tar xjf %{SOURCE2} )

# Whenever the recommended driver is gimp-print-ijs, change it to
# gimp-print (this is already done upstream).
perl -pi -e 's,<driver>gimp-print-ijs</driver>,<driver>gimp-print</driver>,' \
	db/source/printer/*.xml

./make_configure

%build
%configure
make PREFIX=%{_prefix} INSTALLPREFIX=%buildroot CFLAGS="$RPM_OPT_FLAGS"

%install
rm -rf $RPM_BUILD_ROOT

eval `perl '-V:installsitelib'`
mkdir -p $RPM_BUILD_ROOT/$installsitelib
export INSTALLSITELIB=$RPM_BUILD_ROOT/$installsitelib
make	DESTDIR=%buildroot PREFIX=%{_prefix} \
	INSTALLPREFIX=%buildroot \
	INSTALLSITELIB=$RPM_BUILD_ROOT/$installsitelib \
	install

# Remove drivers with no command line.
./foomatic-cleanupdrivers $RPM_BUILD_ROOT/usr/share/foomatic

# Install printers from the Omni project, if there isn't already an entry
cd Omni-printers;
P_DIR=$RPM_BUILD_ROOT/usr/share/foomatic/db/source/printer
for P in *.xml; do
       if [ ! -f $P_DIR/$P ]; then
               cp $P $P_DIR;
       fi;
done;
cd ..

# Remove ghostscript UPP drivers that are gone in 7.05
rm -f %{buildroot}%{_datadir}/foomatic/db/source/driver/{bj8pa06n,bjc6000a1,PM760p,PM820p,s400a1,sharp,Stc670pl,Stc670p,Stc680p,Stc760p,Stc777p,Stp720p,Stp870p}.upp.xml

mkdir -p $RPM_BUILD_ROOT/var/cache/foomatic/{pcache,compiled}

# cups-drivers packages
mkdir -p $RPM_BUILD_DIR/%{name}/foomatic-cache
export FOOMATIC_CACHEDIR="$RPM_BUILD_DIR/%{name}/foomatic-cache"
export FOOMATIC_LIBDIR="%{buildroot}/%{_datadir}/foomatic"
export FOOMATIC_BINDIR="%{buildroot}/%{_bindir}"
export FOOMATIC_SBINDIR="%{buildroot}/%{_sbindir}"
export FOOMATIC_PERLINC="%{buildroot}/$installsitelib"
%{SOURCE3} "$RPM_BUILD_ROOT/%{_datadir}/cups/model/foomatic" \
	"$RPM_BUILD_DIR/%{name}"
perl -pi -e "s,^$RPM_BUILD_ROOT,,g" $RPM_BUILD_DIR/%{name}/filelist.*
perl -pi -e "s,^%dir $RPM_BUILD_ROOT,%dir ,g" $RPM_BUILD_DIR/%{name}/filelist.*

%post
# zap the cache
rm -rf /var/cache/foomatic/pcache/* /var/cache/foomatic/compiled/*

# Try to rebuild the printconf data
if [ -x /usr/sbin/printconf-backend ] ; then
   /usr/sbin/printconf-backend --force-rebuild > /dev/null 2> /dev/null
fi

# restart the print server if it is running now
if /sbin/service lpd status >/dev/null 2>&1 ; then
   /sbin/service lpd restart >/dev/null 2>&1
fi

exit 0

%clean
rm -fr %buildroot $RPM_BUILD_DIR/%{name}

%files
%defattr(-,root,root)
%doc README USAGE ChangeLog
%{_bindir}/*
%{_sbindir}/*
%{_libdir}/perl5/site_perl/*/Foomatic
%dir %{_libdir}/cups
%{_libdir}/cups/*
%dir /var/cache/foomatic
%{_datadir}/foomatic
%{_mandir}/*/*

%files -n cups-drivers -f filelist.main
%defattr(-,root,root)

%post -n cups-drivers
/sbin/service cups condrestart >/dev/null 2>&1 || :

%postun -n cups-drivers
/sbin/service cups condrestart >/dev/null 2>&1 || :

%files -n cups-drivers-pnm2ppa -f filelist.pnm2ppa

%post -n cups-drivers-pnm2ppa
/sbin/service cups condrestart >/dev/null 2>&1 || :

%postun -n cups-drivers-pnm2ppa
/sbin/service cups condrestart >/dev/null 2>&1 || :

%files -n cups-drivers-hpijs -f filelist.hpijs

%post -n cups-drivers-hpijs
/sbin/service cups condrestart >/dev/null 2>&1 || :

%postun -n cups-drivers-hpijs
/sbin/service cups condrestart >/dev/null 2>&1 || :

%changelog
* Thu Aug  8 2002 Tim Waugh <twaugh@redhat.com> 1.9-1.20020617.5
- For gimp-print, use the Ghostscript stp driver in preference to the
  IJS interface.

* Thu Jul 25 2002 Tim Waugh <twaugh@redhat.com> 1.9-1.20020617.4
- Quieten scriptlets.

* Fri Jul  5 2002 Tim Waugh <twaugh@redhat.com> 1.9-1.20020617.3
- Fix autodetect information for HPLJ2100/2100M.

* Fri Jun 21 2002 Tim Powers <timp@redhat.com> 1.9-1.20020617.2
- automated rebuild

* Wed Jun 19 2002 Tim Waugh <twaugh@redhat.com> 1.9-0.20020617.2
- Omni 0.7.0 printers.

* Mon Jun 17 2002 Tim Waugh <twaugh@redhat.com> 1.9-0.20020617.1
- Update to CVS.
- Remove some more explicit perl dependencies that are picked up
  automatically.

* Wed May 29 2002 Tim Waugh <twaugh@redhat.com> 1.9-0.20020517.3
- Remove explicit perl-Storable dependency; it should be perl(Storable),
  and that is picked up automatically.

* Tue May 28 2002 Tim Waugh <twaugh@redhat.com> 1.9-0.20020517.2
- Fix release number.
- Drop gen-ppds from the file manifest---use foomatic-compiledb instead
  (bug #63622).

* Sun May 26 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu May 23 2002 Tim Waugh <twaugh@redhat.com> 1.9-0.20020517.1
- Remove ghostscript UPP drivers that are gone in 7.05.

* Sat May 18 2002 Tim Waugh <twaugh@redhat.com> 1.9-0.20020517.0.1
- Update to CVS.
- Updated requirements.
- Updated path and libdir patches.
- Drop hpijs 1.0.2 patch.
- foomatic-datafile has moved to %%{_bindir}.
- Update gimp-print data to 4.2.1.
- Update Omni printer data to 0.6.1.

* Thu Apr  4 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020313.3
- Fix the hpijs option data too (bug #62587).

* Wed Apr  3 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020313.2
- Back off to 1.0.2 for hpijs driver data (bug #62587).

* Thu Mar 14 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020313.1
- Update to CVS.

* Wed Mar  6 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020306.1
- Update to CVS.
- Patches no longer needed: conffile, sys, cachedir, fd0.
- Adapted path patch.

* Tue Mar  5 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020130.10
- Fix bug #58319.
- Drop dbg patch.

* Mon Feb 25 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020130.9
- Fix file lists.

* Mon Feb 25 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020130.8
- Fix %post scriplet bug (bug #59942).

* Thu Feb 21 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020130.7
- Rebuild in new environment.

* Wed Feb 13 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020130.6
- Merge cups-drivers.  No epoch needed.
- Require perl-URI.

* Wed Feb 06 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020130.5
- Cache fix.

* Mon Feb  4 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020130.4
- Don't ship backup files.

* Mon Feb  4 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020130.3
- Rebuild to pick up new perl installsitelib.

* Thu Jan 31 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020130.2
- Fix a thinko in DB.pl.

* Wed Jan 30 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020130.1
- Update to CVS.
- No longer need the cachedir patch.
- Fix config file path.
- Look in /usr/local/bin last, not first, in lpdomatic (bug #57915).

* Tue Jan 29 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020129.1
- Update to CVS.
- Patches no longer needed: prepend, fd3.
- Use RPM_OPT_FLAGS.
- Allow non-root users to use foomatic-datafile (bug #58956).

* Sat Jan 26 2002 Jeff Johnson <jbj@redhat.com> 1.1-0.20020124.2
- added Provides: perl(Foomatic::GrovePath)

* Thu Jan 24 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20020124.1
- Update to CVS.
- Updated Omni printers to those in Omni 0.5.1.
- Updated patches: prepend, fd3.
- Patches no longer needed: utf8, lpdomatic.
- Added gimp-print (formerly stp) foomatic db info, and removed the old
  stp.xml file.
- Conflict with ghostscript if it doesn't have gimp-print-4.2.0 yet.

* Fri Jan 18 2002 Tim Waugh <twaugh@redhat.com> 1.1-0.20011218.2
- REALLY fix PCL fixup code (bug #55909, others).
- PreReq fileutils, initscripts (bug #56984).
- Fix prepends in lpdomatic (bug #57371).
- Run foomatic-cleanupdrivers during install, to remove driver entries
  with no command line.
- Put lpdomatic in /usr/sbin again.
- Fix foomatic-gswrapper's file descriptor manipulations (bug #56871).

* Mon Dec 17 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011218.1
- re-imported from upstream to fix some perl fixup code on pcl printers.

* Mon Dec 17 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011217.2
- fix the rest of the quoting issues with foomatic-combo-xml with the patch
- foomatic-1.1-20011217-quotes.patch. This has been sent upstream.

* Mon Dec 17 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011217.1
- respin to pull in latest foomatic database, fixes:
-	properly use the cache in relation to foomatic-combo-xml's output
-	fix _some_ of the quoting issues with calling foomatic-combo-xml

* Thu Dec  5 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011205.1
- respin to pull in latest foomatic database, fixes:
-	droping half of a large job
-	-Mutf8 added to the upstream filters
-	miscelaneous printer db updates

* Mon Nov 29 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011018.8
- added Requires: fileutils for the 'rm' in post

* Mon Nov 26 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011018.7
- /var/chache => /var/cache, doh!

* Fri Nov 16 2001 Nalin Dahyabhai <nalin@redhat.com> 1.1-0.20011018.6
- fix %%post scriptlet

* Tue Nov 13 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011018.5
- changed the patch to use the -Mutf8 command line option,
- and to restart the printserver, after rebuilding the settings.

* Fri Nov  9 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011018.4
- grumble. Some drivers use inline perl scripts, and need the 'use utf8;'
- pragma. Without it, they break on _some_ of their options.

* Wed Oct 31 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011018.3
- patched lpdomatic to prepend PostScript options in the _right_ place.

* Thu Oct 25 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011018.2
- zap the foomatic cache on install

* Thu Oct 18 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011018.1
- rolled to pull in latest information.
- added Omni printers to the printer list.

* Fri Oct 05 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011005.1
- rolled to pull in an ia64 fix to foomatic-combo-xml.c

* Mon Oct 01 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20011001.1
- rolled to pull in foomatic fixes to foomatic-combo-xml.c

* Wed Sep 05 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20010905.1
- upgraded to latest foomatic, we now have fast overview generation!
- this means that there is no prebuilt overview file.

* Tue Aug 28 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20010828.1
- WOW! The latest foomatic uses Till Kamppeter's C based combo compiler.
- It is now fast enough that there is no real benifit to precompiling.
- NOTE: this forces the package to stop being noarched.

* Mon Aug 27 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20010827.1
- fresh pull, maybe it fixes the build errors.

* Sat Aug 25 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20010825.1
- did a fresh database pull, which contains the old japanese printers as well.
- removed japanese hack.

* Tue Aug 14 2001 Akira TAGOH <tagoh@redhat.com> 1.1-0.20010717.5
- Add Japanese printer entry.

* Mon Aug  6 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20010717.4
- move the cache back to /var, sigh.

* Mon Jul 23 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20010717.2
- made foomatic pre-compute its db

* Thu Jul 18 2001 Crutcher Dunnavant <crutcher@redhat.com> 1.1-0.20010717.1
- imported from mandrake.

* Tue Jul 17 2001 Till Kamppeter <till@mandrakesoft.com> 1.1-0.20010717mdk
- Added job listing/removal/manipulation and queue control to
  foomatic-printjob
- Support for printing multiple copies with PDQ

* Fri Jul 14 2001 Till Kamppeter <till@mandrakesoft.com> 1.1-0.20010714mdk
- Included the cupsomatic filter script
- When a queue is set up, default options can be set now
- Help messages of foomatic-configure and foomatic-printjob cleaned up.

* Fri Jul 13 2001 Till Kamppeter <till@mandrakesoft.com> 1.1-0.20010713mdk
- Many bugfixes in "foomatic-printjob".
- "foomatic-configure" adds the Foomatic config file directory automatically
  to the search paths of PDQ.
- Printing a help page under PDQ was broken.

* Thu Jul 12 2001 Stefan van der Eijk <stefan@eijk.nu> 1.1-0.20010712mdk
- BuildRequires:	perl-devel

* Wed Jul 11 2001 Till Kamppeter <till@mandrakesoft.com> 1.1-0.20010711mdk
- initial release.
- Deleted the obsolete drivers "stp", "cZ11", and "hpdj".
- Patch applied which flushes the memory cache regularly, otherwise
  foomatic-configure would hang when the Foomatic data of GIMP-Print is
  installed.