use /lib/systemd instead of /usr/lib/systemd for ubuntu
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 29 May 2018 09:41:27 +0000 (11:41 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 29 May 2018 09:41:27 +0000 (11:41 +0200)
Makefile
setup.py
sfa.spec

index bcf1edc..59a2d22 100644 (file)
--- 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/
index 3c13257..dff8e81 100755 (executable)
--- 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
index 218e6ef..8e31ecc 100644 (file)
--- 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