Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > media > main-src > by-pkgid > a95424fd0a22c92a0029b3ae94315305 > files > 9

postscript-ppds-2006-1mdk.src.rpm

%define version 2006
%define release 1mdk

##### 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


Summary: PPD files for PostScript printers
Name:		postscript-ppds
Version:	%{version}
Release:	%{release}
License:	MIT
Group:		Publishing
URL:		http://www.linuxprinting.org/download/PPD/
BuildRequires:	cups-common
Requires:	foomatic-filters >= 3.0.2-1.20050802.1mdk ghostscript
BuildArchitectures: noarch

##### SOURCES

# CUPS-Drivers package from Sourceforge, only PPD files for native 
# PostScript printers used
Source200: 	ftp://cups.sourceforge.net/pub/cups/cups-drivers/0.3.6/cups-drivers-all-0.3.6.tar.bz2
# Perl script to clean up Manufacturer entries in the PPD files, so that
# drivers are sorted by the printer manufacturer in the graphical frontends
Source201: 	cleanppd.pl.bz2
# HP's PPD files for the PostScript LaserJets
Source202:	http://www.linuxprinting.org/download/PPD/HP/hp-ppd-20050803.tar.bz2
# Kyocera's PPD files for their PostScript printers
# (Same files as english files in http://www.linuxprinting.org/download/PPD/Kyocera/packages/CUPS%20PPD%202004-04.zip)
Source204:	http://www.linuxprinting.org/download/PPD/Kyocera/kyocera-ppd-20050401.tar.bz2
# Epson's PPD files for their PostScript printers
Source208:	http://www.linuxprinting.org/download/PPD/Epson/epson-ppd-20050803.tar.bz2
# OCE's PPD files for their PostScript printers
Source209:	http://www.linuxprinting.org/download/PPD/OCE/oce-ppd-20050803.tar.bz2
# Okidata's PPD files for their PostScript printers
Source211:	http://www.linuxprinting.org/download/PPD/Okidata/okidata-ppd-20040609.tar.bz2
# Ricoh's PPD files for their PostScript printers
Source212:	http://www.linuxprinting.org/download/PPD/ricoh-ppd-20050803.tar.bz2

# Sharp's PPD files for their PostScript printers
Source213:	http://www.linuxprinting.org/download/PPD/sharp-ppd-20050304.tar.bz2

# PPD file for a generic PostScript printer (taken from KUPS)
Source203: 	postscript.ppd.bz2

##### PATCHES

# Fix buggy PPD file
Patch200: cups-drivers-hplj5m_4.ppd.patch.bz2



##### BUILD ROOT

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



##### PACKAGE DESCRIPTION

%description

This package contains PPD files for native PostScript printers
released as free software by their manufacturers. Setting up print
queues with CUPS or foomatic-rip and these PPD files makes all
features of the printer available, therefore its use is highly
recommended. printerdrake will choose a manufacturer-supplied PPD file
automatically if one for your printer is found.



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

# PPD files for old PostScript printers
%setup -q -T -D -a 200 -n %{name}-%{version}

# Apply patch for buggy ppd file
%patch200 -p0

# Remove CUPS-O-MATIC PPDs
rm -rf cups-drivers-0.3.6/usr/share/cups/model/cups-o-matic

# Remove pstogstoraster-based PPD files, they do not work 
# when printing via Samba. There are other, better PPDs for 
# these printers.
rm -f cups-drivers-0.3.6/usr/share/cups/model/canon/bj10.ppd
rm -f cups-drivers-0.3.6/usr/share/cups/model/hp/djet_890c.ppd
rm -f cups-drivers-0.3.6/usr/share/cups/model/hp/laserjet_gs.ppd

# Remove CUPS PPD files, there are newer versions of them in the CUPS
# package
rm -f cups-drivers-0.3.6/usr/share/cups/model/hp/laserjet.ppd
rm -f cups-drivers-0.3.6/usr/share/cups/model/hp/deskjet.ppd

# HP's PPD files for the PostScript LaserJets
%setup -q -T -D -a 202 -n %{name}-%{version}

# Kyocera's PPD files for their PostScript printers
%setup -q -T -D -a 204 -n %{name}-%{version}

# Epson's PPD files for their PostScript printers
%setup -q -T -D -a 208 -n %{name}-%{version}

# OCE's PPD files for their PostScript printers
%setup -q -T -D -a 209 -n %{name}-%{version}

# Okidata's PPD files for their PostScript printers
%setup -q -T -D -a 211 -n %{name}-%{version}

# Ricoh's PPD files for their PostScript printers
%setup -q -T -D -a 212 -n %{name}-%{version}

# Sharp's PPD files for their PostScript printers
%setup -q -T -D -a 213 -n %{name}-%{version}



%build

# Nothing to build



%install

rm -rf $RPM_BUILD_ROOT

# Make directories
install -d $RPM_BUILD_ROOT%{_datadir}/cups/model

