File gutenprint.spec of Package gutenprint

# spec file for package gutenprint (Version 5.2.6)
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# norootforbuild

Name:           gutenprint
Version:        5.2.6
Release:        3
%define gutenprintmajor 5.2
BuildRequires:  cairo-devel cups-ddk cups-devel
BuildRequires:  gimp-devel glib2-devel gtk2-devel
BuildRequires:  libpng-devel libtiff-devel
BuildRequires:  pango-devel
License:        GPLv2+
Group:          Hardware/Printing
Summary:        Printer drivers for CUPS from the Gutenprint project
Requires:       ghostscript-library >= 7.05, cups >= 1.2.2, pstoraster
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# URL for Source0:
Source0:        gutenprint-%{version}.tar.bz2 
# Patch100... is for openSUSE/Novell patches which which are not intended for upstream:

The Gutenprint (formerly Gimp-Print) printer drivers for CUPS.
See the user's manual at /usr/share/gutenprint/doc/gutenprint-users-manual.pdf

%package devel
License:        GPLv2+
Summary:        Development environment for Gutenprint
Group:          Development/Libraries/C and C++
Requires:       ghostscript-library >= 7.05, cups >= 1.2.2, gutenprint = %{version}
Requires:       gtk2-devel, glibc-devel

%description devel
The development environment for the Gutenprint printer drivers.
See the developers guide to Gutenprint at /usr/share/gutenprint/doc/gutenprint.pdf

%package gimpplugin
License:        GPLv2+
Summary:        Alternative GIMP print plug-in from the Gutenprint project
Group:          Hardware/Printing

%description -n gutenprint-gimpplugin
The enhanced Gutenprint GIMP print plug-in offers an alternative
with additional capabilities to the plugin supplied with GIMP.
See the user's manual at /usr/share/gutenprint/doc/gutenprint-users-manual.pdf

# Be quiet when unpacking:
%setup -q

CFLAGS="$RPM_OPT_FLAGS -fstack-protector -fno-strict-aliasing -I/usr/include/gtk-2.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I%{_libdir}/gtk-2.0/include -I%{_libdir}/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/gimp-2.0" ./configure \
	--prefix=%{_prefix} \
	--mandir=%{_mandir} \
	--infodir=%{_infodir} \
	--sysconfdir=%{_sysconfdir} \
	--libdir=%{_libdir} \
	--disable-static \
	--enable-shared \
	--enable-cups-ppds \
	--enable-simplified-cups-ppds \
	--disable-translated-cups-ppds \
	--disable-libgutenprintui \
	--enable-libgutenprintui2 \
	--enable-samples \
	--enable-escputil \
	--with-pic=yes \
	--without-foomatic \
	--without-foomatic3 \
	--without-ghostscript \
	--without-gimp \

rm -rf $RPM_BUILD_ROOT/usr/share/cups/model
# Create required directories first:
install -d -m755 $RPM_BUILD_ROOT/bin
install -d -m755 $RPM_BUILD_ROOT/usr/share/cups/model
install -d -m755 $RPM_BUILD_ROOT/usr/lib/cups/filter
# Install Gutenprint:
# Work with upstream compliant CUPS 1.4 on all platforms
# which means to have a fixed "/usr/lib/cups/" directory
# on all platforms (see Novell/Suse Bugzilla bnc#575544):
for D in lib32 lib64
do for F in commandtocanon commandtoepson rastertogutenprint.%{gutenprintmajor}
   do if test -e $RPM_BUILD_ROOT/usr/$D/cups/filter/$F
      then mv -f $RPM_BUILD_ROOT/usr/$D/cups/filter/$F $RPM_BUILD_ROOT/usr/lib/cups/filter/$F
   if test -e $RPM_BUILD_ROOT/usr/$D/cups/driver/$F
   then mv -f $RPM_BUILD_ROOT/usr/$D/cups/driver/$F $RPM_BUILD_ROOT/usr/lib/cups/driver/$F
# Disable the run-time PPD generator /usr/lib/cups/driver/gutenprint.5.2
# so that it is not executed by the cups-driverd (e.g. in response to a "lpinfo -m" request)
# to avoid duplicated PPDs because we create the PPDs during compile-time (via --enable-cups-ppds)
# and provide ready-made PPDs in /usr/share/cups/model/gutenprint/... in the RPM package
# see "Regarding CUPS PPD files" at
chmod a-x $RPM_BUILD_ROOT/usr/lib/cups/driver/gutenprint.%{gutenprintmajor}
# Move the special testpattern generator away from the usual bin directory:
mv $RPM_BUILD_ROOT/%{_bindir}/testpattern $RPM_BUILD_ROOT/%{_libdir}/gutenprint/%{gutenprintmajor}
# Remove dispensable .po files (only the .mo files are needed on the end-users's system):
rm $RPM_BUILD_ROOT/usr/share/locale/*/gutenprint_*.po
%find_lang gutenprint

# update quietly Gutenprint PPD files in /etc/cups/ppd/ if such PPD files exist
# using the new PPD files under /usr/share/cups/model/gutenprint/ as templates
# see
/usr/sbin/cups-genppdupdate -q || /bin/true
# send CUPS daemon SIGHUP to let it recognize new and updated PPD files:
if test -x /etc/init.d/cups && /etc/init.d/cups status >/dev/null
then /etc/init.d/cups reload >/dev/null || /bin/true
# exit successfully in any case:
exit 0

# exit successfully in any case:
exit 0

%files -f gutenprint.lang
%config /etc/cups/command.types
%dir %{_libdir}/gutenprint
%dir %{_libdir}/gutenprint/%{gutenprintmajor}
%dir /usr/share/cups
%dir /usr/share/cups/model
%dir /usr/share/cups/model/gutenprint
%dir /usr/share/cups/model/gutenprint/%{gutenprintmajor}
%dir /usr/share/cups/model/gutenprint/%{gutenprintmajor}/C
%dir /usr/lib/cups/driver
%dir /usr/share/gutenprint
%dir /usr/share/gutenprint/%{gutenprintmajor}
%dir /usr/share/gutenprint/samples/
%dir /usr/share/gutenprint/doc
%doc /usr/share/gutenprint/doc/*
%doc /usr/share/man/man?/*.gz

%files devel
%dir /usr/include/gutenprint
%dir /usr/include/gutenprintui2

%files gimpplugin
%dir %{_libdir}/gimp
%dir %{_libdir}/gimp/2.0
%dir %{_libdir}/gimp/2.0/plug-ins

openSUSE Build Service is sponsored by