From b0196258ff382e57a113991863c6786440162a6a Mon Sep 17 00:00:00 2001 From: Bruno Cornec Date: Sun, 12 Feb 2017 23:22:33 +0100 Subject: [PATCH] Fix RPM build - Create a new python-redfish-data package in order to share common content between python2 and python3 packages - Fix python3 package by renaming binaries to allow joint installation of python2 and python3 packages - Adds encapsulation of tests - Fix doc package build Change-Id: I3579663e77dd55b7162a3d1346bf6cd00f73c0a5 --- pbconf/python-redfish/rpm/python-redfish.spec | 52 +++++++++++++------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/pbconf/python-redfish/rpm/python-redfish.spec b/pbconf/python-redfish/rpm/python-redfish.spec index ba2a7ab..a25bda2 100644 --- a/pbconf/python-redfish/rpm/python-redfish.spec +++ b/pbconf/python-redfish/rpm/python-redfish.spec @@ -12,7 +12,7 @@ License: PBLIC Group: PBGRP Url: PBURL Source: PBREPO/PBSRC -Requires: PBPYTHON2DEP +Requires: PBPYTHON2DEP,PBREALPKG-data BuildArch: noarch BuildRequires: PBPYTHON2BDEP, PB2PYTHON2BDEP @@ -23,8 +23,8 @@ Python2 version. %if %{?with_python3} %package -n PBPYTHON3PKG Summary: %{summary} / Python 3 library -BuildRequires: PBPYTHON3BDEP, PB2PYTHON3BDEP -Requires: PBPYTHON3DEP +BuildRequires: PBPYTHON3BDEP,PB2PYTHON3BDEP +Requires: PBPYTHON3DEP,PBREALPKG-data %description -n PBPYTHON3PKG PBDESC @@ -33,13 +33,20 @@ Python3 version. %package -n PBREALPKG-doc Summary: %{summary} / Documentation -BuildRequires: PBPYTHON2BDEP, PB2PYTHON2BDEP +BuildRequires: PBPYTHON2BDEP,PB2PYTHON2BDEP Requires: PBPYTHON2DEP %description -n PBREALPKG-doc PBDESC Documentation +%package -n PBREALPKG-data +Summary: %{summary} / Data + +%description -n PBREALPKG-data +PBDESC +Data + %prep %setup -q -n %{name}-%{version}PBEXTDIR # Fix for now as long as setuptools isn't more recent in distributions @@ -68,6 +75,15 @@ make singlehtml make latexpdf %install + +%if %{?with_python3} +pushd %{py3dir} +./install.sh %{__python3} %{buildroot} %{python3_sitelib} %{_prefix} PBPYTHON3PKG +mv %{buildroot}%{_bindir}/redfish-client %{buildroot}%{_bindir}/redfish-client-%{python3_version} +mv %{buildroot}%{_bindir}/redfish-check-cartridge %{buildroot}%{_bindir}/redfish-check-cartridge-%{python3_version} +popd +%endif # if with_python3 + ./install.sh %{__python} %{buildroot} %{python_sitelib} %{_prefix} PBPKG ./install.sh doc %{buildroot} %{python_sitelib} %{_prefix} PBPKG @@ -77,24 +93,16 @@ for i in `ls %{buildroot}/%{_mandir}/man1/*-py2.1*`; do cp -a $i $j done -%if %{?with_python3} -pushd %{py3dir} -./install.sh %{__python3} %{buildroot} %{python3_sitelib} %{_prefix} PBPYTHON3PKG -popd -%endif # if with_python3 - %files -%doc README.rst examples/[a-z]*.py LICENSE -%exclude %{_docdir}/PBREALPKG/html -%exclude %{_docdir}/PBREALPKG/*.pdf +%doc README.rst examples/[a-z]*.py LICENSE AUTHORS ChangeLog +%exclude %{_docdir}/PBREALPKG/manual/html +%exclude %{_docdir}/PBREALPKG/manual/*.pdf %{_bindir}/redfish-client %{_bindir}/redfish-check-cartridge -%dir %{_datadir}/redfish-client -%{_datadir}/redfish-client/templates/* -%config(noreplace) %{_sysconfdir}/redfish-client.conf %dir %{python_sitelib}/redfish %{python_sitelib}/redfish/*.py* %{python_sitelib}/redfish/oem/*.py* +%{python_sitelib}/redfish/tests/*.py* %{python_sitelib}/python_redfish* # Needs improvement to host all .1 man pages but not the py3 ones %{_mandir}/man1/PBREALPKG.1* @@ -103,15 +111,27 @@ popd %if %{?with_python3} %files -n PBPYTHON3PKG %doc README.rst examples/[a-z]*.py LICENSE AUTHORS ChangeLog +%exclude %{_docdir}/PBREALPKG/manual/html +%exclude %{_docdir}/PBREALPKG/manual/*.pdf +%{_bindir}/redfish-client-%{python3_version} +%{_bindir}/redfish-check-cartridge-%{python3_version} %dir %{python3_sitelib}/redfish %{python3_sitelib}/redfish/*.py* %{python3_sitelib}/redfish/oem/*.py* %{python3_sitelib}/redfish/oem/__pycache__/*.py* %{python3_sitelib}/redfish/__pycache__/*.py* +%{python3_sitelib}/redfish/tests/*.py* +%{python3_sitelib}/redfish/tests/__pycache__/*.py* %{python3_sitelib}/python_redfish* %{_mandir}/man1/*-py3.1* %endif # if with_python3 +%files -n PBREALPKG-data +%config(noreplace) %{_sysconfdir}/redfish-client.conf +%dir %{_datadir}/redfish-client +%{_datadir}/redfish-client/templates/* +%{_datadir}/redfish-client/*.txt + %files -n PBREALPKG-doc %{_docdir}/PBREALPKG/manual/html/_static/* %{_docdir}/PBREALPKG/manual/html/index.html