Sophie

Sophie

distrib > Mandriva > 10.2 > i586 > by-pkgid > 56c3a199723d2e528af30f1d362f3f74 > files > 3

gimpprint-4.2.7-12mdk.src.rpm

%define version 4.2.7
%define extraversion %nil
#define extraversion -pre1
%define release 12mdk
%define gimprintmajor 1
%define libgimpprint %mklibname gimpprint %{gimprintmajor}

%define gimpplugin 0

%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


Summary: Photo-quality printer drivers primarily for inkjet printers
Name:		gimpprint
Version:	%{version}
Release:	%{release}
License:	GPL
Group:		Publishing
URL:		http://gimp-print.sourceforge.net/

##### GENERAL BUILDREQUIRES

BuildRequires:	autoconf2.5, libtiff-devel, glib-devel
BuildRequires:	libcups-devel, libgtk+-devel, libjpeg-static-devel
BuildRequires:	foomatic-db-engine, foomatic-db
BuildRequires:	bison, flex, libijs-devel

%if %{gimpplugin}
BuildRequires:	libgimp-devel
%endif

# Only needed when building Gimp-Print from a CVS snapshot
#BuildRequires: tetex-latex ImageMagick docbook-utils sgml-tools

##### GIMP PRINT SOURCE

Source:	http://cesnet.dl.sourceforge.net/sourceforge/gimp-print/gimp-print-%{version}%{extraversion}.tar.bz2
#Source:	http://gimp-print.sourceforge.net/gimp-print-%{version}-cvs20020820.tar.bz2

##### GIMP PRINT PATCHES

# Fixed bug in Makefile for CUPS drivers
Patch0:	gimp-print-cups-Makefile.patch.bz2



##### BUILD ROOT

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

##### PACKAGE DESCRIPTIONS

%package -n %{libgimpprint}
Summary:	Shared library for high-quality image printing
Group:		Publishing
Requires:	gimpprint-common
Obsoletes:      libgimpprint4
Provides:       libgimpprint4
Provides:       libgimpprint = %{version}-%{gimpprintrel}

%package -n %{libgimpprint}-devel
Summary:	Headers and links for compiling against libgimpprint
Group:		Development/C
Requires:	%{libgimpprint} >= %{version}-%{gimpprintrel}
Requires:       multiarch-utils
Obsoletes:      libgimpprint4-devel
Provides:       libgimpprint4-devel
Provides:       libgimpprint-devel = %{version}-%{gimpprintrel}
Provides:       gimpprint-devel = %{version}-%{gimpprintrel}

%package common
Summary: Documentation, samples and translations of Gimp-Print
Conflicts:	libgimpprint1 < 4.2.7-10mdk
Group: 		Publishing

%package cups
Summary: Special CUPS printer driver of Gimp-Print
Requires: 	cups >= 1.1
Conflicts:	cups-drivers <= 10.1
Group: 		Publishing

%package ijs
Summary: Gimp-Print IJS plugin for GhostScript
Requires:	ghostscript >= 7.05
Conflicts:	printer-filters <= 10.1
Group:		Publishing

%package foomatic
Summary: Foomatic data for Gimp-Print IJS plugin for GhostScript
Requires:	gimpprint-ijs, foomatic-db, foomatic-db-engine
Conflicts:	foomatic-db < 20050101
Group:		Publishing

%package escputil
Summary: Gimp-Print ink level monitor and printer maintenance tool
Conflicts:	printer-utils <= 10.1
Group:		Publishing

%if %{gimpplugin}
%package gimp2
Summary:	Gimp-Print plugin for high-quality image printing
Group:		Publishing
Requires:	gimp >= 2.0
%endif

##### DESCRIPTION TEXTS

%description
Gimp-Print is a high quality printer driver suite for photo-quality
printing on inkjet printers, especially Epson. There are also some
Canon, HP, and Lexmark inkjets (older models) and PCL bw laser
printers supported (PCL 5e and earlier). If your printer is supported
by Gimp-Print and not an HP printer supported by HPIJS, this is the
best choice of a free software printer driver.

Keep in mind that the leader of this project is hobby photographer and
wanted to get his 6-ink Epson Stylus Photo EX working in its best
quality without necessity of proprietary software.

%description -n %{libgimpprint}
This is a high-quality printing library used by the Gimp-Print plugin,
the Gimp-Print IJS color/photo inkjet/laser driver for GhostScript,
and by specialized CUPS drivers.

%description -n %{libgimpprint}-devel
These are the links and header files to compile applications which
should use the libgimpprint library.

%description common
Documentation, sample files, and translations of Gimp-Print.

%description cups
This package contains a special Gimp-Print printer driver to be used
with CUPS (and without GhostScript) and also the appropriate PPD files
to set up print queues with this driver.

