File system-config-printer.spec of Package system-config-printer

#
# spec file for package system-config-printer (Version 1.0.8)
#
# 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 http://bugs.opensuse.org/
#

# norootforbuild


Name:           system-config-printer
License:        GPL v2 or later
Group:          Hardware/Printing
Version:        1.0.8
Release:        5.<RELEASE10>
%define pycups_version 1.9.42
%define pysmbc_version 1.0.5
%define cups_pk_helper_version 0.0.3
Summary:        A printer administration tool
Url:            http://cyberelk.net/tim/software/system-config-printer/
Source0:        http://cyberelk.net/tim/data/system-config-printer/1.0.x/system-config-printer-%{version}.tar.bz2
Source1:        http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2
Source2:        http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2
Source3:        cups-pk-helper-%{cups_pk_helper_version}.tar.bz2
# PATCH-FIX-UPSTREAM system-config-printer-git1.0.x.patch vuntz@novell.com -- Update to git (8b401e5f3)
Patch0:         system-config-printer-git1.0.x.patch
# PATCH-FIX-UPSTREAM pysmbc-bnc433994-crash.patch bnc433994 brc465975 vuntz@novell.com -- Patch taken from upstream git
Patch1:         pysmbc-bnc433994-crash.patch
# PATCH-FIX-UPSTREAM system-config-printer-git1.0.x-po.patch vuntz@novell.com -- Update to git for translations (8b401e5f3)
Patch2:         system-config-printer-git1.0.x-po.patch
Patch10:        system-config-printer-install-python.patch
Patch11:        system-config-printer-python-prefix.patch
# PATCH-FIX-UPSTREAM system-config-printer-remove-redhat-base.patch vuntz@novell.com -- remove Red Hat specific things. Sent upstream, and applied to the master branch.
Patch12:        system-config-printer-remove-redhat-base.patch
# 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-UPSTREAM system-config-printer-more-checks.patch vuntz@novell.com -- Add some more checks to not have exceptions here and there
Patch14:        system-config-printer-more-checks.patch
# PATCH-FEATURE-OPENSUSE system-config-printer-policykit.patch vuntz@novell.com -- Make s-c-p PolicyKit-aware
Patch15:        system-config-printer-policykit.patch
# PATCH-FIX-OPENSUSE system-config-printer-cups-autoconfig-notifications.patch vuntz@novell.com -- Integration with cups-autoconfig. This will be removed after 11.1, since we'll move to hal-cups-utils.
Patch16:        system-config-printer-cups-autoconfig-notifications.patch
# PATCH-FIX-OPENSUSE system-config-printer-hide-my-default-printer.patch vuntz@novell.com -- Hide my-default-printer in the menus
Patch17:        system-config-printer-hide-my-default-printer.patch
# PATCH-FIX-UPSTREAM system-config-printer-prefill-name-descr.patch bnc433633 vuntz@novell.com -- Prefill the name and description of a new printer
Patch19:        system-config-printer-prefill-name-descr.patch
# PATCH-FIX-OPENSUSE system-config-printer-bnc596445-global-notification.patch bnc596445 bili@novell.com -- Make the notification global
# This patch depends on system-config-printer-cups-autoconfig-notifications.patch
Patch20:        system-config-printer-bnc596445-global-notification.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Obsoletes:      gnome-cups-manager <= 0.33
# For cups-pk-helper:
BuildRequires:  PolicyKit-devel
BuildRequires:  cups-devel
# For directory ownership
BuildRequires:  dbus-1
# For cups-pk-helper:
BuildRequires:  dbus-1-glib-devel
BuildRequires:  desktop-file-utils
BuildRequires:  epydoc
BuildRequires:  fdupes
BuildRequires:  gettext-devel
BuildRequires:  gnome-icon-theme
# For cups-pk-helper:
BuildRequires:  gtk2-devel
# For directory ownership
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  libsmbclient-devel
BuildRequires:  python-devel
BuildRequires:  python-xml
BuildRequires:  update-desktop-files
BuildRequires:  xmlto
Requires:       cups
Requires:       dbus-1-x11
Requires:       dbus-1-python
Requires:       desktop-file-utils
Requires:       python-gnome
Requires:       python-gobject2
Requires:       python-gtk
Requires:       python-notify

%description
system-config-printer is a graphical user interface that allows the
user to configure a CUPS print server.



Authors:
--------
    Florian Festi <ffesti@redhat.com>
    Tim Waugh <twaugh@redhat.com>

%lang_package
%prep
%setup -q -a 1 -a 2 -a 3
%patch0 -p1
%patch1 -p0
%patch2 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch19 -p1
%patch20 -p1

%build
autoreconf -f -i
%configure
pushd pycups-%{pycups_version}
make
make doc
popd
pushd pysmbc-%{pysmbc_version}
make
make doc
popd
pushd cups-pk-helper-%{cups_pk_helper_version}
%configure --libexecdir=%{_libdir}/cups-pk-helper
popd

%install
%makeinstall
for size in 8x8 16x16 22x22 24x24 32x32 48x48; do
	if test -f %{_datadir}/icons/gnome/$size/devices/printer.png; then
		mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/$size/apps
		cp -a %{_datadir}/icons/gnome/$size/devices/printer.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/$size/apps/%{name}.png
	fi
done
pushd pycups-%{pycups_version}
chmod 644 examples/cupstree.py
make DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} install
popd
pushd pysmbc-%{pysmbc_version}
make DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} install
popd
pushd cups-pk-helper-%{cups_pk_helper_version}
%makeinstall
popd
%suse_update_desktop_file my-default-printer X-SuSE-PrintingUtility X-SuSE-ControlCenter-Hardware
%suse_update_desktop_file print-applet
%suse_update_desktop_file system-config-printer X-SuSE-PrintingUtility X-SuSE-ControlCenter-Hardware
%suse_update_desktop_file manage-print-jobs
%fdupes $RPM_BUILD_ROOT/%{py_sitedir}
%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc ChangeLog README
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/newprinternotification.conf
%dir %{_datadir}/%{name}
%exclude %{py_sitedir}/cupshelpers/*.pyc
%{py_sitedir}/cupshelpers
%{py_sitedir}/system-config-printer
%{py_sitedir}/*.so
%{py_sitedir}/*.egg-info
%{_bindir}/%{name}
%{_bindir}/%{name}-applet
%{_bindir}/my-default-printer
%{_datadir}/%{name}/*.glade
%{_datadir}/%{name}/icons
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*/apps/*
%{_sysconfdir}/xdg/autostart/*.desktop
%{_mandir}/man1/*
# From cups-pk-helper:
%{_sysconfdir}/dbus-1/system.d/org.opensuse.CupsPkHelper.Mechanism.conf
%{_libdir}/cups-pk-helper
%{_datadir}/dbus-1/system-services/org.opensuse.CupsPkHelper.Mechanism.service
%{_datadir}/PolicyKit/policy/org.opensuse.cupspkhelper.mechanism.policy

%files lang -f %{name}.lang

%changelog
openSUSE Build Service is sponsored by