Sophie

Sophie

distrib > Mandriva > cs4.0 > i586 > by-pkgid > 009ce58b708ab8016266a689ae8f5634 > files > 2

foomatic-db-engine-3.0.2-1.20060711.1mlcs4.src.rpm

%define version 3.0.2
%define releasedate 20060711
%define release %mkrel 1.%{releasedate}.1

%define debug 0

##### RPM PROBLEM WORKAROUNDS

# Suppress automatically generated Requires for Perl libraries.
#define _requires_exceptions perl\(.*\)
  
#define _unpackaged_files_terminate_build       0 
#define _missing_doc_files_terminate_build      0

##### GENERAL DEFINITIONS

Name:		foomatic-db-engine
Version:	%{version}
Release:	%{release}
Summary:        Foomatic database access, printer admin, and printing utils
License:        GPL
Group:          System/Servers
Url:            http://www.linuxprinting.org/
Requires:       foomatic-filters >= 3.0.2-1.20050816.1mdk perl-base

BuildRequires:	autoconf2.5 automake cups
BuildRequires:	perl-devel, file, libxml2-devel

##### FOOMATIC SOURCES

Source:		http://www.linuxprinting.org/download/foomatic/foomatic-db-engine-%{version}-%{releasedate}.tar.bz2

##### BUILD ROOT

BuildRoot:	%_tmppath/%name-%version-%release-root

##### PACKAGE DESCRIPTIONS

%description
Foomatic is a comprehensive, spooler-independent database of printers,
printer drivers, and driver descriptions. It contains utilities to
generate PPD (Postscript Printer Description) files and printer queues
for CUPS, LPD, GNUlpr, LPRng, PPR, 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.

This package contains the tools for accessing the Foomatic database,
for printer administration, and for printing.




%prep
# remove old directory
rm -rf $RPM_BUILD_DIR/%{name}-%{version}-*

##### FOOMATIC

# Source trees for installation
%setup -q -n %{name}-%{version}-%{releasedate}
chmod -x *.c



%build

# Change compiler flags for debugging when in debug mode
%if %debug
export DONT_STRIP=1
export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
%endif


# Makefile generation ("./make_configure" for CVS snapshots)
./make_configure
%configure

# Fix for new library "make install" behaviour of Perl 5.8.1.
perl -p -i -e 's/PREFIX=\$\(DESTDIR\)\$\(PERLPREFIX\)/PREFIX=\$\(PERLPREFIX\)/' Makefile

# Final build of Foomatic package
# Use the real file names of the printing utilities to be independent of the
# update-alternatives configuration

# Do not use "make" macro, as parallelized build of Foomatic does not
# work.

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} \
        PERL_INSTALLDIRS=vendor \
        DESTDIR=%buildroot

chmod a+rx mkinstalldirs



%install

rm -rf %{buildroot}

# Change compiler flags for debugging when in debug mode
%if %debug
export DONT_STRIP=1
export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
%endif


# Make directories
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_libdir}
install -d %{buildroot}%{_sysconfdir}
install -d %{buildroot}%{_mandir}/man1
install -d %{buildroot}%{_mandir}/man8

##### FOOMATIC

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

# Install documentation
install -d %buildroot%{_docdir}/foomatic-db-engine-%{version}
cp README USAGE TODO ChangeLog Foomatic-Devel-Ideas.txt\
	%buildroot%{_docdir}/foomatic-db-engine-%{version}

# Use update-alternatives to make "foomatic-printjob" also possible through
# the usual printing commands
 
( cd %{buildroot}%{_bindir}
  ln -s foomatic-printjob lpr-foomatic
  ln -s foomatic-printjob lpq-foomatic
  ln -s foomatic-printjob lprm-foomatic
)
( cd %{buildroot}%{_sbindir}
  ln -s %{_bindir}/foomatic-printjob lpc-foomatic
)


