[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#90664: How's the foomatic package for Debian going?





Grant Taylor wrote:

It may be instructive to look at the RPM spec [ Till, please send him
your spec, it doesn't seem to be in CVS ].



attached. The file is somewhat older, but it should work. Now there is a huge spec file which also builds GhostScript, GIMP-Print and other things, to make GIMP-Print maintaining easier.

Turn pre-compiling off in the spec file, because with the C accelerator it is a waste of disk space to pre-compile the combo XMLs.


Oh - you get 100 bonus points if you can make the various spoolers in
Debian automagically convert configurations when you switch spoolers.
Foomatic has all that logic now, thanks to Till...


Ses the section about copying printer queues in the USAGE file.

   Till
%define precompilefoomaticdb 0

Summary:	Foomatic printer database
Name:		foomatic
Version:	1.1
Release:	0.20010803mdk
License:	GPL
Group:		System/Servers

Source:		http://www.linuxprinting.org/foomatic-20010801.tar.bz2
Source1:        http://gimp-print.sourceforge.net/print-4.1.99cvs.tar.bz2
Source2:	foomatic-printermap.bz2

Url:		http://www.linuxprinting.org
BuildRequires:	perl-devel
BuildRoot:	%_tmppath/%name-%version-%release-root
Requires:	perl-Storable >= 0.6.11, perl-DateManip >= 5.39, perl-libxml-enno >= 1.02, perl-libxml-perl >= 0.07, perl-Parse-Yapp >= 1.04, perl-XML-Dumper >= 0.4, perl-XML-Encoding >= 1.01, perl-XML-Parser >= 2.29, perl-XML-Twig >= 2.02 perl-XML-Grove mpage nc ghostscript
Obsoletes:	rhs-printfilters
BuildArchitectures: noarch

%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 in this database.

%prep

# Source tree for installation
%setup -q -n foomatic
# GIMP-Print 
%setup -q -T -D -a 1 -n foomatic
# GIMP-Print Bugfix: HP DeskJet 820C (PPA winprinter) was listed as
# supported by GIMP-Print
bzcat %{SOURCE2} > print-4.1.99/src/foomatic/foomatic-printermap

# Delete drivers which are not on the distro (obsolete drivers which are
# replaced by a new driver with a different name)
# "stp" replaced by "gimp-print"
rm -f db/source/driver/stp.xml
# "cZ11" replaced by "cZ11somsom"
rm -f db/source/driver/cZ11.xml
# "hpdj" replaced by "pcl3"
rm -f db/source/driver/hpdj.xml
# "lxm3200[mcp]" replaced by "lxm3200"
rm -f db/source/driver/lxm3200[mcp].xml
# Delete drivers with empty command line prototype, they would give
# unusable printer/driver combos.
./foomatic-cleanupdrivers .

# Copy of Foomatic for doing the precompilation of the Foomatic database
mkdir .foomatic-db-precompile
cp -ax * .foomatic-db-precompile
mv .foomatic-db-precompile foomatic-db-precompile

%build

# Use the real file names of the printing utilities to be independent of the
# update-alternatives configuration
make    LPD_LPR=/usr/bin/lpr-lpd \
	LPD_LPQ=/usr/bin/lpq-lpd \
	LPD_LPRM=/usr/bin/lprm-lpd \
	LPD_LPC=/usr/sbin/lpc-lpd \
	CUPS_LPR=/usr/bin/lpr-cups \
	CUPS_LPQ=/usr/bin/lpq-cups \
	CUPS_LPRM=/usr/bin/lprm-cups \
	CUPS_LPC=/usr/sbin/lpc-cups \
	CUPS_LP=/usr/bin/lp-cups \
	CUPS_CANCEL=/usr/bin/cancel-cups \
	CUPS_LPSTAT=/usr/bin/lpstat-cups \
	PDQ_PRINTRC=/etc/pdq/printrc \
	PREFIX=%{_prefix} \
	INSTALLPREFIX=%buildroot

cd print-4.1.99
./autogen.sh --with-foomatic --without-gimp
%make
# We must already install here, to get the GIMP-Print Foomatic data
# to compile it into the database in the next step. This "make install"
# run will cause an error because Foomatic is not really installed, but
# the needed data is already generated at that point, so we ignore this
# error and let the package build go on (by "|| :")
%makeinstall || :
cd ..

# Add the GIMP-Print entries, determine the default drivers for the
# printers and then precompile the Foomatic databse
cd foomatic-db-precompile
make LIBDIR=. CACHEDIR=./db testing
./foomatic-kitload -k ../print-4.1.99/src/foomatic/foomatic-db
./foomatic-preferred-driver
rm -rf ./db/pcache/* ./db/compiled/*
%if %{precompilefoomaticdb}
time ./foomatic-compiledb -f -j 2
%endif
cd ..

# Put GIMP-Print data also into the main copy of the database
cp foomatic-db-precompile/db/source/driver/gimp-print*.xml db/source/driver/
cp foomatic-db-precompile/db/source/opt/gimp-print*.xml db/source/opt/
# Put the printer entries with default drivers into the main database
cp foomatic-db-precompile/db/source/printer/*.xml db/source/printer/


%install

rm -rf $RPM_BUILD_ROOT
eval `perl '-V:installsitelib'`
mkdir -p $RPM_BUILD_ROOT/$installsitelib
export INSTALLSITELIB=$RPM_BUILD_ROOT/$installsitelib
make	PREFIX=%{_prefix} \
	INSTALLPREFIX=%buildroot \
	INSTALLSITELIB=$RPM_BUILD_ROOT/$installsitelib \
	install
%if %{precompilefoomaticdb}
# Copy the precompiled database into the install tree
cd foomatic-db-precompile
mkdir -p %buildroot/var/cache/foomatic
cp -ax cache/* %buildroot/var/cache/foomatic
cd ..
%else
# These directories Foomatic generates automatically when the first 
# database element is compiled, but we include them to satisfy rpmlint
mkdir -p %buildroot/var/cache/foomatic/pcache
mkdir -p %buildroot/var/cache/foomatic/compiled
%endif

# Use update-alternatives to make "foomatic-printjob" also possible through
# the usual printing commands

( cd $RPM_BUILD_ROOT%{_bindir}
  ln -s foomatic-printjob lpr-foomatic
  ln -s foomatic-printjob lpq-foomatic
  ln -s foomatic-printjob lprm-foomatic
)
( cd $RPM_BUILD_ROOT%{_sbindir}
  ln -s %{_bindir}/foomatic-printjob lpc-foomatic
)

%clean
rm -fr %buildroot

%post

# Set up update-alternatives entries
%{_sbindir}/update-alternatives --install %{_bindir}/lpr lpr %{_bindir}/lpr-foomatic 1
%{_sbindir}/update-alternatives --install %{_bindir}/lpq lpq %{_bindir}/lpq-foomatic 1
%{_sbindir}/update-alternatives --install %{_bindir}/lprm lprm %{_bindir}/lprm-foomatic 1
%{_sbindir}/update-alternatives --install %{_sbindir}/lpc lpc %{_sbindir}/lpc-foomatic 1

%preun

if [ "$1" = 0 ]; then
  # Remove update-alternatives entries
  %{_sbindir}/update-alternatives --remove lpr /usr/bin/lpr-foomatic
  %{_sbindir}/update-alternatives --remove lpq /usr/bin/lpq-foomatic
  %{_sbindir}/update-alternatives --remove lprm /usr/bin/lprm-foomatic
  %{_sbindir}/update-alternatives --remove lpc /usr/sbin/lpc-foomatic
fi

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

%changelog
* Fri Aug  3 2001 Till Kamppeter <till@mandrakesoft.com> 1.1-0.20010803mdk
- Added missing "perl-XML-Grove" in "Requires:"

* Wed Aug  1 2001 Till Kamppeter <till@mandrakesoft.com> 1.1-0.20010801mdk
- Added new printers: Epson Stylus C20, C40, Epson Stylus Photo 785,
  875, 895, Epson Stylus Pro 10000, HP LaserJet 1200, 1220, 2200,
  3200m, 4100, 8150, 9000, HP Color LaserJet 4550.
- Added default (preferred) drivers for every printer.
- Removed driver entries with empty command line prototype.
- GIMP-Print updated from CVS (Default for "Paper Source" for laser printers
  fixed).
- Fixed bug of HP DeskJet 820C (PPA winprinter) being supported by 
  GIMP-Print.
- Removed support of the Canon BJC-5000 with the "bjc600" GhostScript
  driver. This does not work.

* Wed Jul 25 2001 Till Kamppeter <till@mandrakesoft.com> 1.1-0.20010725mdk
- Option are sorted in the dialogs of the frontends now,
- GIMP-Print Foomatic data added.

* Wed Jul 22 2001 Till Kamppeter <till@mandrakesoft.com> 1.1-0.20010721mdk
- Copying of queues, driver change, queue modification without loss of
  configuration settings and default option settings.
- Perl dumps of printer configuration including options and default settings
  possible.
- Pre-compilation of the printer database.

* Wed Jul 18 2001 Till Kamppeter <till@mandrakesoft.com> 1.1-0.20010718mdk
- Made it possible to call foomatic-printjob as "lpr", "lpc", "lpq",
  and "lprm" and it does the appropriate actions.
- Update alternatives stuff as with LPD/CUPS, so that one can also use
  "foomatic-printjob" through the usual printing commands.
- The default spooler can be saved now.

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

Reply to: