diff --git a/actors/.gitignore b/actors/.gitignore index bd0cb678..78a2418a 100644 --- a/actors/.gitignore +++ b/actors/.gitignore @@ -3,3 +3,5 @@ bin udsactor*.deb udsactor*.build udsactor*.changes +/udsactor_1.7.0.dsc +/udsactor_1.7.0.tar.xz diff --git a/actors/linux/Makefile b/actors/linux/Makefile index d48e9b6a..f8ffcdb1 100644 --- a/actors/linux/Makefile +++ b/actors/linux/Makefile @@ -4,9 +4,10 @@ SOURCEDIR := ../src LIBDIR := $(DESTDIR)/usr/share/pyshared/UDSActor BINDIR := $(DESTDIR)/usr/bin -SBINDIR := $(DESTDIR)/usr/sbin +SBINDIR = $(DESTDIR)/usr/sbin APPSDIR := $(DESTDIR)/usr/share/applications CFGDIR := $(DESTDIR)/etc/udsactor +POLKITDIR := $(DESTDIR)/usr/share/polkit-1/actions/ PYC := $(shell find $(SOURCEDIR) -name '*.py[co]') CACHES := $(shell find $(SOURCEDIR) -name '__pycache__') @@ -18,18 +19,32 @@ install: mkdir -p $(SBINDIR) mkdir -p $(APPSDIR) mkdir -p $(CFGDIR) + mkdir -p $(POLKITDIR) + + mkdir $(LIBDIR)/img - mkdir -p $(LIBDIR)/ rm -f $(PYC) $(CACHES) cp -r $(SOURCEDIR)/udsactor $(LIBDIR)/udsactor + cp $(SOURCEDIR)/img/uds.png $(LIBDIR)/img cp $(SOURCEDIR)/UDSActorConfig.py $(LIBDIR) cp $(SOURCEDIR)/UDSActorUser.py $(LIBDIR) cp $(SOURCEDIR)/setup_dialog_ui.py $(LIBDIR) + # Menu GUI app cp UDS_Actor_Configuration.desktop $(APPSDIR) - cp udsactor-daemon $(SBINDIR) - chmod 755 $(SBINDIR)/udsactor-daemon + # binaries + cp udsactor $(BINDIR) + cp UDSActorConfig-pkexec $(SBINDIR) + + # Policy to run as administrator + cp org.openuds.pkexec.UDSActorConfig.policy $(POLKITDIR) + + # Fix permissions + chmod 755 $(BINDIR)/udsactor + chmod 755 $(LIBDIR)/UDSActorConfig.py + chmod 755 $(LIBDIR)/UDSActorUser.py + chmod 644 $(POLKITDIR)/org.openuds.pkexec.UDSActorConfig.policy # chmod 0755 $(BINDIR)/udsactor uninstall: diff --git a/actors/linux/UDSActorConfig-pkexec b/actors/linux/UDSActorConfig-pkexec new file mode 100644 index 00000000..b1d34a1f --- /dev/null +++ b/actors/linux/UDSActorConfig-pkexec @@ -0,0 +1,2 @@ +#!/bin/sh +pkexec "/usr/sbin/UDSActorConfig" "$@" \ No newline at end of file diff --git a/actors/linux/UDS_Actor_Configuration.desktop b/actors/linux/UDS_Actor_Configuration.desktop index 1e4f44f1..a397248f 100644 --- a/actors/linux/UDS_Actor_Configuration.desktop +++ b/actors/linux/UDS_Actor_Configuration.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=UDS Actor Configuration Version=1.0 -Exec=/usr/bin/UDSActorConfig +Exec=/usr/sbin/UDSActorConfig-pkexec Comment=UDS Actor Configuration Application. (Must be executed as root) Icon=/usr/share/pyshared/UDSActor/img/uds.png Type=Application diff --git a/actors/linux/debian/control b/actors/linux/debian/control index 083b55ed..ae14fe30 100644 --- a/actors/linux/debian/control +++ b/actors/linux/debian/control @@ -10,7 +10,7 @@ Package: udsactor Section: admin Priority: optional Architecture: all -Depends: python-requests (>=0.8.2), python-qt4 (>=4.9), python-six(>=1.1), python-prctl(>=1.1.1), python (>=2.7), ${misc:Depends} +Depends: policykit-1(>=0.100), python-requests (>=0.8.2), python-qt4 (>=4.9), python-six(>=1.1), python-prctl(>=1.1.1), python (>=2.7), ${misc:Depends} Description: Actor for Universal Desktop Services (UDS) Broker This package provides the required components to allow this machine to work on an environment managed by UDS Broker. . diff --git a/actors/linux/debian/dirs b/actors/linux/debian/dirs deleted file mode 100644 index 2c662cfd..00000000 --- a/actors/linux/debian/dirs +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/ -/usr/share/pyshared/udsactor diff --git a/actors/linux/debian/init b/actors/linux/debian/init index b92da5df..bb5d2798 100755 --- a/actors/linux/debian/init +++ b/actors/linux/debian/init @@ -13,10 +13,10 @@ case "$1" in start|stop|restart) - /usr/sbin/udsactor-daemon $1 + /usr/bin/udsactor $1 ;; force-reload) - ./actor restart + /usr/bin/udsactor restart ;; *) echo "Usage: $0 {start|stop|restart|force-reload}" >&2; exit 1 ;; esac diff --git a/actors/linux/debian/links b/actors/linux/debian/links new file mode 100644 index 00000000..649de20c --- /dev/null +++ b/actors/linux/debian/links @@ -0,0 +1,2 @@ +/usr/share/pyshared/UDSActor/UDSActorConfig.py /usr/sbin/UDSActorConfig +/usr/share/pyshared/UDSActor/UDSActorUser.py /usr/bin/UDSActorTool \ No newline at end of file diff --git a/actors/linux/debian/source/format b/actors/linux/debian/source/format index 46ebe026..9f674278 100644 --- a/actors/linux/debian/source/format +++ b/actors/linux/debian/source/format @@ -1 +1 @@ -3.0 (quilt) \ No newline at end of file +3.0 (native) \ No newline at end of file diff --git a/actors/linux/org.openuds.pkexec.UDSActorConfig.policy b/actors/linux/org.openuds.pkexec.UDSActorConfig.policy new file mode 100644 index 00000000..9afd775a --- /dev/null +++ b/actors/linux/org.openuds.pkexec.UDSActorConfig.policy @@ -0,0 +1,20 @@ + + + + + + + Run UDS Actor Configuration Program + Authentication is required to run UDS Actor Configuration + + no + no + auth_admin_keep + + /usr/sbin/UDSActorConfig + TRUE + + + \ No newline at end of file diff --git a/actors/linux/udsactor-daemon b/actors/linux/udsactor similarity index 100% rename from actors/linux/udsactor-daemon rename to actors/linux/udsactor diff --git a/actors/src/UDSActorConfig.py b/actors/src/UDSActorConfig.py index 1165e019..25687cc1 100644 --- a/actors/src/UDSActorConfig.py +++ b/actors/src/UDSActorConfig.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2014 Virtual Cable S.L. diff --git a/actors/src/UDSActorUser.py b/actors/src/UDSActorUser.py index 13c94359..f075432e 100644 --- a/actors/src/UDSActorUser.py +++ b/actors/src/UDSActorUser.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2014 Virtual Cable S.L.