Setting tag myplc-7.0-0
[myplc.git] / myplc.spec
index 56e7aa4..85dfdd8 100644 (file)
@@ -1,9 +1,9 @@
 %define name myplc
-%define version 5.3
-%define taglevel 4
+%define version 7.0
+%define taglevel 0
 
 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
-%global python_sitearch        %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
+
 
 Name: %{name}
 Version: %{version}
@@ -20,11 +20,64 @@ URL: %{SCMURL}
 
 %define nodefamily %{pldistro}-%{distroname}-%{_arch}
 
-####################### myplc
+
+####################### myplc - mostly a meta-package
 Summary: PlanetLab Central (PLC) Portable Installation
 Group: Applications/Systems
 
-# as much as possible, requires should go in the subpackages specfile
+# planetlab stuff
+Requires: myplc-docs
+Requires: myplc-release
+Requires: myplc-core
+Requires: createrepo
+Requires: bootmanager
+Requires: bootcd-%{nodefamily}
+Requires: bootcd-initscripts
+Requires: nodeimage-%{nodefamily}
+Requires: nodeconfig
+Requires: nodeyum
+Requires: www-register-wizard
+
+
+# starting with f16 we depend on this new rpm
+%if "%{distro}" == "Fedora" && %{distrorelease} >= 16
+Requires: rpm-sign
+%endif
+
+
+%description
+MyPLC is a complete PlanetLab Central (PLC) portable installation.
+The default installation consists of a web server, an XML-RPC API
+server, a boot server, and a database server: the core components of
+PLC. The installation may be customized through a graphical
+interface. All PLC services are started up and shut down through a
+single System V init script.
+
+
+####################### myplc-core
+# Warning: it appears that Requires should come here
+# BEFORE the %description thingy
+
+%package core
+
+Summary: core contents of myplc with API + db + www UI
+
+# as much as possible, requires should have gone
+# with the individual packages, but well
+Requires: myplc-config
+Requires: plcapi
+Requires: plewww
+
+# this technically is a plcapi dependency
+# but it's simpler here for chosing which
+Requires: python3-mod_wsgi
+
+# this technically is a plewww dependency
+# starting with f27 we depend on this new rpm
+%if "%{distro}" == "Fedora" && %{distrorelease} >= 27
+Requires: php-fpm
+%endif
+
 Requires: redhat-lsb
 Requires: bzip2
 Requires: tar
@@ -36,10 +89,9 @@ Requires: expect
 Requires: php-pgsql
 Requires: curl
 Requires: rsync
-Requires: python-devel
-Requires: yum
+Requires: python3-devel
+Requires: dnf
 #Requires: PyXML
-Requires: createrepo
 Requires: cpio
 Requires: wget
 Requires: php
@@ -53,48 +105,12 @@ Requires: xmlsec1
 Requires: xmlsec1-openssl
 Requires: ed
 Requires: cronie
-# starting with f16 we depend on this new rpm
-%if "%{distro}" == "Fedora" && %{distrorelease} >= 16
-Requires: rpm-sign
-%endif
-# starting with f27 we depend on this new rpm
-%if "%{distro}" == "Fedora" && %{distrorelease} >= 27
-Requires: php-fpm
-%endif
-
-# planetlab stuff
-Requires: bootmanager
-Requires: bootcd-%{nodefamily}
-Requires: bootcd-initscripts
-Requires: PLCWWW
-Requires: www-register-wizard
-Requires: nodeconfig
-Requires: nodeyum
-Requires: plcapi >= 5.2
-# this technically is a plcapi dependency but it's simpler here for chosing which
-%if "%{distro}" == "Fedora" && %{distrorelease} >= 29
-Requires: python2-mod_wsgi
-%else
-%if "%{distro}" == "Fedora" && %{distrorelease} >= 18
-Requires: mod_wsgi
-%else
-Requires: mod_python
-%endif
-%endif
-Requires: nodeimage-%{nodefamily}
-Requires: myplc-docs
-Requires: myplc-release
-Requires: myplc-config
 
-%define debug_package %{nil}
 
-%description
-MyPLC is a complete PlanetLab Central (PLC) portable installation.
-The default installation consists of a web server, an XML-RPC API
-server, a boot server, and a database server: the core components of
-PLC. The installation may be customized through a graphical
-interface. All PLC services are started up and shut down through a
-single System V init script.
+%description core
+The core of myplc is about its API + database + web interface.
+Installing this will not require any node-oriented
+package, like bootcd, nodeimage, or bootmanager.
 
 ####################### myplc-config
 
@@ -102,12 +118,13 @@ single System V init script.
 
 Summary: PlanetLab Central (PLC) configuration python module
 Group: Applications/Systems
-Requires: python
+Requires: python3
 
 %description config
 This package provides the Python module to configure MyPLC.
 
 
+
 %prep
 %setup -q
 
@@ -117,9 +134,8 @@ This package provides the Python module to configure MyPLC.
 rm -rf $RPM_BUILD_ROOT
 
 # Install configuration scripts
-echo "* Installing plc_config.py in " ${PYTHON_SITEARCH}
-PYTHON_SITEARCH=`python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)'`
-install -D -m 755 plc_config.py ${RPM_BUILD_ROOT}/${PYTHON_SITEARCH}/plc_config.py
+echo "* Installing plc_config.py in %{python3_sitelib}"
+install -D -m 755 plc_config.py ${RPM_BUILD_ROOT}/%{python3_sitelib}/plc_config.py
 
 echo "* Installing scripts in /usr/bin"
 mkdir -p ${RPM_BUILD_ROOT}/usr/bin
@@ -205,10 +221,7 @@ if [ $1 -gt 0 ] ; then
 fi
 
 %post
-if [ -x /sbin/chkconfig ] ; then
-    /sbin/chkconfig --add plc
-    /sbin/chkconfig plc on
-fi
+systemctl enable plc
 
 %if "%{distro}" == "Fedora" && %{distrorelease} >= 27
 systemctl enable php-fpm
@@ -233,21 +246,21 @@ fi
 # 0 = erase, 1 = upgrade
 if [ $1 -eq 0 ] ; then
     %{_sysconfdir}/init.d/plc stop
-    if [ -x /sbin/chkconfig ] ; then
-        /sbin/chkconfig plc off
-       /sbin/chkconfig --del plc
-    fi
+    systemctl disable plc
 fi
 
+
 %files
+/usr/share/myplc/bashrc
+
+%files core
 %defattr(-,root,root,-)
-# Host startup script and configuration file
+/usr/lib/systemd/system/plc.service
 /usr/bin/plc-ctl
 /etc/plc.d
 /etc/planetlab
 /etc/plc_sliceinitscripts
 /etc/support-scripts
-/usr/share/myplc/bashrc
 # keep a detailed list, to avoid duplicate of plc-config,
 # that belongs to the myplc-config rpm
 /usr/bin/plc-config-tty
@@ -265,15 +278,18 @@ fi
 /usr/bin/check-hrns.py*
 /usr/bin/check-vsys-defaults.py*
 /usr/bin/spot-dup-accounts.sh
-/usr/lib/systemd/system/plc.service
+
 
 %files config
 %defattr(-,root,root,-)
 /usr/bin/plc-config
-%{python_sitearch}/plc_config.py*
+%{python3_sitelib}/plc_config.py*
 
 
 %changelog
+* Mon Jan 07 2019 Thierry Parmentelat <thierry.parmentelat@inria.fr> - myplc-7.0-0
+- suitable for python3 on both f27 and f29
+
 * Sun Jul 16 2017 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-5.3-4
 - takes care of creating plcapi log file