Adapt rpm package build to new setup.py

- Review install script to use the --prefix option, install doc in the
  corerct place (/usr/share/doc) and fix the wrong placement of the conf
  file for now
- Declare new macros (which are not used yet BTW)
- Fix the spec file for new loactions
- Adds urllib3 to python dependencies
This commit is contained in:
Bruno Cornec 2016-03-07 19:22:58 +01:00
parent d94b5d4850
commit a6799130e8
5 changed files with 19 additions and 13 deletions

View File

@ -1,17 +1,22 @@
#!/bin/bash
# Syntax: install.sh <Root Dir> <Python SiteLib> <Prefix>
set -x
export rootdir=$1
export sitelib=$2
export prefix=$3
python setup.py install --skip-build --root $rootdir
#python setup.py install --skip-build --prefix=$prefix
python setup.py install --skip-build --root=$rootdir --prefix=$prefix
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
mkdir -p $rootdir/$prefix/share/man/man$i
install -m 644 doc/build/man/*.$i $rootdir/$prefix/share/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
install -d 755 $rootdir/$prefix/share/doc/PBPKG/html/_static
install -m 644 doc/build/singlehtml/*.html $rootdir/$prefix/share/doc/PBPKG/html
install -m 644 doc/build/singlehtml/_static/* $rootdir/$prefix/share/doc/PBPKG/html/_static
# Hardcoded for now to solve the delivery of the conf file still not correct with setup.py
mkdir -p $rootdir/etc
mv $rootdir/$prefix/etc/redfish-client.conf $rootdir/etc/redfish-client.conf

View File

@ -66,3 +66,6 @@ filter PBURL = http://github.com/bcornec/python-redfish
# PBLOG is replaced by the changelog if value is yes
# and should be last as when used we need the %pb hash filled
filter PBLOG = yes
filter PBCONFFILE = /etc/redfish-client.conf
filter PBTEMPLATEPATH = /usr/share/redfish-client/templates

View File

@ -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,install.sh
filteredfiles python-redfish = redfish-client/redfish-client,doc/source/conf.py,setup.py,./redfish-client/etc/redfish-client.conf,install.sh
#supfiles python-redfish = python-redfish.init
# For perl modules, names are different depending on distro

View File

@ -35,13 +35,10 @@ make latexpdf
%files
%doc README.rst examples/[a-z]*.py LICENSE
%doc doc/build/latex/*.pdf
%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 %{_datadir}/redfish-client
%{_datadir}/redfish-client/templates/*
%config(noreplace) %{_sysconfdir}/redfish-client.conf
%dir %{python_sitelib}/redfish
%{python_sitelib}/redfish/*.py*
%{python_sitelib}/redfish/tests/*.py*

View File

@ -8,6 +8,7 @@ Jinja2>=2.7.3
Sphinx>=1.2.3
docopt>=0.6.2
simplejson>=3.8.1
urllib3>=1.9
# Python3 compat
future>=0.15.2