There is a polkit configuration example at
http://www.yumex.dk/2012/05/running-yumex-without-typing-password.html. I
really think that it ought to be installed as a template file from the rpm.
Also notice that polkit have changed from *.pkla to *.rules config files,
http://davidz25.blogspot.com/2012/06/authorization-rules-in-polkit.html.
Here is an updated version.
---
Makefile | 3 ++-
misc/10-yumex-without-pw.rules.template | 15 +++++++++++++++
yumex.spec | 1 +
3 files changed, 18 insertions(+), 1 deletion(-)
create mode 100644 misc/10-yumex-without-pw.rules.template
diff --git a/Makefile b/Makefile
index d805d96..52d5c8a 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ install:
mkdir -p $(DESTDIR)/usr/share/pixmaps/yumex
mkdir -p $(DESTDIR)/usr/share/applications
mkdir -p $(DESTDIR)/usr/bin
- mkdir -p $(DESTDIR)/etc
+ mkdir -p $(DESTDIR)/etc/polkit-1/rules.d
mkdir -p $(DESTDIR)/usr/share/polkit-1/actions/
install -m644 COPYING $(DESTDIR)/usr/share/yumex/.
install -m644 $(PIXDIR)/*.png $(DESTDIR)/usr/share/pixmaps/yumex/.
@@ -39,6 +39,7 @@ install:
@rm -f $(MISCDIR)/dk.yumex.backend.policy
intltool-merge -x -u $(PODIR) $(MISCDIR)/
dk.yumex.backend.policy.in $(MISCDIR)/dk.yumex.backend.policy
install -m644 $(MISCDIR)/dk.yumex.backend.policy $(DESTDIR)/usr/share/polkit-1/actions/.
+ install -m644 $(MISCDIR)/10-yumex-without-pw.rules.template $(DESTDIR)/etc/polkit-1/rules.d/.
# build & install desktop file with translations
@rm -f $(MISCDIR)/yumex.desktop
intltool-merge -d -u $(PODIR) $(MISCDIR)/
yumex.desktop.in $(MISCDIR)/yumex.desktop
diff --git a/misc/10-yumex-without-pw.rules.template b/misc/10-yumex-without-pw.rules.template
new file mode 100644
index 0000000..e3bec06
--- /dev/null
+++ b/misc/10-yumex-without-pw.rules.template
@@ -0,0 +1,15 @@
+// See the polkit(8) man page for more information about configuring polkit.
+
+polkit.addRule(function(action, subject) {
+ var prefix = "dk.yumex.backend.";
+ if (action.id.substring(0, prefix.length) == prefix
+ && subject.user == "put_your_username_here") {
+ return polkit.Result.YES;
+ }
+});
+
+/* replace subject.user == ... with
+
+subject.isInGroup("some_group_name") && subject.active
+
+if you do not want to hard code a user name */
diff --git a/yumex.spec b/yumex.spec
index 4516035..949b30c 100644
--- a/yumex.spec
+++ b/yumex.spec
@@ -80,6 +80,7 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace) %{_sysconfdir}/yumex.profiles.conf
%config(noreplace) %{_sysconfdir}/yumex.conf
%{_datadir}/polkit-1/actions/dk.yumex.backend.policy
+%{_sysconfdir}/polkit-1/rules.d/10-yumex-without-pw.rules.template
%{_datadir}/applications/*.desktop
%changelog
--
1.8.1.2