# Put the Sourceforge PPDs into CUPS PPD directory
cp -a cups-drivers-0.3.6/usr/share/cups/model/* $RPM_BUILD_ROOT%{_datadir}/cups/model/

# Install HP's PPD files
cp -a hp-ppd $RPM_BUILD_ROOT%{_datadir}/cups/model/HP-PostScript/

# Install Kyocera's PPD files
cp -a kyocera-ppd $RPM_BUILD_ROOT%{_datadir}/cups/model/Kyocera-PostScript/

# Install Epson's PPD files
cp -a epson-ppd $RPM_BUILD_ROOT%{_datadir}/cups/model/Epson-PostScript/

# Install OCE's PPD files
cp -a oce-ppd $RPM_BUILD_ROOT%{_datadir}/cups/model/OCE-PostScript/

# Install Okidata's PPD files
cp -a okidata-ppd $RPM_BUILD_ROOT%{_datadir}/cups/model/Okidata-PostScript/

# Install Ricoh's PPD files
cp -a ricoh-ppd/Gestetner $RPM_BUILD_ROOT%{_datadir}/cups/model/Gestetner-PostScript/
cp -a ricoh-ppd/Infotec $RPM_BUILD_ROOT%{_datadir}/cups/model/Infotec-PostScript/
cp -a ricoh-ppd/Lanier $RPM_BUILD_ROOT%{_datadir}/cups/model/Lanier-PostScript/
cp -a ricoh-ppd/NRG $RPM_BUILD_ROOT%{_datadir}/cups/model/NRG-PostScript/
cp -a ricoh-ppd/Ricoh $RPM_BUILD_ROOT%{_datadir}/cups/model/Ricoh-PostScript/
cp -a ricoh-ppd/Savin $RPM_BUILD_ROOT%{_datadir}/cups/model/Savin-PostScript/

# Install Sharp's PPD files
cp -a sharp-ppd $RPM_BUILD_ROOT%{_datadir}/cups/model/Sharp-PostScript/

# Install PPD file for a generic PostScript printer
bzcat %{SOURCE203} > $RPM_BUILD_ROOT%{_datadir}/cups/model/postscript.ppd

# Correct permissions of PPD file directory
chmod -R u+w,a+rX $RPM_BUILD_ROOT%{_datadir}/cups/model

# "cleanppd.pl" removes unwished PPD files (currently the ones for Birmy
# PowerRIP), fixes broken manufacturer entries, and cleans lines which
# contain only spaces and tabs.

# Uncompress Perl script for cleaning up the PPD files
bzcat %{SOURCE201} > ./cleanppd.pl
chmod a+rx ./cleanppd.pl
# Do the clean-up
find $RPM_BUILD_ROOT%{_datadir}/cups/model -name "*.ppd" -exec ./cleanppd.pl '{}' \;
# Remove PPDs which are not Adobe-compliant and therefore not working with
# CUPS 1.1.20
for ppd in `find $RPM_BUILD_ROOT%{_datadir}/cups/model -name "*.ppd.gz" -print`; do cupstestppd -q $ppd || (rm -f $ppd && echo "$ppd not Adobe-compliant. Deleted."); done



##### FILES

%files
%defattr(-,root,root)
%{_datadir}/cups/model/*



# Restart the CUPS daemon when it is running, but do not start it when it
# is not running. The restart of the CUPS daemon updates the CUPS-internal
# PPD index

%post
/sbin/service cups condrestart > /dev/null 2>/dev/null || :

%postun
/sbin/service cups condrestart > /dev/null 2>/dev/null || :



%clean
rm -rf $RPM_BUILD_ROOT



%changelog

* Wed Aug  3 2005 Till Kamppeter <till@mandriva.com> 2006-1mdk
- Updated the PPD files of HP, Epson, Oce, and Ricoh to the state of
  03/08/2005..
- Added "BuildRequires:	cups-common" to have "cupstestppd" available.

* Fri Apr  1 2005 Till Kamppeter <till@mandrakesoft.com> 10.2-1mdk
- Updated Kyocera's PPD file to the state of 01/04/2005.

* Fri Mar  4 2005 Till Kamppeter <till@mandrakesoft.com> 10.2-0.6mdk
- Added PostScript PPD files from Sharp.

* Fri Mar  4 2005 Till Kamppeter <till@mandrakesoft.com> 10.2-0.5mdk
- More 162 PostScript PPD files from Ricoh (brands: Gestetner, Infotec,
  Lanier, NRG, Ricoh, Savin).

* Tue Feb 22 2005 Till Kamppeter <till@mandrakesoft.com> 10.2-0.4mdk
- Added PostScript PPD files from Ricoh (brands: Gestetner, Infotec,
  Lanier, NRG, Ricoh, Savin).
- Updated HP's PPD file to the state of 22/02/2005.

* Mon Feb 22 2005 Till Kamppeter <till@mandrakesoft.com> 10.2-0.3mdk
- Updated HP's PPD file to the state of 21/02/2005.

* Fri Feb  4 2005 Till Kamppeter <till@mandrakesoft.com> 10.2-0.2mdk
- Removed unnecessary RPM workarounds.

* Fri Feb  4 2005 Till Kamppeter <till@mandrakesoft.com> 10.2-0.1mdk
- Introduced a separate package for PostScript PPD files.