remove unexistent rpms from BuildRequires:
[sfa.git] / sfa.spec
index 65c3190..7f2773b 100644 (file)
--- a/sfa.spec
+++ b/sfa.spec
@@ -1,10 +1,10 @@
 %define name sfa
 %define version 4.0
-%define taglevel 1
+%define taglevel 2
 
 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
-%global python_sitearch        %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%global python_sitearch        %( python2 -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
+%{!?python2_sitelib: %define python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
 Name: %{name}
 Version: %{version}
@@ -24,15 +24,24 @@ URL: %{SCMURL}
 Summary: Server-side for SFA, generic implementation derived from PlanetLab
 Group: Applications/System
 BuildRequires: make
+%if "%{distro}" == "Fedora" && "%{distrorelease}" <= "29"
+BuildRequires: python2-dateutil
+BuildRequires: python2-lxml
+%endif
 
 # for uuidgen - used in db password generation
 Requires: util-linux-ng
 # for the registry
 Requires: postgresql >= 8.2, postgresql-server >= 8.2
-Requires: postgresql-python
+# these are no longer supported in f33, use pip2 instead
+%if "%{distro}" == "Fedora" && "%{distrorelease}" <= "31"
+Requires: python2-pygresql
+%endif
 Requires: python2-psycopg2
 Requires: python2-sqlalchemy
+%if "%{distro}" == "Fedora" && "%{distrorelease}" <= "29"
 Requires: python2-migrate
+%endif
 # and of course the bulk of it
 Requires: sfa-common
 
@@ -47,8 +56,10 @@ Requires: python2-lxml
 %if "%{distro}" == "Fedora" && "%{distrorelease}" <= "27"
 Requires: python-ZSI
 %else
+%if "%{distro}" == "Fedora" && "%{distrorelease}" <= "29"
 Requires: python2-zsi
 %endif
+%endif
 Requires: libxslt-python
 Requires: xmlsec1-openssl-devel
 
@@ -144,17 +155,17 @@ rm -rf $RPM_BUILD_ROOT
 /var/www/html/wsdl/*.wsdl
 
 %files common
-%{python_sitelib}/sfa/__init__.py*
-%{python_sitelib}/sfa/trust
-%{python_sitelib}/sfa/storage
-%{python_sitelib}/sfa/util
-%{python_sitelib}/sfa/server
-%{python_sitelib}/sfa/methods
-%{python_sitelib}/sfa/generic
-%{python_sitelib}/sfa/managers
-%{python_sitelib}/sfa/importer
-%{python_sitelib}/sfa/rspecs
-%{python_sitelib}/sfa/client
+%{python2_sitelib}/sfa/__init__.py*
+%{python2_sitelib}/sfa/trust
+%{python2_sitelib}/sfa/storage
+%{python2_sitelib}/sfa/util
+%{python2_sitelib}/sfa/server
+%{python2_sitelib}/sfa/methods
+%{python2_sitelib}/sfa/generic
+%{python2_sitelib}/sfa/managers
+%{python2_sitelib}/sfa/importer
+%{python2_sitelib}/sfa/rspecs
+%{python2_sitelib}/sfa/client
 
 %files client
 %config (noreplace) /etc/sfa/sfi_config
@@ -169,7 +180,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files plc
 %defattr(-,root,root)
-%{python_sitelib}/sfa/planetlab
+%{python2_sitelib}/sfa/planetlab
 /etc/sfa/pl.rng
 /etc/sfa/credential.xsd
 /etc/sfa/top.xsd
@@ -179,15 +190,15 @@ rm -rf $RPM_BUILD_ROOT
 /etc/sfa/topology
 
 %files iotlab
-%{python_sitelib}/sfa/iotlab
+%{python2_sitelib}/sfa/iotlab
 
 %files dummy
-%{python_sitelib}/sfa/dummy
+%{python2_sitelib}/sfa/dummy
 
 %files sfatables
 /etc/sfatables/*
 %{_bindir}/sfatables
-%{python_sitelib}/sfatables
+%{python2_sitelib}/sfatables
 
 %files tests
 %{_datadir}/sfa/tests
@@ -198,6 +209,7 @@ rm -rf $RPM_BUILD_ROOT
 %post
 systemctl enable sfa-aggregate
 systemctl enable sfa-registry
+true
 
 %preun
 if [ "$1" = 0 ] ; then
@@ -206,6 +218,7 @@ if [ "$1" = 0 ] ; then
         systemctl is-active $service && systemctl stop $service
     done
 fi
+true
 
 %postun
 if [ "$1" -ge "1" ] ; then
@@ -213,8 +226,18 @@ if [ "$1" -ge "1" ] ; then
         systemctl is-active $service && systemctl restart $service
     done
 fi
+true
 
 %changelog
+* Mon Jan 07 2019 Thierry <Parmentelat> - sfa-4.0-2
+- have shebangs mention python2 since it is what this version runs on
+- use rpm names in python2-something for expressing dependencies
+- remove build dependency to python-setuptools
+- Handle C-BAS hrn format with "\" (Loic)
+- sfa-start does not daemonize anymore (this is handled by systemd)
+- a little nicer logs when troubleshooting auth issues
+- use systemctl in Makefile when syncing
+
 * 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