Blob Blame History Raw
%define dbver_rel 4.0
%define dbver_snap 20101123
%define hpijsver 20090901

Summary: Database of printers and printer drivers
Name: foomatic-db
Version: %{dbver_rel}
Release: 23.%{dbver_snap}%{?dist}
License: GPLv2+
Group: System Environment/Libraries
Requires: %{name}-filesystem = %{version}-%{release}
Requires: %{name}-ppds = %{version}-%{release}

Source0: http://www.openprinting.org/download/foomatic/foomatic-db-%{dbver_rel}-%{dbver_snap}.tar.gz
Source1: http://www.openprinting.org/download/foomatic/oldstuff/foomatic-db-hpijs-%{hpijsver}.tar.gz

Patch1: foomatic-db-device-ids-20100416.patch
Patch2: foomatic-db-device-ids-20100506.patch
Patch3: foomatic-db-device-ids-20101123.patch
Patch4: foomatic-db-device-ids-20101202.patch

Url: http://www.openprinting.org
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch

# The foomatic oki8w driver works for printers that this old package
# use to drive:
Obsoletes: oki4linux < 2.1gst-5
# Note: no "Provides:" as it was not a dependency of any package.

# Make sure we get postscriptdriver tags.
BuildRequires: pycups

%description
This is the database of printers, printer drivers, and driver options
for Foomatic.

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

%package filesystem
Summary: Directory layout for the foomatic package
License: Public Domain
Group: System Environment/Base

%description filesystem

Directory layout for the foomatic package.

%package ppds
Summary: PPDs from printer manufacturers
License: GPLv2+ and MIT
Group: System Environment/Libraries
# We ship a symlink in a directory owned by cups
BuildRequires: cups
Requires: cups
Requires: sed
Requires: %{name}-filesystem = %{version}-%{release}

%description ppds
PPDs from printer manufacturers.

%prep
%setup -q -c -a 1

find -type d | xargs chmod g-s

pushd foomatic-db-%{dbver_snap}

pushd db/source

