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

#
# spec file for package system-config-printer (Version 1.0.8)
#
# Copyright (c) 2008 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
%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
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

%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
* Fri Nov 21 2008 vuntz@novell.com
- Update cups-pk-helper to 0.0.3 (there is no upstream project, but
  I still version the code):
  + make various checks to be sure that the arguments passed over
  dbus are valid.
  + fix a major issue with many options never being changed
  + implement various dbus methods that were missing until there,
  so that the old authentication dialog never appears.
  + add more fine-grained PolicyKit policies.
  This is actually needed for bnc#439286.
- Update system-config-printer-policykit.patch to match the
  cups-pk-helper update.
- Drop cups-pk-helper-acceptjobs.patch (fixed in 0.0.3).
- Add system-config-printer-more-checks.patch, to avoid a few
  uncaught exceptions.
* Tue Oct 28 2008 vuntz@novell.com
- Add system-config-printer-prefill-name-descr.patch to prefill
  name and description of new printers. Fix bnc#433633.
* Mon Oct 27 2008 vuntz@novell.com
- Add cups-pk-helper-acceptjobs.patch to make cups-pk-helper
  correctly handle AcceptJobs requests. This is essential to have
  new printers configured with system-config-printer working.
  Fix bnc#433634.
- Add system-config-printer-hide-my-default-printer.patch to hide
  my-default-printer from the menus. Note that
  system-config-printer already provides this functionality.
- Update system-config-printer-policykit.patch so that we don't
  show the old password prompt after changing something in a
  printer.
- Obsoletes gnome-cups-manager. No Provides, since it's not the
  same application...
* Thu Oct 23 2008 vuntz@novell.com
- Add system-config-printer-cups-autoconfig-notifications.patch.
  We display notifications for printers automatically configured
  by cups-autoconfig. This is the missing piece for dropping
  gnome-volume-manager.
* Fri Oct 17 2008 vuntz@novell.com
- Update to version 1.0.8:
  + Handle IPP_FORBIDDEN.
  + Use modelName from custom PPD to suggest name for new printer.
  + Avoid display problem with installable options.
  + Better matching for Lexmark printers.
  + Catch exceptions from advanced server settings dialog.
  + Added some missing OpenPrinting query fields.
  + Jockey support added.
  + Updated translations.
  (summary of changes taken from the Fedora package)
- Remove system-config-printer-forbidden.patch: fixed upstream.
- Add pysmbc-bnc433994-crash.patch to potentially fix a crash when
  browsing smb printers. Should fix bnc#433994.
- Add system-config-printer-git1.0.x.patch to include fixes from
  the 1.0.x branch. This fixes some crashes, and some SMB
  authentication issues. Should fix bnc#433992.
- Add system-config-printer-git1.0.x-po.patch to include updated
  translations from the 1.0.x branch.
- Update system-config-printer-icon-brp-friendly.patch.
* Thu Oct 16 2008 vuntz@novell.com
- Add more categories to my-default-printer.desktop and
  system-config-printer.desktop so that they appear in the control
  center. Fix bnc#433605.
* Fri Oct 03 2008 vuntz@novell.com
- Use %%{py_sitedir} instead of %%{_libdir}/python*/site-packages
* Fri Sep 26 2008 vuntz@novell.com
- Implement fate#4161 and fate#4162:
  + add cups-pk-helper, which is a PolicyKit helper implementing
  some parts of the API exposed by pycups.
  + add system-config-printer-policykit.patch that adds a "backend"
  for system-config-printer to use cups-pk-helper to do the CUPS
  calls.
- It's been discussed a bit with upstream, but no agreement was
  reached on this so far. The patch is not intrusive, so it's the
  best solution right now. I'll try to push it again upstream.
* Wed Sep 17 2008 vuntz@suse.de
- Copy the printer icon from gnome-icon-theme and use it as
  system-config-printer in all desktop files. Add
  system-config-printer-icon-brp-friendly.patch for this.
- Clean up packaging, and use fdupes.
* Wed Sep 10 2008 vuntz@suse.de
- Push to Factory.
* Fri Sep 05 2008 vuntz@novell.com
- Add missing system-config-printer-forbidden.patch.
- Add system-config-printer-install-python.patch to install python
  files where they should live. Also fixes the issue where the
  programs couldn't be run (because they were not +x).
* Fri Sep 05 2008 vuntz@novell.com
- Update to version 1.0.7.
  + See ChangeLog for details.
- Update pycups to 1.9.42 and pysmbc to 1.0.5.
- Remove pysmbc-debug.patch (fixed upstream) and take
  system-config-printer-forbidden.patch from Fedora package.
* Wed Aug 27 2008 vuntz@novell.com
- Update to version 1.0.6.
  + See ChangeLog for details.
* Wed Jul 30 2008 vuntz@novell.com
- Import package, based on the one from fedora and one the one on
  from home:chrismrivera in the build service.
openSUSE Build Service is sponsored by