rpms/gnome-power-manager/devel gnome-power-manager-port-to-polkit1.patch, NONE, 1.1 gnome-power-manager.spec, 1.161, 1.162
Richard Hughes
rhughes at fedoraproject.org
Tue Jun 16 12:34:59 UTC 2009
- Previous message (by thread): rpms/rt3/EL-5 .cvsignore, 1.6, 1.7 README.fedora.in, 1.2, 1.3 rt3.spec, 1.25, 1.26 sources, 1.8, 1.9
- Next message (by thread): rpms/samba/F-11 .cvsignore, 1.61, 1.62 samba.spec, 1.184, 1.185 sources, 1.65, 1.66
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: rhughes
Update of /cvs/pkgs/rpms/gnome-power-manager/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27560
Modified Files:
gnome-power-manager.spec
Added Files:
gnome-power-manager-port-to-polkit1.patch
Log Message:
* Tue Jun 16 2009 Richard Hughes <rhughes at redhat.com> - 2.27.2-0.2.20090616git
- Apply a patch to convert to the PolKit1 API.
- Do autoreconf as the polkit patch is pretty invasive
gnome-power-manager-port-to-polkit1.patch:
--- NEW FILE gnome-power-manager-port-to-polkit1.patch ---
diff --git a/configure.ac b/configure.ac
index 0c0911c..0ff2c05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,7 +99,6 @@ CAIRO_REQUIRED=1.0.0
UNIQUE_REQUIRED=0.9.4
LIBPANEL_REQUIRED=2.0.0
XRANDR_REQUIRED=1.2.0
-POLKIT_GNOME_REQUIRED=0.8
CANBERRA_REQUIRED=0.10
DEVKIT_REQUIRED=001
DEVKIT_POWER_REQUIRED=008
@@ -118,7 +117,6 @@ AC_SUBST(CAIRO_REQUIRED)
AC_SUBST(UNIQUE_REQUIRED)
AC_SUBST(LIBPANEL_REQUIRED)
AC_SUBST(XRANDR_REQUIRED)
-AC_SUBST(POLKIT_GNOME_REQUIRED)
dnl ---------------------------------------------------------------------------
dnl - Check library dependencies
@@ -223,29 +221,6 @@ fi
AC_SUBST(DOCDIR)
dnl ---------------------------------------------------------------------------
-dnl - PolicyKit support?
-dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(policykit,
- AS_HELP_STRING([--enable-policykit],
- [support PolicyKit permissions daemon (requires polkitd)]),
- enable_policykit=$enableval,enable_policykit=no)
-
-AC_MSG_CHECKING([whether to support PolicyKit])
-have_polkit=no
-if test x$enable_policykit = xyes ; then
- PKG_CHECK_MODULES(POLKIT, \
- polkit-grant >= $POLKIT_GNOME_REQUIRED\
- polkit-dbus >= $POLKIT_GNOME_REQUIRED)
- AC_SUBST(POLKIT_CFLAGS)
- AC_SUBST(POLKIT_LIBS)
- have_polkit=yes
- AC_DEFINE(HAVE_POLKIT, 1, [Define if we use PolicyKit])
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-
-dnl ---------------------------------------------------------------------------
dnl - Require DeviceKit-power support
dnl ---------------------------------------------------------------------------
AC_PATH_PROG(DEVKIT_POWER, devkit-power)
@@ -311,17 +286,11 @@ dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(gconf-defaults,
AS_HELP_STRING([--disable-gconf-defaults],
[Allow setting gconf default settings]),
- enable_gconfdefaults=$enableval,enable_gconfdefaults=yes)
+ have_gconfdefaults=$enableval,have_gconfdefaults=yes)
AC_MSG_CHECKING([whether to support gconf defaults])
-have_gconfdefaults=no
-if test x$enable_gconfdefaults = xyes && test $have_polkit = yes ; then
- PKG_CHECK_MODULES(POLKIT_GNOME, [
- polkit-gnome >= $POLKIT_GNOME_REQUIRED])
- AC_SUBST(POLKIT_GNOME_CFLAGS)
- AC_SUBST(POLKIT_GNOME_LIBS)
- have_gconfdefaults=yes
- AC_DEFINE(HAVE_GCONF_DEFAULTS, 1, [Define if have policykit-gnome])
+if test x$have_gconfdefaults = xyes ; then
+ AC_DEFINE(HAVE_GCONF_DEFAULTS, 1, [Define if have gconf defaults])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
@@ -673,7 +642,6 @@ echo "
cflags: ${CFLAGS}
Building extra applets: ${enable_applets}
DPMS support: ${have_dpms}
- PolicyKit support: ${have_polkit}
Legacy buttons support: ${have_legacy_buttons}
Self test support: ${have_tests}
GConf default support: ${have_gconfdefaults}
diff --git a/data/gpm-prefs.ui b/data/gpm-prefs.ui
index d9cc83e..f381f85 100644
--- a/data/gpm-prefs.ui
+++ b/data/gpm-prefs.ui
@@ -1180,6 +1180,19 @@
</packing>
</child>
<child>
+ <object class="GtkButton" id="button_defaults">
+ <property name="label" translatable="yes">Make Default</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkButton" id="button_close">
<property name="label">gtk-close</property>
<property name="visible">True</property>
@@ -1192,7 +1205,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
@@ -1206,6 +1219,7 @@
</child>
<action-widgets>
<action-widget response="0">button_help</action-widget>
+ <action-widget response="0">button_defaults</action-widget>
<action-widget response="0">button_close</action-widget>
</action-widgets>
</object>
diff --git a/src/gpm-control.c b/src/gpm-control.c
index 043b667..21eb85a 100644
--- a/src/gpm-control.c
+++ b/src/gpm-control.c
@@ -43,11 +43,6 @@
#include <gconf/gconf-client.h>
#include <devkit-power-gobject/devicekit-power.h>
-#ifdef HAVE_POLKIT
-#include <polkit/polkit.h>
-#include <polkit-dbus/polkit-dbus.h>
-#endif
-
#include "egg-debug.h"
#include "egg-console-kit.h"
@@ -91,29 +86,6 @@ gpm_control_error_quark (void)
}
/**
- * gpm_control_is_user_privileged:
- * @polkit: This polkit class instance
- * Return value: Success value.
- **/
-static gboolean
-gpm_control_is_user_privileged (GpmControl *control, const gchar *privilege)
-{
- gboolean ret = TRUE;
-#ifdef HAVE_POLKIT
- polkit_uint64_t mask;
- pid_t pid;
-
- pid = getpid ();
- mask = polkit_check_auth (pid, privilege, NULL);
- if (mask == 0) {
- egg_warning ("failed to authorise for privilege %s", privilege);
- ret = FALSE;
- }
-#endif
- return ret;
-}
-
-/**
* gpm_control_check_foreground_console:
* @manager: This class instance
* @action: The action we want to do, e.g. "suspend"
@@ -158,19 +130,17 @@ gboolean
gpm_control_allowed_suspend (GpmControl *control, gboolean *can, GError **error)
{
gboolean conf_ok;
- gboolean polkit_ok;
gboolean hardware_ok;
gboolean fg;
g_return_val_if_fail (can, FALSE);
*can = FALSE;
conf_ok = gconf_client_get_bool (control->priv->conf, GPM_CONF_CAN_SUSPEND, NULL);
- polkit_ok = gpm_control_is_user_privileged (control, "org.freedesktop.devicekit.power.suspend");
hardware_ok = dkp_client_can_suspend (control->priv->client);
fg = gpm_control_check_foreground_console (control);
- if (conf_ok && hardware_ok && polkit_ok && fg)
+ if (conf_ok && hardware_ok && fg)
*can = TRUE;
- egg_debug ("conf=%i, polkit=%i, fg=%i, can=%i", conf_ok, polkit_ok, fg, *can);
+ egg_debug ("conf=%i, fg=%i, can=%i", conf_ok, fg, *can);
return TRUE;
}
@@ -186,7 +156,6 @@ gboolean
gpm_control_allowed_hibernate (GpmControl *control, gboolean *can, GError **error)
{
gboolean conf_ok;
- gboolean polkit_ok;
gboolean hardware_ok;
gboolean fg;
g_return_val_if_fail (can, FALSE);
@@ -194,11 +163,10 @@ gpm_control_allowed_hibernate (GpmControl *control, gboolean *can, GError **erro
*can = FALSE;
conf_ok = gconf_client_get_bool (control->priv->conf, GPM_CONF_CAN_HIBERNATE, NULL);
fg = gpm_control_check_foreground_console (control);
- polkit_ok = gpm_control_is_user_privileged (control, "org.freedesktop.devicekit.power.hibernate");
hardware_ok = dkp_client_can_hibernate (control->priv->client);
- if (conf_ok && hardware_ok && polkit_ok && fg)
+ if (conf_ok && hardware_ok && fg)
*can = TRUE;
- egg_debug ("conf=%i, polkit=%i, fg=%i, can=%i", conf_ok, polkit_ok, fg, *can);
+ egg_debug ("conf=%i, fg=%i, can=%i", conf_ok, fg, *can);
return TRUE;
}
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index ccf6375..ba09df0 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -43,10 +43,6 @@
#include "gpm-stock-icons.h"
#include "gpm-prefs-server.h"
-#ifdef HAVE_GCONF_DEFAULTS
-#include <polkit-gnome/polkit-gnome.h>
-#endif
-
static void gpm_prefs_finalize (GObject *object);
#define GPM_PREFS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_PREFS, GpmPrefsPrivate))
@@ -66,9 +62,6 @@ struct GpmPrefsPrivate
gboolean can_hibernate;
guint idle_delay;
GConfClient *conf;
-#ifdef HAVE_GCONF_DEFAULTS
- PolKitGnomeAction *default_action;
-#endif
};
enum {
@@ -186,8 +179,7 @@ out:
* @prefs: This prefs class instance
**/
static void
-gpm_prefs_help_cb (GtkWidget *widget,
- GpmPrefs *prefs)
+gpm_prefs_help_cb (GtkWidget *widget, GpmPrefs *prefs)
{
egg_debug ("emitting action-help");
g_signal_emit (prefs, signals [ACTION_HELP], 0);
@@ -198,8 +190,7 @@ gpm_prefs_help_cb (GtkWidget *widget,
* @widget: The GtkWidget object
**/
static void
-gpm_prefs_icon_radio_cb (GtkWidget *widget,
- GpmPrefs *prefs)
+gpm_prefs_icon_radio_cb (GtkWidget *widget, GpmPrefs *prefs)
{
const gchar *str;
gint policy;
@@ -216,8 +207,7 @@ gpm_prefs_icon_radio_cb (GtkWidget *widget,
* @value: The value in %.
**/
static gchar *
-gpm_prefs_format_percentage_cb (GtkScale *scale,
- gdouble value)
+gpm_prefs_format_percentage_cb (GtkScale *scale, gdouble value)
{
return g_strdup_printf ("%.0f%%", value);
}
@@ -229,9 +219,7 @@ gpm_prefs_format_percentage_cb (GtkScale *scale,
* @prefs: This prefs class instance
**/
static gchar *
-gpm_prefs_format_time_cb (GtkScale *scale,
- gdouble value,
- GpmPrefs *prefs)
+gpm_prefs_format_time_cb (GtkScale *scale, gdouble value, GpmPrefs *prefs)
{
gchar *str;
if ((gint) value == NEVER_TIME_ON_SLIDER) {
@@ -248,8 +236,7 @@ gpm_prefs_format_time_cb (GtkScale *scale,
* @gpm_pref_key: The GConf key for this preference setting.
**/
static void
-gpm_prefs_sleep_slider_changed_cb (GtkRange *range,
- GpmPrefs *prefs)
+gpm_prefs_sleep_slider_changed_cb (GtkRange *range, GpmPrefs *prefs)
{
int value;
char *gpm_pref_key;
@@ -919,12 +906,11 @@ prefs_setup_general (GpmPrefs *prefs)
}
}
-#ifdef HAVE_GCONF_DEFAULTS
/**
- * pk_prefs_set_defaults_cb:
+ * gpm_prefs_set_defaults_cb:
**/
static void
-pk_prefs_set_defaults_cb (PolKitGnomeAction *default_action, GpmPrefs *prefs)
+gpm_prefs_set_defaults_cb (GtkWidget *widget, GpmPrefs *prefs)
{
GConfClient *client;
DBusGProxy *proxy;
@@ -966,27 +952,6 @@ pk_prefs_set_defaults_cb (PolKitGnomeAction *default_action, GpmPrefs *prefs)
}
/**
- * gpk_prefs_setup_policykit:
- *
- * We have to do this before the glade stuff if done as the custom handler needs the actions setup
- **/
-static void
-gpk_prefs_setup_policykit (GpmPrefs *prefs)
-{
- PolKitAction *pk_action;
-
- g_return_if_fail (GPM_IS_PREFS (prefs));
-
- /* set default */
- pk_action = polkit_action_new ();
- polkit_action_set_action_id (pk_action, "org.gnome.gconf.defaults.set-system");
- prefs->priv->default_action = polkit_gnome_action_new_default ("set-defaults", pk_action,
- _("Make Default"), NULL);
- polkit_action_unref (pk_action);
-}
-#endif
-
-/**
* gpm_prefs_init:
* @prefs: This prefs class instance
**/
@@ -995,9 +960,6 @@ gpm_prefs_init (GpmPrefs *prefs)
{
GtkWidget *main_window;
GtkWidget *widget;
-#ifdef HAVE_GCONF_DEFAULTS
- GtkWidget *button;
-#endif
gint caps;
guint retval;
GError *error = NULL;
@@ -1037,18 +999,6 @@ gpm_prefs_init (GpmPrefs *prefs)
main_window = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "dialog_preferences"));
-#ifdef HAVE_GCONF_DEFAULTS
- /* we have to do this before we connect up the GtkBuilder file */
- gpk_prefs_setup_policykit (prefs);
-
- /* create PolicyKit button */
- widget = gtk_dialog_get_action_area (GTK_DIALOG (main_window));
- button = polkit_gnome_action_create_button (prefs->priv->default_action);
- gtk_box_pack_start (GTK_BOX (widget), button, FALSE, FALSE, 0);
- gtk_box_reorder_child (GTK_BOX (widget), button, 0);
- gtk_widget_show (button);
-#endif
-
/* Hide window first so that the dialogue resizes itself without redrawing */
gtk_widget_hide (main_window);
gtk_window_set_default_icon_name (GPM_STOCK_APP_ICON);
@@ -1065,9 +1015,12 @@ gpm_prefs_init (GpmPrefs *prefs)
g_signal_connect (widget, "clicked",
G_CALLBACK (gpm_prefs_help_cb), prefs);
+ widget = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder, "button_defaults"));
#ifdef HAVE_GCONF_DEFAULTS
- g_signal_connect (prefs->priv->default_action, "activate",
- G_CALLBACK (pk_prefs_set_defaults_cb), prefs);
+ g_signal_connect (widget, "clicked",
+ G_CALLBACK (gpm_prefs_set_defaults_cb), prefs);
+#else
+ gtk_widget_hide (widget);
#endif
prefs_setup_ac (prefs);
Index: gnome-power-manager.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-power-manager/devel/gnome-power-manager.spec,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -p -r1.161 -r1.162
--- gnome-power-manager.spec 16 Jun 2009 08:21:33 -0000 1.161
+++ gnome-power-manager.spec 16 Jun 2009 12:34:29 -0000 1.162
@@ -6,7 +6,7 @@ Summary: GNOME Power Manager
Name: gnome-power-manager
Version: 2.27.2
#Release: 1%{?dist}
-Release: 0.1.%{?alphatag}git%{?dist}
+Release: 0.2.%{?alphatag}git%{?dist}
License: GPLv2+ and GFDL
Group: Applications/System
#Source: http://download.gnome.org/sources/gnome-power-manager/2.27/gnome-power-manager-%{version}.tar.gz
@@ -14,6 +14,9 @@ Source: http://download.gnome.org/sour
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
URL: http://projects.gnome.org/gnome-power-manager/
+# from upstream polkit1 branch, automatically generated
+Patch0: gnome-power-manager-port-to-polkit1.patch
+
BuildRequires: libwnck-devel
BuildRequires: hal-devel >= %{hal_version}
BuildRequires: dbus-devel >= %{dbus_version}
@@ -27,8 +30,6 @@ BuildRequires: libtool
BuildRequires: cairo-devel
BuildRequires: libcanberra-devel
BuildRequires: unique-devel
-BuildRequires: PolicyKit-devel
-BuildRequires: PolicyKit-gnome-devel
BuildRequires: DeviceKit-devel >= 002
BuildRequires: DeviceKit-power-devel >= 008
BuildRequires: intltool
@@ -40,8 +41,6 @@ Requires: hal >= %{hal_version}
Requires: dbus-glib >= %{dbus_version}
Requires: dbus-x11 >= %{dbus_version}
Requires: unique >= 0.9.4
-Requires: PolicyKit
-Requires: PolicyKit-authentication-agent
Requires: DeviceKit-power >= 008
Requires(post): scrollkeeper
Requires(pre): GConf2
@@ -58,6 +57,10 @@ change preferences.
%prep
#%setup -q
%setup -q -n %{?name}-%{?version}-%{?alphatag}
+%patch0 -p1 -b .polkit1
+
+# we messed about with configure.ac and Makefile.am, so regenerate (due to polkit1 patch)
+autoreconf
%build
%configure \
@@ -160,6 +163,10 @@ fi
%{_datadir}/gnome-2.0/ui/GNOME_*.xml
%changelog
+* Tue Jun 16 2009 Richard Hughes <rhughes at redhat.com> - 2.27.2-0.2.20090616git
+- Apply a patch to convert to the PolKit1 API.
+- Do autoreconf as the polkit patch is pretty invasive
+
* Tue Jun 16 2009 Richard Hughes <rhughes at redhat.com> - 2.27.2-0.1.20090616git
- Update to todays git snapshot to fix many issues with multiple composite
laptop batteries.
- Previous message (by thread): rpms/rt3/EL-5 .cvsignore, 1.6, 1.7 README.fedora.in, 1.2, 1.3 rt3.spec, 1.25, 1.26 sources, 1.8, 1.9
- Next message (by thread): rpms/samba/F-11 .cvsignore, 1.61, 1.62 samba.spec, 1.184, 1.185 sources, 1.65, 1.66
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list