File gutenprint53.spec of Package gutenprint53

#
# spec file for package gutenprint53
#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%global srcname gutenprint
%global gpseries 5.3
%global gpseries_nodots %(echo %{gpseries} | tr -d '.')
%global shlib_gp libgutenprint9
%global shlib_gpui libgutenprintui2-2
%bcond_without gimp
%bcond_without escputil
%bcond_without cups_1_2_enh
Name:           gutenprint53
Version:        5.3.4
Release:        0
Summary:        Printer drivers for CUPS from the Gutenprint project (5.3 series)
License:        GPL-2.0-or-later
URL:            http://gutenprint.sourceforge.net
Source:         http://downloads.sourceforge.net/gimp-print/%{srcname}-%{version}.tar.xz
BuildRequires:  cups-ddk
BuildRequires:  gettext
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libpng16)
BuildRequires:  pkgconfig(libtiff-4)
BuildRequires:  pkgconfig(libusb-1.0)
%if %{with gimp}
BuildRequires:  pkgconfig(gimpui-2.0)
%endif
Provides:       gutenprint = %{version}
Obsoletes:      gutenprint < %{version}

%description
The 5.3 series of Gutenprint (formerly Gimp-Print) printer drivers for CUPS.
See the user's manual at %{_datadir}/gutenprint/doc/gutenprint-users-manual.pdf

%package -n %{shlib_gp}
Summary:        Shared library for gutenprint

%description -n %{shlib_gp}
This package provides the main shared library for gutenprint 5.3.

%package -n %{shlib_gpui}
Summary:        Shared library for gutenprint

%description -n %{shlib_gpui}
This package provides the shared library for gutenprintui.

%package devel
Summary:        Headers and sources for development with gutenprint 5.3 series
Requires:       %{shlib_gp} = %{version}
Requires:       cups >= 1.2.2
Requires:       ghostscript-library >= 7.05
Requires:       glibc-devel
Provides:       gutenprint-devel = %{version}
Obsoletes:      gutenprint-devel < %{version}

%description devel
This package provides the headers and sources for develompment with the main
gutenprint library.

%package -n gutenprintui2-5_3-devel
Summary:        Headers and sources for development with gutenprint UI (5.3 series)
Requires:       %{shlib_gpui} = %{version}
Requires:       %{name}-devel = %{version}
Requires:       pkgconfig(gtk+-2.0)

%description -n gutenprintui2-5_3-devel
This package provides the headers and sources for develompment with the
gutenprint UI library.

%package gimp-plugin
Summary:        Alternative GIMP print plug-in from the Gutenprint project
Provides:       gutenprint-gimpplugin = %{version}
Obsoletes:      gutenprint-gimpplugin < %{version}
Requires:       %{name} = %{version}
Requires:       gimp
Provides:       gutenprint-gimp-plugin = %{version}
Obsoletes:      gutenprint-gimp-plugin < %{version}

%description gimp-plugin
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

%lang_package

%prep
%autosetup -n %{srcname}-%{version} -p1

%build
%configure \
           --disable-static \
           --disable-silent-rules \
           --enable-test \
           --enable-cups-ppds \
           --enable-simplified-cups-ppds \
           --disable-translated-cups-ppds \
           --enable-libgutenprintui2 \
           %{?with_escputil:--enable-escputil} \
           %{!?with_escputil:--disable-escputil} \
           %{?with_cups_1_2_enh:--enable-cups-1_2-enhancements} \
           %{!?with_cups_1_2_enh:--disable-cups-1_2-enhancements} \
           %{?with_gimp:--enable-gimp2} \
           %{!?with_gimp:--disable-gimp2}

%make_build

%install
%make_install

%find_lang %{srcname} %{?no_lang_C}

# Move the special testpattern generator away from the usual bin directory:
mv %{buildroot}%{_bindir}/testpattern %{buildroot}%{_libdir}/gutenprint/%{gpseries}/

# Doc files to be included using %%doc
rm -fr %{buildroot}%{_datadir}/%{srcname}/doc

# Unnecessary libtool archives .la
find %{buildroot} -type f -name "*.la" -delete -print

# Translation po sources
rm %{buildroot}%{_datadir}/locale/*/*.po

%post
%{_sbindir}/cups-genppdupdate -q || /bin/true
# exit successfully in any case:
exit 0

%post -n %{shlib_gp} -p /sbin/ldconfig
%postun -n %{shlib_gp} -p /sbin/ldconfig
%post -n %{shlib_gpui} -p /sbin/ldconfig
%postun -n %{shlib_gpui} -p /sbin/ldconfig

%files
%license COPYING
%doc AUTHORS NEWS ChangeLog README
%doc doc/gutenprint-users-manual.*
%doc doc/gutenprint.*
%config %{_sysconfdir}/cups/command.types
%{_bindir}/cups-calibrate
%{_bindir}/escputil
%{_datadir}/cups/model/gutenprint/
%{_sbindir}/cups-genppd.%{gpseries}
%{_sbindir}/cups-genppdupdate
%{_datadir}/cups/calibrate.ppm
%{_datadir}/cups/usb/net.sf.gimp-print.usb-quirks
%{_datadir}/gutenprint/
%{_prefix}/lib/cups/backend/gutenprint%{gpseries_nodots}+usb
%{_prefix}/lib/cups/driver/gutenprint.%{gpseries}
%{_prefix}/lib/cups/filter/rastertogutenprint.%{gpseries}
%{_prefix}/lib/cups/filter/commandtocanon
%{_prefix}/lib/cups/filter/commandtoepson
%dir %{_libdir}/gutenprint
%{_libdir}/gutenprint/%{gpseries}/
%{_mandir}/man1/escputil.1%{?ext_man}
%{_mandir}/man8/*.8%{?ext_man}

%files lang -f %{srcname}.lang

%files -n %{shlib_gp}
%{_libdir}/libgutenprint.so.*

%files -n %{shlib_gpui}
%{_libdir}/libgutenprintui2.so.*

%files devel
%{_includedir}/gutenprint/
%{_libdir}/libgutenprint.so
%{_libdir}/pkgconfig/gutenprint.pc
%doc doc/gutenprint/html/

%files -n gutenprintui2-5_3-devel
%{_includedir}/gutenprintui2/
%{_libdir}/libgutenprintui2.so
%{_libdir}/pkgconfig/gutenprintui2.pc
%doc doc/gutenprintui2/html/

%if %{with gimp}
%files gimp-plugin
%{_libdir}/gimp/2.0/plug-ins/gutenprint
%endif

%changelog
openSUSE Build Service is sponsored by