With the Gimp-Print CUPS drivers you can do a colour caibration. Use
the program "cups-calibrate" to perform it.

%description ijs
This package contains a Gimp-Print plugin for GhostScripts IJS
interface. This gives access to the high printing quality of
Gimp-Print with every GhostScript version containing the IJS
interface. Install also the gimp-print-foomatic package for easy setup
of print queues with arbitrary printing systems.

%description foomatic
Foomatic data for the Gimp-Print IJS plug-in for GhostScript. You need
this package to set up print queues with printerdrake, KDE Printing
Manager, or directly with Foomatic.

%description escputil
This is a command line tool to query ink levels and to maintain
Epson's inkjet printers. It allows ink level query, head alignment,
nozzle checking, and nozzle cleaning. If you want a graphical
interface, use mtink instead.

%if %{gimpplugin}
%description gimp2
This is a plug-in for the GIMP, which allows printing of images and
photos in very high quality on many modern inkjet printers and also
some lasers. Especially on Epson Stylus printers the quality which one
gets under proprietary operating systems is reached, due to Epson
publishing the protocols of their printers, but other brands of
printers give very high qualities, too. It can also output PostScript
to be able to print out of the GIMP on any printer.
%endif


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

# unpack main sources
%setup -q -n gimp-print-%{version}
#ln -s gimp-print-%{version}* print-%{version}
#ln -s print print-%{version}
#cd print-%{version}
# Replace "-dSAFER" by "-dPARANOIDSAFER" in GhostScript command lines
perl -p -i -e "s/-dSAFER/-dPARANOIDSAFER/" src/foomatic/foomatic-templates-*/gimp-print*.xml
# Fixed bug in Makefile for CUPS drivers
%patch0 -p4
# Get User's Guide and manual into correct doc directory
cd doc
perl -p -i -e 's!\$\(PACKAGE\)/doc!doc/gimpprint-%{version}!g' Makefile.am
perl -p -i -e 's!\$\(PACKAGE\)/doc!doc/gimpprint-%{version}!g' users_guide/Makefile.am
perl -p -i -e 's!\$\(PACKAGE\)/doc!doc/gimpprint-%{version}!g' Makefile.in
perl -p -i -e 's!\$\(PACKAGE\)/doc!doc/gimpprint-%{version}!g' users_guide/Makefile.in
cd ..
cd ..



%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

# "autogen.sh" instead of "configure" needed for the case when Gimp-Print
# driver is from CVS (see its README)
# Build with all pipes and whistles: GIMP, GhostScript, CUPS, IJS, Foomatic,
# but without translated PPD files (does not work)
# Use IJS library provided by this package
#export NOCONFIGURE=1; ./autogen.sh
%if %{gimpplugin}
%configure --with-cups --with-user-guide --with-ijs --with-foomatic --with-foomatic3 --with-samples --with-escputil --without-translated-ppds
%else
%configure --without-gimp --with-cups --with-user-guide --with-ijs --with-foomatic --with-foomatic3 --with-samples --with-escputil --without-translated-ppds
%endif
# Compile Gimp-Print
%make
# Set default values to get a better image quality: Image Type to
# "Photographs" and Gamma to 1.6.
perl -p -i -e 's:<arg_defval>1</arg_defval>:<arg_defval>1.6</arg_defval>:' foomatic-db/*/opt/gimp-print*-gamma.xml
perl -p -i -e 's:<arg_defval>gimp-print-(.*)LineArt</arg_defval>:<arg_defval>gimp-print-$1Photographs</arg_defval>:' foomatic-db/*/opt/gimp-print*-imagetype.xml
# Remove the hard-coded "foomatic-kitload" from the Makefile because it only
# works on an installed Foomatic database. We do the "foomatic-kitload"
# manually during the further build. The ":" is a neutral shell command, it
# does nothing and exits with 0, independent with which command line options
# it is called.
cd src/foomatic
perl -p -i -e 's/FOOMATIC_KITLOAD\s*=.*$/FOOMATIC_KITLOAD = :/' Makefile
cd ../..



%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}%{_datadir}/cups/model


%if %{gimpplugin}
# Fake the gimptool because it only installs into the root file system and
# not into buildroot
#cat >fakedgimptool <<EOF
##!/bin/sh
#install -m 755 print %{buildroot}%{_libdir}/gimp/1.2/plug-ins/
#EOF
cat >fakedgimptool <<EOF
#!/bin/sh
gimptool \$* | perl -p -e "s:%{_libdir}:%{buildroot}%{_libdir}:"
EOF
chmod 755 fakedgimptool

# Make the directory for the GIMP-Plugin
install -d %{buildroot}%{_libdir}/gimp/2.0/plug-ins/
%endif

