From 4331eb89584112cbc092f0b20bf0b4737b1fe4c2 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 29 May 2018 11:41:27 +0200 Subject: [PATCH] use /lib/systemd instead of /usr/lib/systemd for ubuntu --- Makefile | 2 +- setup.py | 8 +++++--- sfa.spec | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index bcf1edca..59a2d220 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,7 @@ syncmigrations: syncbin: synccheck +$(RSYNC) $(BINS) $(SSHURL)/usr/bin/ syncservices: synccheck - +$(RSYNC) ./systemd/*.service $(SSHURL)/usr/lib/systemd/system + +$(RSYNC) ./systemd/*.service $(SSHURL)/lib/systemd/system +$(RSYNC) ./systemd/sfa-setup.sh $(SSHURL)/usr/bin syncconfig: +$(RSYNC) ./config/default_config.xml $(SSHURL)/etc/sfa/ diff --git a/setup.py b/setup.py index 3c132579..dff8e816 100755 --- a/setup.py +++ b/setup.py @@ -82,10 +82,12 @@ data_files = [ ('/usr/share/sfa/examples/', glob('sfa/examples/*' ) + [ 'cron.d/sfa.cron' ] ), ] - +# use /lib/systemd instead of /usr/lib/systemd +# the latter would work on fedora only, the former +# will work on both fedora and ubuntu services = ['sfa-db', 'sfa-aggregate', 'sfa-registry'] data_files.append( - ('/usr/lib/systemd/system', + ('/lib/systemd/system', ['systemd/{}.service'.format(service) for service in services])) @@ -109,7 +111,7 @@ if sys.argv[1] in ['uninstall', 'remove', 'delete', 'clean']: remove_dirs = ['/etc/sfa/', '/etc/sfatables'] + site_packages_path remove_bins = [ '/usr/bin/' + os.path.basename(bin) for bin in scripts ] remove_files = (remove_bins - + ["/usr/lib/systemd/system/{}".format(x) + + ["/lib/systemd/system/{}".format(x) for x in services]) # remove files diff --git a/sfa.spec b/sfa.spec index 218e6ef8..8e31ecc6 100644 --- a/sfa.spec +++ b/sfa.spec @@ -126,7 +126,7 @@ make VERSIONTAG="%{version}-%{taglevel}" SCMURL="%{SCMURL}" install DESTDIR="$RP rm -rf $RPM_BUILD_ROOT %files -/usr/lib/systemd/system/*.service +/lib/systemd/system/*.service %{_bindir}/sfa-start.py* %{_bindir}/sfaadmin.py* %{_bindir}/sfaadmin -- 2.43.0