rpms/kdeutils/F-11 kdeutils-4.4.1-printer-applet-InstallPrinterDrivers.patch, NONE, 1.1 kdeutils.spec, 1.186, 1.187 kdeutils-4.2.85-pykde4.patch, 1.1, NONE

Rex Dieter rdieter at fedoraproject.org
Thu Mar 25 14:54:05 UTC 2010


Author: rdieter

Update of /cvs/pkgs/rpms/kdeutils/F-11
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv17374

Modified Files:
	kdeutils.spec 
Added Files:
	kdeutils-4.4.1-printer-applet-InstallPrinterDrivers.patch 
Removed Files:
	kdeutils-4.2.85-pykde4.patch 
Log Message:
* Thu Mar 25 2010 Rex Dieter <rdieter at fedoraproject.org> - 6:4.4.1-3
- BR: kdebase-devel
- drop old pykde4 patch


kdeutils-4.4.1-printer-applet-InstallPrinterDrivers.patch:
 CMakeLists.txt    |    1 
 installdriver.py  |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 printer-applet.py |   10 +++++++++
 3 files changed, 71 insertions(+)

--- NEW FILE kdeutils-4.4.1-printer-applet-InstallPrinterDrivers.patch ---
diff -up kdeutils-4.4.1/printer-applet/CMakeLists.txt.InstallPrinterDrivers kdeutils-4.4.1/printer-applet/CMakeLists.txt
--- kdeutils-4.4.1/printer-applet/CMakeLists.txt.InstallPrinterDrivers	2009-08-12 10:59:22.000000000 +0100
+++ kdeutils-4.4.1/printer-applet/CMakeLists.txt	2010-03-24 17:35:19.174516425 +0000
@@ -34,6 +34,7 @@ IF(INSTALL_PRINTER_APPLET)
         monitor.py
         authconn.py
         debug.py