# Correct permissions
chmod -R a+rX %{buildroot}%{_docdir}
chmod -R a-X %{buildroot}%{_docdir}/*/*
chmod -R go-w %{buildroot}%{_docdir}
chmod -R u+w %{buildroot}%{_docdir}
chmod -R a-X %{buildroot}%{perl_vendorlib}/Foomatic/*.pm



##### FILES

%files
%defattr(-,root,root)
%docdir %{_docdir}/%{name}-%{version}
%{_docdir}/%{name}-%{version}
%_bindir/*
%_sbindir/*
%perl_vendorlib/Foomatic
%_datadir/foomatic/templates
%{_mandir}/man*/*
%{_prefix}/lib/cups/driver/*



%post -n foomatic-db-engine
# 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 -n foomatic-db-engine
if [ "$1" -eq "0" ]; then
  # On removal
  # 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


%clean
rm -rf %{buildroot}

%changelog
* Tue Jul 11 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060711.1mdv2007.0
- Updated foomatic-db-engine to the state of the 11/07/2006 (When reading PPD
  files decode the UI strings according to the encoding of the PPD file. This
  way printerdrake displays the option and choice names always correctly,
  thanks to Florian Festi from Red Hat for this patch).

* Mon May 22 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060522.2mdk
- Updated foomatic-db-engine to the state of the 22/05/2006 (Fixed call of 
  CUPS commands "enable", "disable", "accept", "reject").

* Mon May 22 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060522.1mdk
- Updated foomatic-db-engine to the state of the 22/05/2006 (When generating
  PPD files from Foomatic XML data and the option XML files contain
  "<arg_order>" tags with different values, the options get ordered by the 
  "<arg_order>" values within their group).

* Fri May 19 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060519.1mdk
- Updated foomatic-db-engine to the state of the 19/05/2006 (Let PPD file
  generation with cups-driverd also work if the driver name contains dashes,
  as in Gutenprint).

* Tue May  2 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060422.2mdk
- Added "BuildRequires: cups" to assure that CUPS PPD generator
  (/usr/lib/cups/driver/foomatic) gets installed.

* Sat Apr 22 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060422.1mdk
- Updated foomatic-db-engine to the state of the 22/04/2006 (Let more
  info be queried from /etc/cups/printers.conf, especially setting for
  sharing the print queues and for the error policy).

* Fri Apr 21 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060421.1mdk
- Updated foomatic-db-engine to the state of the 21/04/2006 (Eliminated
  some warnings, let foomatic-configure not set up an HPLIP fax queue
  with the beh backend wrapper).

* Thu Apr 20 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060420.2mdk
- Moved CUPS binary directory from /usr/lib64/cups to /usr/lib/cups on 
  64-bit systems.

* Tue Feb 28 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060420.1mdk
- Updated foomatic-db-engine to the state of the 20/04/2006 (Support
  on-the-fly building of PPDs with the cups-driverd of CUPS 1.2, so all
  Foomatic PPDs get visible in the web interface without pre-building 
  them).

* Tue Feb 28 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060228.1mdk
- Updated foomatic-db-engine to the state of the 28/02/2006 (Treat a 
  missing /etc/cups/printers.conf as an empty file because CUPS 1.2 allows 
  printers.conf missing in case of no local printers. Suppress warnings if 
  the list of available CUPS queues is requested but no default printer
  set).

* Fri Feb 17 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060217.1mdk
- Updated foomatic-db-engine to the state of the 17/02/2006 (Do not try 
  to delete the "." file in the driver-XML-file directory; Generate PPD 
  files correctly where an enumerated-choice option has "0" as default;
  thanks to Tim Waugh from Red Hat for these fixes).

* Mon Jan  9 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060109.2mdk
- Updated foomatic-db-engine to the state of the 09/01/2006 (Let PPD files 
  with "*CloseGroup" without group name being parsed correctly, eliminate
  warning about uninitialized variable when a PPD file is built out of
  Foomatic data).
- Updated perl-base dependency version number.

* Mon Jan  9 2006 Till Kamppeter <till@mandriva.com> 3.0.2-1.20060109.1mdk
- Updated foomatic-db-engine to the state of the 09/01/2006 (Fixed
  foomatic-cleandb to really remove all driver XML files without command
  line prototype, updated to work with current aclocal and autoconf).
- Introduced %%mkrel.
- Rebuilt for CUPS 1.2.

* Wed Oct 26 2005 Till Kamppeter <till@mandriva.com> 3.0.2-1.20051027.1mdk
- Updated foomatic-db-engine to the state of the 27/10/2005
  (foomatic-configure, foomatic-ppdfile, and foomatic-compiledb use ready-
  made PPD files if they are available in foomatic-db).

* Tue Aug 23 2005 Till Kamppeter <till@mandriva.com> 3.0.2-1.20050823.1mdk
- Updated foomatic-db-engine to the state of the 23/08/2005 (Output of
  "foomatic-configure -O" now also contains the links to the available
  ready-made PPDs).

* Mon Aug 15 2005 Till Kamppeter <till@mandriva.com> 3.0.2-1.20050816.1mdk
- Updated foomatic-db-engine to the state of the 16/08/2005 (Support for
  the new "beh" CUPS backend in foomatic-filters).

* Tue Aug  2 2005 Till Kamppeter <till@mandriva.com> 3.0.2-1.20050802.1mdk
- Updated foomatic-db-engine to the state of the 02/08/2005 (Fixed Adobe
  link in README file).

* Sun May 29 2005 Till Kamppeter <till@mandrakesoft.com> 3.0.2-1.20050530.1mdk
- Updated foomatic-db-engine to the state of the 30/05/2005 (Added support
  for PPD file names with spaces, bug 16172).

* Thu May 19 2005 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 3.0.2-1.20050224.5mdk
- Don't require a specific version of perl-base, to make upgrades possible

* Wed Feb 23 2005 Till Kamppeter <till@mandrakesoft.com> 3.0.2-1.20050224.4mdk
- Rebuild as previous build was messed up.

* Wed Feb 23 2005 Till Kamppeter <till@mandrakesoft.com> 3.0.2-1.20050224.3mdk
- Updated foomatic-db-engine to the state of the 28/01/2005 (Bug fixes on
  modifying print queues with non-Foomatic PPD files).

* Tue Feb  1 2005 Till Kamppeter <till@mandrakesoft.com> 3.0.2-1.20050128.3mdk
- Added versioned requirement of perl-base.

* Fri Jan 28 2005 Till Kamppeter <till@mandrakesoft.com> 3.0.2-1.20050128.2mdk
- Let previous build directory be deleted when building this RPM.
- Include "foomatic-cleanupdrivers".

* Fri Jan 28 2005 Till Kamppeter <till@mandrakesoft.com> 3.0.2-1.20050128.1mdk
- Updated foomatic-db-engine to the state of the 28/01/2005.