aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-10-12 16:05:27 +0100
committerColin Guthrie <colin@mageia.org>2013-10-12 16:11:06 +0100
commit9cbfa48073b47148a42b65c729423e873488c39c (patch)
tree07392e40822f14e523c2e17925aaa721156d7d5b
parent43a9cc31a1d26614f0d7af0915588fd7c121fcfa (diff)
downloaduserdrake-9cbfa48073b47148a42b65c729423e873488c39c.tar
userdrake-9cbfa48073b47148a42b65c729423e873488c39c.tar.gz
userdrake-9cbfa48073b47148a42b65c729423e873488c39c.tar.bz2
userdrake-9cbfa48073b47148a42b65c729423e873488c39c.tar.xz
userdrake-9cbfa48073b47148a42b65c729423e873488c39c.zip
Use polkit for authorisation (mga#11125)
-rw-r--r--Makefile19
-rw-r--r--NEWS2
-rw-r--r--po/Makefile21
-rw-r--r--po/POTFILES.in2
-rw-r--r--polkit/Makefile24
-rw-r--r--polkit/org.mageia.drakuser.policy.in22
6 files changed, 66 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index 6558e13..7841f42 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,3 @@
-
VERSION = 1.14
NAME = userdrake
BINNAME = userdrake
@@ -6,28 +5,26 @@ BINNAME = userdrake
PREFIX = /
DATADIR = $(PREFIX)/usr/share
ICONSDIR = $(DATADIR)/icons
-SBINDIR = $(PREFIX)/usr/sbin
+LIBEXECDIR = $(PREFIX)/usr/libexec
BINDIR = $(PREFIX)/usr/bin
SYSCONFDIR = $(PREFIX)/etc/sysconfig
-SBINREL = ../sbin
-SUBDIRS = po
+SUBDIRS = po polkit
localedir = $(prefix)/usr/share/locale
all: userdrake
- for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done
+ for d in $(SUBDIRS); do ( make -C $$d $@ ) ; done
clean:
$(MAKE) -C po $@
rm -f core .#*[0-9]
- for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done
+ for d in $(SUBDIRS); do ( make -C $$d $@ ) ; done
install: all
$(MAKE) -C po $@
- install -d $(PREFIX)/{/etc/sysconfig,usr/{bin,sbin,share/$(NAME)/pixmaps,share/icons/{mini,large}}}
- install -m755 $(NAME) $(SBINDIR)/
- ln -sf $(SBINREL)/userdrake $(BINDIR)/userdrake
- ln -sf $(SBINREL)/userdrake $(SBINDIR)/drakuser
+ install -d $(PREFIX)/{/etc/sysconfig,usr/{bin,libexec,share/$(NAME)/pixmaps,share/icons/{mini,large}}}
+ install -m755 $(NAME) $(LIBEXECDIR)/drakuser
+ ln -sf drakuser $(BINDIR)/$(NAME)
install -d $(SYSCONFDIR)
install -m644 userdrake.prefs $(SYSCONFDIR)/userdrake
install -m644 pixmaps/*.png $(DATADIR)/$(NAME)/pixmaps
@@ -35,7 +32,7 @@ install: all
install -m644 icons/$(NAME)32.png $(ICONSDIR)/$(NAME).png
install -m644 icons/$(NAME)48.png $(ICONSDIR)/large/$(NAME).png
install -m644 icons/*selec*.png $(DATADIR)/$(NAME)/pixmaps
- for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done
+ for d in $(SUBDIRS); do ( make -C $$d $@ ) ; done
dis: dist
dist: clean
diff --git a/NEWS b/NEWS
index 54bd81c..cb57fdb 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- use polkit for authorisation (mga#11125)
+
Version 1.14 - 23 April 2013, Thierry Vignaud
- fix compiling with latest libuser
diff --git a/po/Makefile b/po/Makefile
index f9d5721..e773ff9 100644
--- a/po/Makefile
+++ b/po/Makefile
@@ -4,7 +4,7 @@ localedir = $(PREFIX)/usr/share/locale
PGOAL = userdrake
# perl files to search translatable strings in
-PL_FILES = $(shell cat POTFILES.in | sed 's,^,../,' )
+PL_FILES = ../userdrake ../USER/USER.pm
# C-like files to search translatable strings in
CFILES = ../USER/USER.xs
@@ -23,20 +23,19 @@ install: all
done
clean:
- rm -f *~ *.[oas] *.mo TAGS
+ rm -f *~ *.[oas] *.mo TAGS POTFILES.in
%.mo: %.po
msgfmt -o $@ $<
-$(PGOAL).pot: POTFILES.in $(PL_FILES) $(CFILES)
- xgettext -F -n --add-comments \
- --keyword=_ --keyword=__ --keyword=N_ --keyword=N \
- --keyword=gettext \
- --language=C -o placeholder.pot $(CFILES)
- #touch placeholder.pot
- perl_checker -q --generate-pot $(PGOAL)_tmp.pot $(PL_FILES) || rm -f $(PGOAL)_tmp.pot
- [ ! -e $(PGOAL)_tmp.pot ] || msgcat --use-first placeholder.pot $(PGOAL)_tmp.pot > $@
- rm -f placeholder.pot $(PGOAL)_tmp.pot
+$(PGOAL).pot: $(PL_FILES) $(CFILES) POTFILES.in
+ intltool-update --gettext-package non-perl --pot
+ perl_checker -q --generate-pot .$@ $(PL_FILES)
+ msgcat -w 2048 --use-first .$@ non-perl.pot > $@
+ rm -f non-perl.pot .$@
+
+POTFILES.in:
+ (cd .. ; /bin/ls -1 polkit/*.policy.in USER/*.xs; ) > POTFILES.in
update_n_merge: $(PGOAL).pot merge
diff --git a/po/POTFILES.in b/po/POTFILES.in
deleted file mode 100644
index afce97b..0000000
--- a/po/POTFILES.in
+++ /dev/null
@@ -1,2 +0,0 @@
-userdrake
-USER/USER.pm
diff --git a/polkit/Makefile b/polkit/Makefile
new file mode 100644
index 0000000..a8b5a51
--- /dev/null
+++ b/polkit/Makefile
@@ -0,0 +1,24 @@
+BINDIR = /usr/bin
+LIBEXECDIR = /usr/libexec
+BINDEST = $(PREFIX)$(BINDIR)
+POLKITPOLICYDEST = $(PREFIX)/usr/share/polkit-1/actions
+
+POLICY_IN := $(wildcard *.policy.in)
+POLICY = $(POLICY_IN:.policy.in=.policy)
+WRAPPERS = $(patsubst org.mageia.%.policy,%,$(POLICY))
+
+all: $(WRAPPERS) $(POLICY)
+
+clean:
+ rm -f $(WRAPPERS) $(POLICY)
+
+%: org.mageia.%.policy.in
+ @echo -e "#!/bin/sh\nexec $(BINDIR)/pkexec $(LIBEXECDIR)/$@ $$""*" > $@
+
+%.policy: %.policy.in
+ intltool-merge --utf8 ../po $< $@ -x -u -c ../po/.intltool-merge-cache
+
+install: all
+ install -d $(BINDEST) $(POLKITPOLICYDEST)
+ install -m755 $(WRAPPERS) $(BINDEST)
+ install -m644 $(POLICY) $(POLKITPOLICYDEST)
diff --git a/polkit/org.mageia.drakuser.policy.in b/polkit/org.mageia.drakuser.policy.in
new file mode 100644
index 0000000..4aee6b8
--- /dev/null
+++ b/polkit/org.mageia.drakuser.policy.in
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
+<policyconfig>
+
+ <vendor>Mageia</vendor>
+ <vendor_url>http://www.mageia.org/</vendor_url>
+
+ <action id="org.mageia.drakuser.pkexec.run">
+ <_description>Run Mageia User Manager</_description>
+ <_message>Authentication is required to run Mageia User Manager</_message>
+ <icon_name>drakconf</icon_name>
+ <defaults>
+ <allow_any>no</allow_any>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_admin_keep</allow_active>
+ </defaults>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/drakuser</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>