+        installdriver.py
         DESTINATION ${DATA_INSTALL_DIR}/printer-applet )
     PYKDE4_ADD_EXECUTABLE(printer-applet.py printer-applet)
     install(FILES printer-applet.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
diff -up kdeutils-4.4.1/printer-applet/installdriver.py.InstallPrinterDrivers kdeutils-4.4.1/printer-applet/installdriver.py
--- kdeutils-4.4.1/printer-applet/installdriver.py.InstallPrinterDrivers	2010-03-24 17:35:19.175516691 +0000
+++ kdeutils-4.4.1/printer-applet/installdriver.py	2010-03-24 17:35:19.176515999 +0000
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+
+## system-config-printer
+
+## Copyright (C) 2010 Red Hat, Inc.
+## Author: Tim Waugh <twaugh at redhat.com>
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+import dbus
+import dbus.glib
+import dbus.service
+
+class PrinterDriversInstaller(dbus.service.Object):
+    DBUS_PATH  = "/com/redhat/PrinterDriversInstaller"
+    DBUS_IFACE = "com.redhat.PrinterDriversInstaller"
+    DBUS_OBJ   = "com.redhat.PrinterDriversInstaller"
+
+    def __init__ (self, bus):
+        self.bus = bus
+        bus_name = dbus.service.BusName (self.DBUS_OBJ, bus=bus)
+        dbus.service.Object.__init__ (self, bus_name, self.DBUS_PATH)
+
+    @dbus.service.method(DBUS_IFACE,
+                         in_signature="sss",
+                         async_callbacks=("reply_handler",
+                                          "error_handler"))
+    def InstallDrivers (self, mfg, mdl, cmd,
+                       reply_handler, error_handler):
+        bus = dbus.SessionBus ()
+        obj = bus.get_object ("org.freedesktop.PackageKit",
+                              "/org/freedesktop/PackageKit")
+        proxy = dbus.Interface (obj, "org.freedesktop.PackageKit.Modify")
+        proxy.InstallPrinterDrivers (0, ["MFG:%s;MDL:%s;" % (mfg, mdl)],
+                                     "hide-finished",
+                                     reply_handler=reply_handler,
+                                     error_handler=error_handler,
+                                     timeout=3600)
+
+if __name__ == "__main__":
+    bus = dbus.SystemBus ()
+    import sys
+    if len (sys.argv) < 2 or sys.argv[1] == "--client":
+        # Client
+        obj = bus.get_object (PrinterDriversInstaller.DBUS_OBJ,
+                              PrinterDriversInstaller.DBUS_PATH)
+        proxy = dbus.Interface (obj, PrinterDriversInstaller.DBUS_IFACE)
+        print proxy.InstallDrivers ("MFG", "MDL", "CMD")
diff -up kdeutils-4.4.1/printer-applet/printer-applet.py.InstallPrinterDrivers kdeutils-4.4.1/printer-applet/printer-applet.py
--- kdeutils-4.4.1/printer-applet/printer-applet.py.InstallPrinterDrivers	2010-01-31 19:34:24.000000000 +0000
+++ kdeutils-4.4.1/printer-applet/printer-applet.py	2010-03-24 17:36:22.429515862 +0000
@@ -66,6 +66,7 @@ import dbus.service
 from statereason import StateReason
 import monitor
 import authconn
+import installdriver
 from debug import *
 
 class PrinterURIIndex:
@@ -298,6 +299,15 @@ class JobManager(QObject, monitor.Watche
         except ImportError:
             pass  # cupshelpers not installed, no new printer notification will be shown
 
+        try:
+            installdriver.PrinterDriversInstaller(bus)
+        except Exception, e:
+            try:
+                print >> sys.stderr, ("failed to start PrinterDriversInstaller "
+                                      "service: %s" % e)
+            except:
+                pass
+
     def cleanup (self):
         self.monitor.cleanup ()
         if self.exit_handler:


Index: kdeutils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdeutils/F-11/kdeutils.spec,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -p -r1.186 -r1.187
--- kdeutils.spec	2 Mar 2010 15:25:33 -0000	1.186
+++ kdeutils.spec	25 Mar 2010 14:54:04 -0000	1.187
@@ -6,7 +6,7 @@
 Name:           kdeutils
 Epoch:          6
 Version:        4.4.1
-Release:        1%{?dist}
+Release:        3%{?dist}
 Summary:        KDE Utilities
 
 Group:          Applications/System
@@ -16,7 +16,8 @@ URL:            http://www.kde.org
 Source0:        ftp://ftp.kde.org/pub/kde/stable/%{version}/src/%{name}-%{version}.tar.bz2
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-Patch1:         kdeutils-4.2.85-pykde4.patch
+# add support for automatic printer driver installation (Tim Waugh, #576660)
+Patch0:         kdeutils-4.4.1-printer-applet-InstallPrinterDrivers.patch
 
 ## upstreamed patches
 
@@ -25,6 +26,7 @@ Patch1:         kdeutils-4.2.85-pykde4.p
 
 # FIXME/TODO: Tpctl is needed for klaptopdaemon
 BuildRequires:  desktop-file-utils
+BuildRequires:  kdebase-devel >= %{version}
 BuildRequires:  kdebase-workspace-devel >= %{version}
 BuildRequires:  kdepimlibs-devel >= %{version}
 BuildRequires:  plasma-devel >= %{version}
@@ -36,12 +38,7 @@ BuildRequires:  qca2-devel
 BuildRequires:  qimageblitz-devel
 BuildRequires:  xz-devel
 
-%if 0%{?printer_applet}
-%if 0%{?fedora} &&  0%{?fedora} < 11
-# upgrade path so it doesn't get lost
-Requires: %{name}-printer-applet = %{epoch}:%{version}-%{release}
-%endif
-%else
+%if ! 0%{?printer_applet}
 Obsoletes: %{name}-printer-applet < %{epoch}:%{version}-%{release}
 %endif
 
@@ -81,7 +78,8 @@ Requires: kdelibs4%{?_isa} >= %{version}
 %package printer-applet
 Summary:  KDE printer applet
 Group:    Applications/System
-Requires: PyKDE4 
+Requires: PyKDE4
+Requires: dbus-python
 Requires: hal-cups-utils
 Requires: system-config-printer-libs
 %description printer-applet
@@ -90,9 +88,10 @@ Requires: system-config-printer-libs
 
 %prep
 %setup -q -n kdeutils-%{version}
+%if 0%{?fedora} > 12
+%patch0 -p1 -b .InstallPrinterDrivers
+%endif
 
-# NEEDSWORK
-#patch1 -p1 -b .pykde4
 
 %build
 
@@ -190,7 +189,7 @@ fi
 %{_kde4_datadir}/kde4/services/*
 %{_kde4_datadir}/kde4/servicetypes/*
 %{_kde4_datadir}/applications/kde4/*.desktop
-%{_kde4_docdir}/HTML/en/*
+%{_kde4_docdir}/HTML/en/*/
 %{_kde4_iconsdir}/hicolor/*/apps/*
 %{_kde4_iconsdir}/oxygen/*/*/*
 %{_datadir}/dbus-1/interfaces/*
@@ -215,6 +214,16 @@ fi
 
 
 %changelog
+* Thu Mar 25 2010 Rex Dieter <rdieter at fedoraproject.org> - 6:4.4.1-3
+- BR: kdebase-devel
+- drop old pykde4 patch
+
+* Wed Mar 24 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 6:4.4.1-2
+- -printer-applet: add support for automatic printer driver installation
+                   (Tim Waugh, #576660, F13+)
+- -printer-applet: add missing Requires: dbus-python
+- remove obsolete F10- upgrade path Requires for -printer-applet
+
 * Sat Feb 27 2010 Rex Dieter <rdieter at fedoraproject.org> - 6:4.4.1-1
 - 4.4.1
 


--- kdeutils-4.2.85-pykde4.patch DELETED ---



More information about the scm-commits mailing list