# Install the files
%old_makeinstall GIMPTOOL=$RPM_BUILD_DIR/%{name}-%{version}/print-%{version}/fakedgimptool cups_conf_serverbin=%{buildroot}%{_libdir}/cups cups_conf_datadir=%{buildroot}%{_datadir}/cups cups_conf_serverroot=%{buildroot}%{_sysconfdir}/cups gimp_plug_indir=%{buildroot}%{_libdir}/gimp/2.0/plug-ins

# Foomatic data
install -d %{buildroot}%{_datadir}/foomatic/db/source
(cd src/foomatic/foomatic-db/gimp-print-ijs && tar cf - --exclude=CVS *) | ( cd %{buildroot}%{_datadir}/foomatic/db/source && tar xf -)

# Documentation
install -d %{buildroot}%{_docdir}/gimpprint-%{version}
cp ABOUT-NLS AUTHORS COPYING ChangeLog NEWS README doc/users_guide/users-guide.ps %{buildroot}%{_docdir}/gimpprint-%{version}
#cp -ax doc/manual-html %{buildroot}%{_docdir}/gimpprint-%{version}
cp src/cups/README %{buildroot}%{_docdir}/gimpprint-%{version}/README.cups
# Set links so that users find the HTML version of the User's Guide more
# easily
( cd %{buildroot}%{_docdir}/gimpprint-%{version}/html
  ln -s book1.html users_guide.html
)
( cd %{buildroot}%{_docdir}/gimpprint-%{version}/
  ln -s html users-guide-html
)
# Remove /usr/share/info/dir
rm -f %{buildroot}%{_datadir}/info/dir


# Correct permissions for all documentation files
chmod -R a+rX %{buildroot}%{_docdir}
chmod -R go-w %{buildroot}%{_docdir}
chmod -R u+w %{buildroot}%{_docdir}

# Translation files of Gimp-Print
%find_lang gimp-print

# Multiarch setup
%multiarch_binaries %buildroot%{_bindir}/gimpprint-config


##### FILES

#BUG? nc 2003-12-06
%files -n %{libgimpprint}
%defattr(-,root,root)
%{_libdir}/libgimpprint.so.*

%files -n %{libgimpprint}-devel
%defattr(-,root,root)
%{_libdir}/libgimpprint.so
%{_libdir}/libgimpprint.la
%{_libdir}/libgimpprint.a
%{_includedir}/gimp-print
%{_datadir}/aclocal/*
%{_mandir}/man1/*
%{_mandir}/man3/*
%{_mandir}/man7/*
%{_bindir}/gimpprint-config
%{_bindir}/*/gimpprint-config

%files common -f gimp-print.lang
%defattr(-,root,root)
%docdir %{_docdir}/gimpprint-%{version}
%{_docdir}/gimpprint-%{version}
%{_datadir}/info/gimpprint*
%{_datadir}/gimp-print/samples

%files cups
%defattr(-,root,root)
%{_mandir}/man8/cups-calibrate*
%{_bindir}/cups-calibrate
%{_datadir}/cups/model/*
%{_datadir}/cups/calibrate.ppm
%attr(0755,root,root) %{_libdir}/cups/backend/*
%attr(0755,root,root) %{_libdir}/cups/filter/*
%config(noreplace) %{_sysconfdir}/cups/command.*

%files ijs
%defattr(-,root,root)
%{_mandir}/man1/ijsgimpprint.1*
%{_bindir}/ijsgimpprint

%files foomatic
%defattr(-,root,root)
%_datadir/foomatic/db/*/*/*.xml

%files escputil
%defattr(-,root,root)
%{_mandir}/man1/escputil*
# escputil has a security bug, therefore the SGID flag cannot be set
#%attr(2755,lp,sys) %{_bindir}/escputil
%attr(0755,lp,sys) %{_bindir}/escputil

%if %{gimpplugin}
%files gimp2
%defattr(-,root,root)
%{_libdir}/gimp/2.0/plug-ins/print
%endif

%define info_files gimpprint

%post -n %{libgimpprint} -p /sbin/ldconfig

%post common
for f in %info_files; do %_install_info $f
done
:

%post cups
# 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
/sbin/service cups condrestart > /dev/null 2>/dev/null || :

%postun -n %{libgimpprint} -p /sbin/ldconfig

%postun common
for f in %info_files; do %_remove_install_info $f
done
:

%postun cups
# 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
/sbin/service cups condrestart > /dev/null 2>/dev/null || :

%clean
rm -rf %{buildroot}

%changelog

* Sat Feb 19 2005 Till Kamppeter <till@mandrakesoft.com> 4.2.7-12mdk
- Rebuilt to work with current libijs

* Tue Feb 15 2005 Christiaan Welvaart <cjw@daneel.dyndns.org> 4.2.7-11mdk
- add BuildRequires: bison flex

* Sat Feb  5 2005 Till Kamppeter <till@mandrakesoft.com> 4.2.7-10mdk
- Introduced separate packages for Gimp-Print.