summaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 160fe43..58c2bf3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,6 +4,11 @@ SUBDIRS = src po ui
PKGDIR = `pwd`/pkg
PKGREL = 1
+if POLKIT
+INSTALL_GSLAPT_POLKIT = mkdir -p $(DESTDIR)/$(bindir); echo -e "\#!/bin/sh\npkexec --disable-internal-agent /usr/sbin/gslapt \$$@" > $(DESTDIR)/$(bindir)/gslapt-polkit; chmod +x $(DESTDIR)/$(bindir)/gslapt-polkit
+else
+INSTALL_GSLAPT_POLKIT =
+endif
EXTRA_DIST = \
FAQ \
@@ -36,9 +41,12 @@ install-data-local:
$(INSTALL_DATA) AUTHORS ChangeLog COPYING FAQ README $(DESTDIR)/$(datadir)/doc/@PACKAGE@ ; \
$(INSTALL_DATA) gslapt.desktop $(DESTDIR)/$(datadir)/applications/gslapt.desktop; \
$(INSTALL_DATA) gslapt-kde.desktop $(DESTDIR)/$(datadir)/applications/gslapt-kde.desktop; \
+ $(mkinstalldirs) $(DESTDIR)/$(POLKIT_SYSTEM_ACTIONS_DIR); \
+ $(INSTALL_DATA) org.jaos.gslapt.policy $(DESTDIR)/$(POLKIT_SYSTEM_ACTIONS_DIR)/org.jaos.gslapt.policy; \
$(INSTALL_DATA) series_map.rc $(DESTDIR)/$(pkgdatadir)/; \
$(mkinstalldirs) $(DESTDIR)/$(datadir)/pixmaps; \
$(INSTALL_DATA) ui/gslapt.png $(DESTDIR)/$(datadir)/pixmaps/
+ $(INSTALL_GSLAPT_POLKIT)
pkg: all
@make install DESTDIR=$(PKGDIR)
@@ -51,7 +59,7 @@ pkg: all
@echo -n "$(DESTDIR)/$(datadir)/applications/gslapt.desktop " |sed -re "s/^\/+//" >> $(PKGDIR)/install/doinst.sh
@echo "$(DESTDIR)/$(datadir)/applications/gslapt-kde.desktop" |sed -re "s/^\/+//" >> $(PKGDIR)/install/doinst.sh
@echo "do" >> $(PKGDIR)/install/doinst.sh
- @echo 'if [ -f $$DESKTOPFILE ]; then if [ -x usr/bin/gksudo ]; then sed -i.bak -re "s/(Exec=)(\/usr\/sbin\/gslapt)/\1gksudo \2/" $$DESKTOPFILE; elif [ -x usr/bin/gksu ]; then sed -i.bak -re "s/(Exec=)(\/usr\/sbin\/gslapt)/\1gksu \2/" $$DESKTOPFILE; elif [ -x usr/bin/gnomesu ]; then sed -i.bak -re "s/(Exec=)(\/usr\/sbin\/gslapt)/\1gnomesu \2/" $$DESKTOPFILE; elif [ -x usr/bin/kdesu ]; then sed -i.bak -re "s/(Exec=)(\/usr\/sbin\/gslapt)/\1kdesu \2/" $$DESKTOPFILE; fi; fi' >> $(PKGDIR)/install/doinst.sh
+ @echo 'if [ -f $$DESKTOPFILE ]; then for privprog in usr/bin/pkexec usr/bin/gksudo usr/bin/gksu usr/bin/gnomesu usr/bin/kdesu;do if [ -x $$privprog ]; then shortprivprog=$$(basename $$privprog); sed -i.bak -re "s/(Exec=)(\/usr\/sbin\/gslapt)/\1$$shortprivprog \2/" $$DESKTOPFILE; fi; done; fi' >> $(PKGDIR)/install/doinst.sh
@echo "done" >> $(PKGDIR)/install/doinst.sh
@echo 'if [ -x usr/bin/update-desktop-database ]; then usr/bin/update-desktop-database &>/dev/null; fi' >> $(PKGDIR)/install/doinst.sh
strip --strip-unneeded $(PKGDIR)/$(sbindir)/@PACKAGE@