File system-config-printer.spec of Package system-config-printer
#
# spec file for package system-config-printer
#
# Copyright (c) 2016 SUSE LINUX 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 http://bugs.opensuse.org/
#
%if 0%{?suse_version} > 1315
%define _icontheme adwaita
%define _iconlocation Adwaita
%else
%define _icontheme gnome
%define _iconlocation gnome
%endif
%if 0%{?is_opensuse} || 0%{?suse_version} > 1315
%define use_python3 1
%else # use python2
%define use_python3 0
%endif
Name: system-config-printer
Version: 1.5.7
Release: 0
Summary: A printer administration tool
License: GPL-2.0+
Group: Hardware/Printing
Url: http://cyberelk.net/tim/software/system-config-printer/
Source0: http://cyberelk.net/tim/data/system-config-printer/1.5/%{name}-%{version}.tar.xz
Source1: http://cyberelk.net/tim/data/system-config-printer/1.5/%{name}-%{version}.tar.xz.sig
Source2: %{name}.keyring
Source99: %{name}-rpmlintrc
# PATCH-FIX-OPENSUSE system-config-printer-icon-brp-friendly.patch vuntz@novell.com -- brp checks don't like the printer icon name, so we have to use something else
Patch13: system-config-printer-icon-brp-friendly.patch
# PATCH-FIX-OPENSUSE system-config-printer-no-openprinting.patch bnc#733542 vuntz@opensuse.org -- Disable feature that downloads ppd from openprinting.org
Patch19: system-config-printer-no-openprinting.patch
# PATCH-FIX-UPSTREAM system-config-printer-Gtk-introspect.patch bnc#852450 dimstar@opensuse.org -- Require Gtk 3.0 to be present
Patch20: system-config-printer-Gtk-introspect.patch
# PATCH-FIX-UPSTREAM system-config-printer-no-applet-in-gnome.patch rh#677676 fcrozat@suse.com -- Do not start applet in GNOME
Patch21: system-config-printer-no-applet-in-gnome.patch
# PATCH-FIX-UPSTREAM system-config-printer-no-params-to-py3.patch boo#924809 dimstar@opensuse.org -- Do not pass parameters to python3
Patch22: system-config-printer-no-params-to-py3.patch
# PATCH-FIX-SLE python3-to-python2.diff alarrosa@suse.com -- Do not use python3
Patch23: python3-to-python2.diff
# PATCH-FIX-UPSTREAM fix_connect_dialog_focus.diff gh#twaugh/system-config-printer#38 alarrosa@suse.com -- Allow to set the focus on a connect dialog combobox so the user can edit its contents
Patch24: fix_connect_dialog_focus.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Obsoletes: gnome-cups-manager <= 0.33
BuildRequires: cups-devel
# For directory ownership
BuildRequires: %{_icontheme}-icon-theme
BuildRequires: dbus-1
BuildRequires: desktop-file-utils
BuildRequires: fdupes
BuildRequires: glib2-devel
# Needed for typelib() requires
BuildRequires: gobject-introspection
# For directory ownership
BuildRequires: hicolor-icon-theme
BuildRequires: intltool
%if %{?use_python3}
BuildRequires: python3-devel
BuildRequires: python3-lxml
Requires: python3-cups
Requires: python3-pycurl
Requires: python3-requests
%else
BuildRequires: python-devel
BuildRequires: python-lxml
Requires: python-cups
Requires: python-pycurl
%endif
BuildRequires: systemd
BuildRequires: update-desktop-files
BuildRequires: xmlto
BuildRequires: pkgconfig(libudev) >= 172
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(udev)
Requires: %{name}-common = %{version}
# The applet is not strictly necessary, but it really makes sense
Recommends: %{name}-applet
%description
system-config-printer is a graphical user interface that allows the
user to configure a CUPS print server.
%package common
Summary: A printer administration tool -- Common Files
Group: Hardware/Printing
%if %{?use_python3}
Requires: dbus-1-python3
Requires: python3-cairo
Requires: python3-cups >= 1.9.60
Requires: python3-cupshelpers
Requires: python3-gobject
Requires: python3-gobject-Gdk
Requires: python3-smbc
%else
Requires: dbus-1-python
Requires: python-cairo
Requires: python-cups >= 1.9.60
Requires: python-cupshelpers
Requires: python-gobject
Requires: python-gobject-Gdk
Requires: python-smbc
%endif
Recommends: %{name}-common-lang
Recommends: cups-pk-helper
# As soon as this package is installed, it makes sense to have the
# autoconfiguration too
Recommends: udev-configure-printer
BuildArch: noarch
%description common
system-config-printer is a graphical user interface that allows the
user to configure a CUPS print server.
This package provides files common to various binaries.
%package applet
Summary: A printer administration tool -- Notification Icon for Printing
Group: Hardware/Printing
Requires: %{name} = %{version}
# Uses the dbus service to interact with print jobs
Requires: %{name}-dbus-service = %{version}
BuildArch: noarch
%description applet
system-config-printer is a graphical user interface that allows the
user to configure a CUPS print server.
This package provides a notification icon to configure new printers and
monitor print jobs.
%package dbus-service
Summary: A printer administration tool -- D-Bus Service to Configure Printing
Group: Hardware/Printing
Requires: %{name}-common = %{version}
BuildArch: noarch
%description dbus-service
system-config-printer is a graphical user interface that allows the
user to configure a CUPS print server.
This packages provides a D-Bus service to configure printers and manage
print jobs.
%if %{?use_python3}
%package -n python3-cupshelpers
Summary: High-level Python Bindings for CUPS
Group: Hardware/Printing
Requires: python3-cups >= 1.9.60
Requires: python3-pycurl
BuildArch: noarch
%description -n python3-cupshelpers
This package provides high-level python bindings for CUPS, and can be
used on top of python3-cups.
%else # use python2
%package -n python-cupshelpers
Summary: High-level Python Bindings for CUPS
Group: Hardware/Printing
Requires: python-cups >= 1.9.60
Requires: python-pycurl
BuildArch: noarch
%description -n python-cupshelpers
This package provides high-level python bindings for CUPS, and can be
used on top of python-cups.
%endif
%package -n udev-configure-printer
Summary: Utility to autoconfigure printers when plugged
Group: Hardware/Printing
Obsoletes: cups-autoconfig <= 0.1.0
%if %{?use_python3}
Requires: dbus-1-python3
Requires: python3-cups >= 1.9.60
Requires: python3-cupshelpers
%else # use python2
Requires: dbus-1-python
Requires: python-cups >= 1.9.60
Requires: python-cupshelpers
%endif
Recommends: %{name}-applet
%systemd_requires
%description -n udev-configure-printer
This package contains an utility that will ensure printers get
automatically configured when plugged on the computer.
%lang_package -n system-config-printer-common
%prep
%setup -q
%patch13 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%if !%{?use_python3}
%patch23 -p1
%endif
%patch24 -p1
%build
%configure \
--with-udev-rules \
--with-systemdsystemunitdir=%{_unitdir}
%install
%makeinstall udevrulesdir=/usr/lib/udev/rules.d udevhelperdir=/usr/lib/udev
for size in 8x8 16x16 22x22 24x24 32x32 48x48 256x256; do
if test -f %{_datadir}/icons/%{_iconlocation}/$size/devices/printer.png; then
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/$size/apps
cp -a %{_datadir}/icons/%{_iconlocation}/$size/devices/printer.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/$size/apps/%{name}.png
fi
done
%suse_update_desktop_file print-applet
%suse_update_desktop_file -r system-config-printer GTK System HardwareSettings
%fdupes $RPM_BUILD_ROOT/%{py_sitedir}
%find_lang %{name} %{?no_lang_C}
%clean
rm -rf $RPM_BUILD_ROOT
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%files
%defattr(-,root,root,-)
%doc ChangeLog COPYING README
%{_bindir}/%{name}
%{_bindir}/install-printerdriver
%dir %{_datadir}/appdata
%{_datadir}/appdata/system-config-printer.appdata.xml
%{_datadir}/applications/system-config-printer.desktop
%{_mandir}/man1/system-config-printer.1%{?ext_man}
%files common
%defattr(-,root,root,-)
%{_datadir}/%{name}/
%{_datadir}/icons/hicolor/*/apps/system-config-printer.png
%files applet
%defattr(-,root,root,-)
%{_bindir}/%{name}-applet
%{_mandir}/man1/system-config-printer-applet.1%{?ext_man}
# The dbus service is provided by applet.py
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.redhat.NewPrinterNotification.conf
%{_sysconfdir}/xdg/autostart/print-applet.desktop
%files dbus-service
%defattr(-,root,root,-)
%{_bindir}/scp-dbus-service
%{_datadir}/dbus-1/interfaces/org.fedoraproject.Config.Printing.xml
%{_datadir}/dbus-1/services/org.fedoraproject.Config.Printing.service
%if %{?use_python3}
%files -n python3-cupshelpers
%else
%files -n python-cupshelpers
%endif
%defattr(-,root,root,-)
%dir %{_sysconfdir}/cupshelpers
%config(noreplace) %{_sysconfdir}/cupshelpers/preferreddrivers.xml
%if %{?use_python3}
%exclude %{python3_sitelib}/cupshelpers/__pycache__/*.pyc
%{python3_sitelib}/cupshelpers
%{python3_sitelib}/cupshelpers*.egg-info
%else
%exclude %{python_sitelib}/cupshelpers/*.pyc
%{python_sitelib}/cupshelpers
%{python_sitelib}/cupshelpers*.egg-info
%endif
# The dbus service is provided by cupshelpers/installdriver.py
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.redhat.PrinterDriversInstaller.conf
%files -n udev-configure-printer
%defattr(-,root,root,-)
%{_unitdir}/configure-printer@.service
%dir /usr/lib/udev
%dir /usr/lib/udev/rules.d
/usr/lib/udev/rules.d/*.rules
/usr/lib/udev/udev-add-printer
/usr/lib/udev/udev-configure-printer
%files common-lang -f %{name}.lang
%changelog