From 6a85c24b16e6a7c102d2587ee65d6a1a873837b2 Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Tue, 14 Aug 2018 13:36:52 +0200 Subject: [PATCH] Fix .spec to include bin scripts and build reqs * Add installed scripts into the spec. * Add missing BuildRequires * Pull source by URL * Remove installation directories as they do not seem to be used Change-Id: Ib4ff280cb4c50c2f1d57b271557b0c2ddf4e07fe --- python-pyghmi.spec | 50 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/python-pyghmi.spec b/python-pyghmi.spec index aecade39..62c8feef 100644 --- a/python-pyghmi.spec +++ b/python-pyghmi.spec @@ -13,7 +13,7 @@ Summary: %{common_summary} Name: python-%{sname} Version: %{?version:%{version}}%{!?version:%(python setup.py --version)} Release: %{?release:%{release}}%{!?release:1} -Source0: %{sname}-%{version}.tar.gz +Source0: http://tarballs.openstack.org/%{sname}/%{sname}-%{version}.tar.gz License: Apache License, Version 2.0 Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot @@ -29,6 +29,10 @@ Url: https://git.openstack.org/cgit/openstack/pyghmi Summary: %{common_summary} %{?python_provide:%python_provide python2-%{sname}} +BuildRequires: python2-devel +BuildRequires: python2-pbr +BuildRequires: python2-setuptools + Requires: python2-cryptography %description -n python2-%{sname} @@ -47,6 +51,10 @@ Requires: python2-%{sname} = %{version}-%{release} Summary: %{common_summary} %{?python_provide:%python_provide python3-%{sname}} +BuildRequires: python3-devel +BuildRequires: python3-pbr +BuildRequires: python3-setuptools + Requires: python3-cryptography %description -n python3-%{sname} @@ -73,27 +81,48 @@ Documentation for the pyghmi library %setup -n %{sname}-%{version} %build -%py2_build %if 0%{?with_python3} %py3_build %endif # with_python3 +%py2_build + # generate html docs %{__python2} setup.py build_sphinx -b html # remove the sphinx-build leftovers rm -rf doc/build/html/.{doctrees,buildinfo} %install -# Setup directories -install -d -m 755 %{buildroot}%{_datadir}/%{sname} -install -d -m 755 %{buildroot}%{_sharedstatedir}/%{sname} -install -d -m 755 %{buildroot}%{_localstatedir}/log/%{sname} - %if 0%{?with_python3} %py3_install +# rename python3 binary +pushd %{buildroot}/%{_bindir} +mv pyghmicons pyghmicons-%{python3_version} +ln -s pyghmicons-%{python3_version} pyghmicons-3 +mv pyghmiutil pyghmiutil-%{python3_version} +ln -s pyghmiutil-%{python3_version} pyghmiutil-3 +mv virshbmc virshbmc-%{python3_version} +ln -s virshbmc-%{python3_version} virshbmc-3 +mv fakebmc fakebmc-%{python3_version} +ln -s fakebmc-%{python3_version} fakebmc-3 +popd + +%endif # with_python3 + +%py2_install + +%if 0%{?with_python3} %files -n python3-%{sname} %license LICENSE +%{_bindir}/pyghmicons-%{python3_version} +%{_bindir}/pyghmicons-3 +%{_bindir}/pyghmiutil-%{python3_version} +%{_bindir}/pyghmiutil-3 +%{_bindir}/virshbmc-%{python3_version} +%{_bindir}/virshbmc-3 +%{_bindir}/fakebmc-%{python3_version} +%{_bindir}/fakebmc-3 %{python3_sitelib}/%{sname} %{python3_sitelib}/%{sname}-*.egg-info %exclude %{python3_sitelib}/%{sname}/tests @@ -101,13 +130,14 @@ install -d -m 755 %{buildroot}%{_localstatedir}/log/%{sname} %files -n python3-%{sname}-tests %license LICENSE %{python3_sitelib}/%{sname}/tests - %endif # with_python3 -%py2_install - %files -n python2-%{sname} %license LICENSE +%{_bindir}/pyghmicons +%{_bindir}/pyghmiutil +%{_bindir}/virshbmc +%{_bindir}/fakebmc %{python2_sitelib}/%{sname} %{python2_sitelib}/%{sname}-*.egg-info %exclude %{python2_sitelib}/%{sname}/tests