From 90ecb5b00d294b98c732e12ffe39b5a7ff6dfe30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Nizio?= Date: Sun, 28 Oct 2018 19:07:12 +0100 Subject: [PATCH] [RigoDaemon] make the application part be in /usr/libexec This way there is no hardcoded /usr/lib/rigo, and the "executable" part is in a well known location which can be replicated on system for different Python implementations. (As in: it will be like /usr/bin/foo.py which on Gentoo links to a system wrapper making it use configured Python.) --- rigo/RigoDaemon/Makefile | 4 +++- rigo/RigoDaemon/{app.py => app/RigoDaemon_app.py} | 4 ++-- rigo/RigoDaemon/dbus/RigoDaemon | 2 +- rigo/RigoDaemon/devel-start-daemon.sh | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) rename rigo/RigoDaemon/{app.py => app/RigoDaemon_app.py} (99%) diff --git a/rigo/RigoDaemon/Makefile b/rigo/RigoDaemon/Makefile index 6fcce4ae2..23eb1860f 100644 --- a/rigo/RigoDaemon/Makefile +++ b/rigo/RigoDaemon/Makefile @@ -2,15 +2,17 @@ SUBDIRS = dbus polkit PREFIX = /usr BINDIR = $(PREFIX)/bin LIBDIR = $(PREFIX)/lib +LIBEXECDIR = $(PREFIX)/libexec DESTDIR = all: for d in $(SUBDIRS); do $(MAKE) -C $$d; done install: + install -d $(DESTDIR)$(LIBEXECDIR) install -d $(DESTDIR)$(LIBDIR)/rigo/RigoDaemon install -m 644 $(wildcard *.py) $(DESTDIR)$(LIBDIR)/rigo/RigoDaemon/ - install -m 755 app.py $(DESTDIR)$(LIBDIR)/rigo/RigoDaemon/ + install -m 755 app/RigoDaemon_app.py $(DESTDIR)$(LIBEXECDIR)/ for d in $(SUBDIRS); do $(MAKE) -C $$d install; done clean: diff --git a/rigo/RigoDaemon/app.py b/rigo/RigoDaemon/app/RigoDaemon_app.py similarity index 99% rename from rigo/RigoDaemon/app.py rename to rigo/RigoDaemon/app/RigoDaemon_app.py index 13a7bc142..701769763 100755 --- a/rigo/RigoDaemon/app.py +++ b/rigo/RigoDaemon/app/RigoDaemon_app.py @@ -53,8 +53,8 @@ if "--daemon-logging" in sys.argv: from os import path as osp -_base = osp.dirname( - osp.dirname(osp.dirname(osp.realpath(__file__)))) +_base = osp.dirname(osp.dirname( + osp.dirname(osp.dirname(osp.realpath(__file__))))) if os.path.isfile(osp.join(_base, "entropy-in-vcs-checkout")): sys.path.insert(0, osp.join(_base, "entropy_path_loader")) else: diff --git a/rigo/RigoDaemon/dbus/RigoDaemon b/rigo/RigoDaemon/dbus/RigoDaemon index a77e599f2..0de0ea257 100755 --- a/rigo/RigoDaemon/dbus/RigoDaemon +++ b/rigo/RigoDaemon/dbus/RigoDaemon @@ -3,4 +3,4 @@ if [ -f "/etc/profile" ]; then . /etc/profile fi -exec /usr/lib/rigo/RigoDaemon/app.py "$@" +exec /usr/libexec/RigoDaemon_app.py "$@" diff --git a/rigo/RigoDaemon/devel-start-daemon.sh b/rigo/RigoDaemon/devel-start-daemon.sh index d64edb7a5..aec182709 100755 --- a/rigo/RigoDaemon/devel-start-daemon.sh +++ b/rigo/RigoDaemon/devel-start-daemon.sh @@ -15,5 +15,5 @@ sudo cp polkit/org.sabayon.RigoDaemon.policy /usr/share/polkit-1/actions/ || exi cd ../ || exit 1 # GDB? -# sudo gdb --args python2 ./RigoDaemon/app.py --debug -sudo python2 ./RigoDaemon/app.py --debug +# sudo gdb --args python2 ./RigoDaemon/app/RigoDaemon_app.py --debug +sudo python2 ./RigoDaemon/app/RigoDaemon_app.py --debug