shebangs need to point at python2
[sfa.git] / sfa.spec
index d15d786..7882869 100644 (file)
--- a/sfa.spec
+++ b/sfa.spec
@@ -1,6 +1,6 @@
 %define name sfa
 %define version 4.0
-%define taglevel 0
+%define taglevel 1
 
 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
 %global python_sitearch        %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
@@ -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
@@ -191,33 +191,34 @@ rm -rf $RPM_BUILD_ROOT
 %files tests
 %{_datadir}/sfa/tests
 
-### sfa installs the 'sfa' service
+# arbitrary choice here, subject to manual tweaks if needed
+# this is in line with default_config.xml
+# no need to enable sfa-db, will be activated as a dependency
 %post
-chkconfig --add sfa
+systemctl enable sfa-aggregate
+systemctl enable sfa-registry
 
 %preun
 if [ "$1" = 0 ] ; then
-  /sbin/service sfa stop || :
-  /sbin/chkconfig --del sfa || :
+    for service in sfa-aggregate sfa-registry sfa-db; do
+        systemctl is-enabled $service && systemctl disable $service
+        systemctl is-active $service && systemctl stop $service
+    done
 fi
 
 %postun
-[ "$1" -ge "1" ] && { service sfa dbdump ; service sfa restart ; }
-
-#### sfa-cm installs the 'sfa-cm' service
-#%post cm
-#chkconfig --add sfa-cm
-#
-#%preun cm
-#if [ "$1" = 0 ] ; then
-#   /sbin/service sfa-cm stop || :
-#   /sbin/chkconfig --del sfa-cm || :
-#fi
-#
-#%postun cm
-#[ "$1" -ge "1" ] && service sfa-cm restart || :
+if [ "$1" -ge "1" ] ; then
+    for service in sfa-db sfa-registry sfa-aggregate; do
+        systemctl is-active $service && systemctl restart $service
+    done
+fi
 
 %changelog
+* Wed May 30 2018 Thierry <Parmentelat> - sfa-4.0-1
+- systemd service files install in /lib instead of /usr/lib for ubuntus
+- removed all features relating to slice manager
+- removed all features relating to component manager
+
 * Mon May 28 2018 Thierry <Parmentelat> - sfa-4.0-0
 - expose geni_api_versions as https://
 - avoid publishing non-relevant entries in GetVersion