rpms/gvfs/devel gvfs-gdu.patch,NONE,1.1 gvfs.spec,1.109,1.110
Matthias Clasen
mclasen at fedoraproject.org
Tue Mar 3 04:46:59 UTC 2009
Author: mclasen
Update of /cvs/pkgs/rpms/gvfs/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3570
Modified Files:
gvfs.spec
Added Files:
gvfs-gdu.patch
Log Message:
Port to DeviceKit-disks
gvfs-gdu.patch:
--- NEW FILE gvfs-gdu.patch ---
Index: configure.ac
===================================================================
--- configure.ac (revision 2275)
+++ configure.ac (working copy)
@@ -198,6 +198,31 @@
AM_CONDITIONAL(USE_GCONF, [test "$msg_gconf" = "yes"])
+dnl ************************************
+dnl *** Check for gnome-disk-utility ***
+dnl ************************************
+
+dnl TODO: when there is a more stable version of gdu available, turn this on by default
+AC_ARG_ENABLE(gdu, [ --enable-gdu build with gdu support])
+msg_gdu=no
+GDU_LIBS=
+GDU_CFLAGS=
+GDU_REQUIRED=0.2
+
+if test "x$enable_gdu" = "xyes"; then
+ PKG_CHECK_EXISTS([gdu >= $GDU_REQUIRED], msg_gdu=yes)
+
+ if test "x$msg_gdu" == "xyes"; then
+ PKG_CHECK_MODULES([GDU],[gdu >= $GDU_REQUIRED])
+ AC_DEFINE(HAVE_GDU, 1, [Define to 1 if gnome-disk-utility is available])
+ fi
+fi
+
+AC_SUBST(GDU_LIBS)
+AC_SUBST(GDU_CFLAGS)
+
+AM_CONDITIONAL(USE_GDU, [test "$msg_gdu" = "yes"])
+
dnl **********************
dnl *** Check for HAL ***
dnl **********************
@@ -558,6 +583,7 @@
monitor/Makefile
monitor/proxy/Makefile
monitor/hal/Makefile
+monitor/gdu/Makefile
monitor/gphoto2/Makefile
gconf/Makefile
programs/Makefile
@@ -579,7 +605,8 @@
archive support: $msg_archive
GConf support: $msg_gconf
DNS-SD support: $msg_avahi
- Use HAL for volume monitor: $msg_hal (with fast init path: $have_hal_fast_init)
+ Build HAL volume monitor: $msg_hal (with fast init path: $have_hal_fast_init)
+ Build GDU volume monitor: $msg_gdu
GNOME Keyring support: $msg_keyring
Bash-completion support: $msg_bash_completion
"
Index: monitor/Makefile.am
===================================================================
--- monitor/Makefile.am (revision 2275)
+++ monitor/Makefile.am (working copy)
@@ -5,6 +5,10 @@
SUBDIRS += hal
endif
+if USE_GDU
+SUBDIRS += gdu
+endif
+
if USE_GPHOTO2
SUBDIRS += gphoto2
endif
--- /dev/null 2009-03-02 15:45:22.087299058 -0500
+++ monitor/gdu/gdu-volume-monitor-daemon.c 2009-03-01 23:47:15.000000000 -0500
@@ -0,0 +1,46 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* gvfs - extensions for gio
+ *
+ * Copyright (C) 2006-2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: David Zeuthen <davidz at redhat.com>
+ */
+
+#include <config.h>
+
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+#include <gmodule.h>
+#include <gio/gio.h>
+
+#include <gvfsproxyvolumemonitordaemon.h>
+
+#include "ggduvolumemonitor.h"
+
+int
+main (int argc, char *argv[])
+{
+ g_vfs_proxy_volume_monitor_daemon_init ();
+
+ g_set_application_name (_("GVfs GDU Volume Monitor"));
+
+ return g_vfs_proxy_volume_monitor_daemon_main (argc,
+ argv,
+ "org.gtk.Private.GduVolumeMonitor",
+ G_TYPE_GDU_VOLUME_MONITOR);
+}
--- /dev/null 2009-03-02 15:45:22.087299058 -0500
+++ monitor/gdu/ggdudrive.c 2009-03-01 23:48:33.000000000 -0500
@@ -0,0 +1,691 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* gvfs - extensions for gio
+ *
+ * Copyright (C) 2006-2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: David Zeuthen <davidz at redhat.com>
+ */
+
+#include <config.h>
+
+#include <string.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+
+#include "ggduvolumemonitor.h"
+#include "ggdudrive.h"
+#include "ggduvolume.h"
+
+struct _GGduDrive {
+ GObject parent;
+
+ GVolumeMonitor *volume_monitor; /* owned by volume monitor */
+ GList *volumes; /* entries in list are owned by volume_monitor */
+
+ GduPresentable *presentable;
+
+ /* the following members need to be set upon construction */
+ GIcon *icon;
+ gchar *name;
+ gchar *device_file;
+ gboolean is_media_removable;
+ gboolean has_media;
+ gboolean can_eject;
+ gboolean can_poll_for_media;
+ gboolean is_media_check_automatic;
+ time_t time_of_last_media_insertion;
+};
+
+static void g_gdu_drive_drive_iface_init (GDriveIface *iface);
+
+G_DEFINE_TYPE_EXTENDED (GGduDrive, g_gdu_drive, G_TYPE_OBJECT, 0,
+ G_IMPLEMENT_INTERFACE (G_TYPE_DRIVE,
+ g_gdu_drive_drive_iface_init))
+
+static void presentable_changed (GduPresentable *presentable,
+ GGduDrive *drive);
+
+static void presentable_job_changed (GduPresentable *presentable,
+ GGduDrive *drive);
+
+static void
+g_gdu_drive_finalize (GObject *object)
+{
+ GList *l;
+ GGduDrive *drive;
+
+ drive = G_GDU_DRIVE (object);
+
+ for (l = drive->volumes; l != NULL; l = l->next)
+ {
[...4760 lines suppressed...]
+ "Error parsing reply for ObtainAuthorization(): %s: %s",
+ derror.name, derror.message);
+ dbus_error_free (&derror);
+ goto out;
+ }
+
+ if (!gained_authz && error == NULL)
+ {
+ /* no need to translate, is never shown */
+ g_simple_async_result_set_error (simple,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED_HANDLED,
+ "Didn't obtain authorization (bug in libgio user, it shouldn't display this error)");
+ }
+
+ out:
+ g_simple_async_result_complete (simple);
+ g_object_unref (simple);
+}
+
+
+gboolean
+_obtain_authz_finish (GAsyncResult *res,
+ GError **error)
+{
+ GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
+
+ g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == _obtain_authz);
+
+ if (g_simple_async_result_propagate_error (simple, error))
+ return FALSE;
+ else
+ return TRUE;
+}
+
+void
+_obtain_authz (const gchar *action_id,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ DBusConnection *connection;
+ DBusMessage *message;
+ GSimpleAsyncResult *simple;
+ guint xid;
+ guint pid;
+ DBusError derror;
+
+ dbus_error_init (&derror);
+
+ /* this connection is already integrated and guaranteed to exist, see gvfsproxyvolumemonitordaemon.c */
+ connection = dbus_bus_get (DBUS_BUS_SESSION, &derror);
+
+ simple = g_simple_async_result_new (NULL,
+ callback,
+ user_data,
+ _obtain_authz);
+
+ message = dbus_message_new_method_call ("org.freedesktop.PolicyKit.AuthenticationAgent", /* bus name */
+ "/", /* object */
+ "org.freedesktop.PolicyKit.AuthenticationAgent", /* interface */
+ "ObtainAuthorization");
+
+ xid = 0;
+ pid = getpid ();
+
+ dbus_message_append_args (message,
+ DBUS_TYPE_STRING,
+ &(action_id),
+ DBUS_TYPE_UINT32,
+ &(xid),
+ DBUS_TYPE_UINT32,
+ &(pid),
+ DBUS_TYPE_INVALID);
+
+ _g_dbus_connection_call_async (connection,
+ message,
+ -1,
+ (GAsyncDBusCallback) _obtain_authz_cb,
+ simple);
+ dbus_message_unref (message);
+ dbus_connection_unref (connection);
+}
--- /dev/null 2009-03-02 15:45:22.087299058 -0500
+++ monitor/gdu/polkit.h 2009-03-01 23:47:41.000000000 -0500
@@ -0,0 +1,44 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* gvfs - extensions for gio
+ *
+ * Copyright (C) 2006-2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: David Zeuthen <davidz at redhat.com>
+ */
+
+
+#ifndef __POLKIT_H__
+#define __POLKIT_H__
+
+#include <glib-object.h>
+#include <gio/gio.h>
+#include <polkit/polkit.h>
+
+G_BEGIN_DECLS
+
+void _obtain_authz (const gchar *action_id,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean _obtain_authz_finish (GAsyncResult *res,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* __POLKIT_H__ */
--- /dev/null 2009-03-02 15:45:22.087299058 -0500
+++ monitor/gdu/Makefile.am 2009-03-01 21:13:46.000000000 -0500
@@ -0,0 +1,53 @@
+
+NULL =
+
+libexec_PROGRAMS = gvfs-gdu-volume-monitor
+
+
+gvfs_gdu_volume_monitor_SOURCES = \
+ gdu-volume-monitor-daemon.c \
+ ggdudrive.c ggdudrive.h \
+ ggduvolume.c ggduvolume.h \
+ ggdumount.c ggdumount.h \
+ ggduvolumemonitor.c ggduvolumemonitor.h \
+ polkit.c polkit.h \
+ $(NULL)
+
+gvfs_gdu_volume_monitor_CFLAGS = \
+ -DG_LOG_DOMAIN=\"GVFS-Gdu\" \
+ -I$(top_srcdir)/common \
+ -I$(top_srcdir)/monitor/proxy \
+ $(GLIB_CFLAGS) \
+ $(GDU_CFLAGS) \
+ $(DBUS_CFLAGS) \
+ -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \
+ -DGVFS_LOCALEDIR=\""$(localedir)"\" \
+ -DG_DISABLE_DEPRECATED \
+ -DGDU_API_IS_SUBJECT_TO_CHANGE \
+ $(NULL)
+
+gvfs_gdu_volume_monitor_LDFLAGS = \
+ $(NULL)
+
+gvfs_gdu_volume_monitor_LDADD = \
+ $(GLIB_LIBS) \
+ $(GDU_LIBS) \
+ $(DBUS_LIBS) \
+ $(top_builddir)/common/libgvfscommon.la \
+ $(top_builddir)/monitor/proxy/libgvfsproxyvolumemonitordaemon-noin.la \
+ $(NULL)
+
+remote_volume_monitorsdir = $(datadir)/gvfs/remote-volume-monitors
+remote_volume_monitors_DATA = gdu.monitor
+
+servicedir = $(datadir)/dbus-1/services
+service_in_files = org.gtk.Private.GduVolumeMonitor.service.in
+service_DATA = $(service_in_files:.service.in=.service)
+
+$(service_DATA): $(service_in_files) Makefile
+ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+
+clean-local:
+ rm -f *~ *.loT $(BUILT_SOURCES) $(service_DATA)
+
+EXTRA_DIST = $(service_in_files) gdu.monitor
--- /dev/null 2009-03-02 15:45:22.087299058 -0500
+++ monitor/gdu/gdu.monitor 2009-02-11 06:42:26.000000000 -0500
@@ -0,0 +1,5 @@
+[RemoteVolumeMonitor]
+Name=GProxyVolumeMonitorGdu
+DBusName=org.gtk.Private.GduVolumeMonitor
+IsNative=true
+NativePriority=3
--- /dev/null 2009-03-02 15:45:22.087299058 -0500
+++ monitor/gdu/org.gtk.Private.GduVolumeMonitor.service.in 2009-02-19 22:34:26.000000000 -0500
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gtk.Private.GduVolumeMonitor
+Exec=@libexecdir@/gvfs-gdu-volume-monitor
Index: gvfs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gvfs/devel/gvfs.spec,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- gvfs.spec 2 Mar 2009 16:34:21 -0000 1.109
+++ gvfs.spec 3 Mar 2009 04:46:29 -0000 1.110
@@ -1,7 +1,7 @@
Summary: Backends for the gio framework in GLib
Name: gvfs
Version: 1.1.7
-Release: 1%{?dist}
+Release: 2%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.gtk.org
@@ -9,7 +9,7 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: pkgconfig
BuildRequires: glib2-devel >= 2.19.2
-BuildRequires: dbus-glib-devel
+BuildRequires: dbus-glib-devel
BuildRequires: /usr/bin/ssh
BuildRequires: libcdio-devel >= 0.78.2
BuildRequires: hal-devel >= 0.5.10
@@ -18,8 +18,8 @@
BuildRequires: gnome-keyring-devel
BuildRequires: intltool
BuildRequires: gettext-devel
-BuildRequires: perl(XML::Parser)
BuildRequires: GConf2-devel
+BuildRequires: gnome-disk-utility-devel >= 0.2
Requires(post): desktop-file-utils
@@ -31,10 +31,12 @@
# http://bugzilla.gnome.org/show_bug.cgi?id=567235
Patch1: gvfs-0.99.2-archive-integration.patch
+# http://bugzilla.gnome.org/show_bug.cgi?id=573826
+Patch2: gvfs-gdu.patch
%description
-The gvfs package provides backend implementations for the gio
-framework in GLib. It includes ftp, sftp, cifs.
+The gvfs package provides backend implementations for the gio
+framework in GLib. It includes ftp, sftp, cifs.
%package devel
@@ -113,6 +115,7 @@
%prep
%setup -q
%patch1 -p0 -b .archive-integration
+%patch2 -p0 -b .gdu
%build
@@ -123,7 +126,7 @@
automake || :
autoconf || :
-%configure
+%configure --enable-gdu
make # %{?_smp_mflags}
%install
@@ -170,7 +173,9 @@
%{_datadir}/gvfs/mounts/ftp.mount
%{_datadir}/dbus-1/services/gvfs-daemon.service
%{_datadir}/dbus-1/services/org.gtk.Private.HalVolumeMonitor.service
+%{_datadir}/dbus-1/services/org.gtk.Private.GduVolumeMonitor.service
%{_datadir}/gvfs/remote-volume-monitors/hal.monitor
+%{_datadir}/gvfs/remote-volume-monitors/gdu.monitor
%{_libdir}/libgvfscommon.so.*
%{_libdir}/libgvfscommon-dnssd.so.*
# %{_libdir}/gio/modules/libgiohal-volume-monitor.so
@@ -190,6 +195,7 @@
%{_libexecdir}/gvfsd-dnssd
%{_libexecdir}/gvfsd-network
%{_libexecdir}/gvfs-hal-volume-monitor
+%{_libexecdir}/gvfs-gdu-volume-monitor
%{_bindir}/gvfs-cat
%{_bindir}/gvfs-copy
%{_bindir}/gvfs-info
@@ -253,6 +259,9 @@
%changelog
+* Mon Mar 2 2009 Matthias Clasen <mclasen at redhat.com> - 1.1.7-2
+- Port to DeviceKit-disks
+
* Mon Mar 2 2009 Tomas Bzatek <tbzatek at redhat.com> - 1.1.7-1
- Update to 1.1.7
More information about the fedora-extras-commits
mailing list