From d94b5d485090829591bb78de80eb71d7410dba6a Mon Sep 17 00:00:00 2001 From: Bruno Cornec Date: Sat, 5 Mar 2016 09:53:51 +0100 Subject: [PATCH] Improve rpm package generation - Filter install.sh for PB macros - adds doc to spec file --- install.sh | 17 +++++++++++++ pbconf/python-redfish.pb | 2 +- pbconf/python-redfish/rpm/python-redfish.spec | 24 +++++++------------ 3 files changed, 26 insertions(+), 17 deletions(-) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..1662ee0 --- /dev/null +++ b/install.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Syntax: install.sh + +export rootdir=$1 +export sitelib=$2 +export prefix=$3 +python setup.py install --skip-build --root $rootdir +rm -rf $rootdir/$sitelib/redfish/old + +for i in 1; do + mkdir -p $rootdir/$prefix/man/man$i + install -m 644 doc/build/man/*.$i $rootdir/$prefix/man/man$i +done +install -d 755 $rootdir/$prefix/doc/PBPKG/html/_static +install -m 644 doc/build/singlehtml/*.html $rootdir/$prefix/doc/PBPKG/html +install -m 644 doc/build/singlehtml/_static/* $rootdir/$prefix/doc/PBPKG/html/_static diff --git a/pbconf/python-redfish.pb b/pbconf/python-redfish.pb index e08000c..c5130cf 100644 --- a/pbconf/python-redfish.pb +++ b/pbconf/python-redfish.pb @@ -130,7 +130,7 @@ defpkgdir python-redfish = . # List of files per pkg on which to apply filters # Files are mentioned relatively to pbroot/defpkgdir -filteredfiles python-redfish = redfish-client/redfish-client,doc/source/conf.py +filteredfiles python-redfish = redfish-client/redfish-client,doc/source/conf.py,install.sh #supfiles python-redfish = python-redfish.init # For perl modules, names are different depending on distro diff --git a/pbconf/python-redfish/rpm/python-redfish.spec b/pbconf/python-redfish/rpm/python-redfish.spec index 8e99eea..fe99377 100644 --- a/pbconf/python-redfish/rpm/python-redfish.spec +++ b/pbconf/python-redfish/rpm/python-redfish.spec @@ -30,27 +30,19 @@ make singlehtml make latexpdf %install -%{__python} setup.py install -O1 --skip-build --root %{buildroot} -# This will go in a separate script later on to share with other distros -rm -fr %{buildroot}/%{python_sitelib}/redfish/old - -for i in 1; do - mkdir -p %{buildroot}/%{_mandir}/man$i - install -m 644 doc/build/man/*.$i %{buildroot}/%{_mandir}/man$i -done -install -d 755 %{buildroot}/%{_docdir}/%{name}/html/_static -install -m 644 doc/build/singlehtml/*.html %{buildroot}/%{_docdir}/%{name}/html -install -m 644 doc/build/singlehtml/_static/* %{buildroot}/%{_docdir}/%{name}/html/_static +./install.sh %{buildroot} %{python_sitelib} %{_prefix} %files %doc README.rst examples/[a-z]*.py LICENSE %doc doc/build/latex/*.pdf -%dir %{python_sitelib}/redfish -%dir %{_docdir}/%{name}/html -%{_docdir}/%{name}/html/*.html -%dir %{_docdir}/%{name}/html/_static -%{_docdir}/%{name}/html/_static/* +%doc %{_docdir}/%{name}/html +%doc %{_docdir}/%{name}/html/*.html +%doc %{_docdir}/%{name}/html/_static +%doc %{_docdir}/%{name}/html/_static/* %{_bindir}/redfish-client +# add conf file +# add template +%dir %{python_sitelib}/redfish %{python_sitelib}/redfish/*.py* %{python_sitelib}/redfish/tests/*.py* %{python_sitelib}/python_redfish*