# For gutenprint printers, use gutenprint-ijs-simplified.5.2.
perl -pi -e 's,>gutenprint<,>gutenprint-ijs-simplified.5.2<,' printer/*.xml

# Remove Samsung-CLP-300, Samsung-CLP-315 (bug #625505)
find printer -name '*.xml' |grep -E 'Samsung-CLP-300|Samsung-CLP-315'|xargs rm -vf
# Remove references to foo2zjs, foo2oak, foo2hp and foo2qpdl (bug #208851).
# Also foo2lava, foo2kyo, foo2xqx (bug #438319).
# Also foo2slx and foo2hiperc (bug #518267).
for x in zjs oak oak-z1 hp qpdl lava kyo xqx slx hiperc
do
  find printer -name '*.xml' |xargs grep -l "<driver>foo2${x}"|xargs rm -vf
  rm -f driver/foo2${x}.xml opt/foo2${x}-*
done
# Same for m2300w/m2400w
find printer -name '*.xml' |xargs grep -l '<driver>m2[34]00w<'|xargs rm -vf
rm -f driver/m2300w.xml driver/m2400w.xml opt/m2300w-*
# Same for all these.
for x in drv_x125 ml85p pbm2lwxl pbmtozjs bjc800j
do
  find printer -name '*.xml' |xargs grep -l "<driver>${x}</driver>"|xargs rm -vf
  rm -vf driver/${x}.xml opt/${x}-*
done

popd

# foomatic-db patches
# Don't use "-b" when patching PPD files as the backups will be
# packaged.

# Device IDs for:
# - HP Color LaserJet 3800 (bug #581936).
# - HP DeskJet D2300 (bug #580341).
# - HP DeskJet F2100 (bug #579245).
# - HP OfficeJet 7300 (bug #577897).
# - Lexmark E120 (bug #577881).
# - HP DeskJet 1280 (bug #577870).
# - HP PhotoSmart 7400 (bug #577866).
# - HP PSC 2400 (bug #188419).
%patch1 -p1 -b .device-ids-20100416

# Device IDs for:
# - Ricoh Aficio SP C420DN (bug #589533).
%patch2 -p1

# Device IDs for:
# - Canon iR 3225 (bug #651500).
%patch3 -p1

# Device IDs for:
# HP Deskjet D4100 (bug #658091)
# HP Color LaserJet CM4730 MFP (bug #658838)
# HP LaserJet 4050/4100/4350/5100/8000/P3005 (bug #659041)
# HP Color LaserJet 2500/3700/4550/4650/4700/5550 (bug #659042)
%patch4 -p1 -b .device-ids-20101202

# Use sed instead of perl in the PPDs (bug #512739).
find db/source/PPD -type f -name '*.ppd' | xargs perl -pi -e 's,perl -p,sed,'

popd

%build
pushd foomatic-db-hpijs-%{hpijsver}
%configure
make PREFIX=%{_prefix}
popd

pushd foomatic-db-%{dbver_snap}
%configure
make PREFIX=%{_prefix}
popd


%install
rm -rf $RPM_BUILD_ROOT

pushd foomatic-db-%{dbver_snap}
make	DESTDIR=%buildroot PREFIX=%{_prefix} \
	install
popd

pushd foomatic-db-hpijs-%{hpijsver}
make	DESTDIR=%buildroot PREFIX=%{_prefix} \
	install
popd

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

find %{buildroot}%{_datadir}/foomatic/db/source/ -type f | xargs chmod 0644

mkdir %{buildroot}%{_datadir}/foomatic/db/source/PPD/Custom

rm -f	%{buildroot}%{_datadir}/foomatic/db/source/PPD/Kyocera/*.htm \
	%{buildroot}%{_datadir}/cups/model/3-distribution

# Convert absolute symlink to relative.
rm -f %{buildroot}%{_datadir}/cups/model/foomatic-db-ppds
ln -sf ../../foomatic/db/source/PPD %{buildroot}%{_datadir}/cups/model/foomatic-db-ppds

%clean
rm -rf %{buildroot}

%files filesystem
%defattr(-,root,root,-)
%dir %{_datadir}/foomatic
%dir %{_datadir}/foomatic/db
%dir %{_datadir}/foomatic/db/source

%files
%defattr(-,root,root,-)
%doc foomatic-db-%{dbver_snap}/db/source/PPD/Kyocera/*.htm
%doc foomatic-db-%{dbver_snap}/README
%{_datadir}/foomatic/db/oldprinterids
%{_datadir}/foomatic/db/source/printer
%{_datadir}/foomatic/db/source/driver
%{_datadir}/foomatic/db/source/opt

%files ppds
%defattr(-,root,root,-)
%doc foomatic-db-%{dbver_snap}/COPYING
%{_datadir}/foomatic/db/source/PPD
%{_datadir}/cups/model/foomatic-db-ppds

%changelog
* Mon Dec 06 2010 Jiri Popelka <jpopelka@redhat.com> 4.0-23.20101123
- Device IDs for:
  - HP Deskjet D4100 (bug #658091)
  - HP Color LaserJet CM4730 MFP (bug #658838)
  - HP LaserJet 4050/4100/4350/5100/8000/P3005 (bug #659041)
  - HP Color LaserJet 2500/3700/4550/4650/4700/5550 (bug #659042)

* Tue Nov 23 2010 Jiri Popelka <jpopelka@redhat.com> 4.0-22.20101123
- Updated to foomatic-db-4.0-20101123 (bug #655238).
- Device ID for Canon iR 3225 (bug #651500).

* Wed Nov 03 2010 Jiri Popelka <jpopelka@redhat.com> 4.0-21.20100819
- Remove wrong Device ID for Canon iR 3170C (bug #617493).

* Fri Aug 20 2010 Jiri Popelka <jpopelka@redhat.com> 4.0-20.20100819
- Removed printer/Samsung-CLP-300|315.xml (bug #625505).
- Removed references to foo2oak-z1.

* Thu Aug 19 2010 Jiri Popelka <jpopelka@redhat.com> 4.0-19.20100819
- Updated to foomatic-db-4.0-20100819, foomatic-db-hpijs-20090901.tar.gz
- Device ID for Canon iR 3170C (bug #617493).

* Mon Jul 12 2010 Jiri Popelka <jpopelka@redhat.com> 4.0-18.20100204
- Moved COPYING file to ppds sub-package.

* Mon May 17 2010 Tim Waugh <twaugh@redhat.com> 4.0-17.20100204
- Don't ship backup files.

* Sun May 16 2010 Tim Waugh <twaugh@redhat.com> 4.0-16.20100204
- Device IDs for another 1302 Ricoh PPDs.

* Thu May  6 2010 Tim Waugh <twaugh@redhat.com> 4.0-15.20100204
- Device IDs for:
  - HP Color LaserJet 2605dn (bug #583909).
  - HP DeskJet F300 (bug #585644).
  - HP OfficeJet 6200 (bug #215063).
  - HP PSC 1400 (bug #586381).
  - Ricoh Aficio MP C3500 (bug #589527).
  - Ricoh Aficio SP C420DN (bug #589533).

* Fri Apr 16 2010 Tim Waugh <twaugh@redhat.com> 4.0-14.20100204
- Device IDs for:
  - Canon BJC-4100 (bug #583060)
  - HP Color LaserJet 3800 (bug #581936).
  - HP DeskJet D2300 (bug #580341).
  - HP DeskJet F2100 (bug #579245).
  - HP OfficeJet 7300 (bug #577897).
  - Lexmark E120 (bug #577881).
  - HP DeskJet 1280 (bug #577870).
  - HP PhotoSmart 7400 (bug #577866).
  - Brother HL-2140 (bug #577863).
  - HP OfficeJet 6200 (bug #215063).
  - HP PSC 2400 (bug #188419).

* Fri Mar 26 2010 Tim Waugh <twaugh@redhat.com> 4.0-13.20100204
- Device IDs for HP PhotoSmart 2570, HP DeskJet 959C and HP OfficeJet
  Pro K550 (bug #577280, bug #577293, bug #577296).

* Thu Mar 25 2010 Tim Waugh <twaugh@redhat.com> 4.0-12.20100402
- Fixed missing units in driver margins (bug #576370).

* Fri Mar 19 2010 Tim Waugh <twaugh@redhat.com> 4.0-11.20100402
- Device ID for Kyocera Mita FS-1020D (bug #575063).

* Thu Feb  4 2010 Tim Waugh <twaugh@redhat.com> 4.0-10.20100402
- Rebuild for postscriptdriver tags.

* Thu Feb  4 2010 Tim Waugh <twaugh@redhat.com> 4.0-9.20100402
- Updated to foomatic-db-4.0-20100402.

* Fri Dec  4 2009 Tim Waugh <twaugh@redhat.com> 4.0-8.20091126
- Added foomatic-db-hpijs tarball back in.

* Thu Nov 26 2009 Tim Waugh <twaugh@redhat.com> 4.0-7.20091126
- Updated to foomatic-db-4.0-20091126 (bug #538994).

* Thu Aug 20 2009 Tim Waugh <twaugh@redhat.com> 4.0-6.20090819
- Removed references to foo2slx and foo2hiperc (bug #518267).

* Wed Aug 19 2009 Tim Waugh <twaugh@redhat.com> 4.0-5.20090819
- Updated to foomatic-db-4.0-20090819.
- Removed deprecated foomatic-db-hpijs tarball.
- Use buildroot macro throughout.

* Tue Aug 18 2009 Tim Waugh <twaugh@redhat.com> 4.0-4.20090702
- Use stcolor driver for Epson Stylus Color 200 (bug #513676).

* Mon Aug 17 2009 Tim Waugh <twaugh@redhat.com> 4.0-3.20090702
- License for ppds sub-package should include GPLv2+.
- Ship COPYING file in main package.
- Added filesystem sub-package for directory ownership.

* Mon Aug  3 2009 Tim Waugh <twaugh@redhat.com> 4.0-2.20090702
- Move foomatic-db-ppds symlink to ppds sub-package.
- Use sed instead of perl in raster PPDs (bug #512739).
- Removed code to convert old-style printer IDs (there are none).
- Ship README file.

* Mon Aug  3 2009 Tim Waugh <twaugh@redhat.com> 4.0-1.20090702
- Split database out from main foomatic package.