Add hooks for python wheel generation

This update adds hooks to the spec files for the following packages
to generate wheels for the python modules:
- fm-api
- fm-common
- fm-rest-api
- python-fmclient

Change-Id: I0542650b52b9c5b0627023a2ce1996176135411d
Story: 2003907
Task: 27525
Signed-off-by: Don Penney <don.penney@windriver.com>
This commit is contained in:
Don Penney 2018-10-22 16:43:03 -04:00
parent 8080f496b6
commit 4d82104ecf
6 changed files with 60 additions and 1 deletions

4
centos_wheels.inc Normal file
View File

@ -0,0 +1,4 @@
fm-api-wheels
fm-common-wheels
fm-rest-api-wheels
python-fmclient-wheels

View File

@ -12,6 +12,8 @@ Source1: LICENSE
%define debug_package %{nil}
BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
%description
CGTS platform Fault Management Client Library that provides APIs
@ -34,6 +36,7 @@ the Alarms & Logs Doc Yaml file
%build
%{__python} setup.py build
%py2_build_wheel
%install
%{__python} setup.py install --root=$RPM_BUILD_ROOT \
@ -41,6 +44,8 @@ the Alarms & Logs Doc Yaml file
--prefix=/usr \
--install-data=/usr/share \
--single-version-externally-managed
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
CGCS_DOC_DEPLOY=$RPM_BUILD_ROOT/%{cgcs_doc_deploy_dir}
install -d $CGCS_DOC_DEPLOY
@ -64,3 +69,12 @@ rm -rf $RPM_BUILD_ROOT
%files -n fm-api-doc
%defattr(-,root,root,-)
%{cgcs_doc_deploy_dir}/*
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*

View File

@ -17,6 +17,8 @@ BuildRequires: postgresql-devel
BuildRequires: libuuid-devel
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
%package -n fm-common-dev
Summary: CGTS Platform Fault Management Common Package - Development files
@ -50,6 +52,7 @@ MAJOR=`echo $VER | awk -F . '{print $1}'`
MINOR=`echo $VER | awk -F . '{print $2}'`
make MAJOR=$MAJOR MINOR=$MINOR %{?_smp_mflags}
%{__python} setup.py build
%py2_build_wheel
%install
rm -rf $RPM_BUILD_ROOT
@ -62,6 +65,8 @@ make DEST_DIR=$RPM_BUILD_ROOT BIN_DIR=%{local_bindir} LIB_DIR=%{_libdir} INC_DIR
--install-lib=%{pythonroot} \
--prefix=/usr \
--install-data=/usr/share
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
install -d $RPM_BUILD_ROOT/usr/bin
install -m 755 fm_db_sync_event_suppression.py $RPM_BUILD_ROOT/usr/bin/fm_db_sync_event_suppression.py
@ -98,3 +103,12 @@ rm -rf $RPM_BUILD_ROOT
%files -n fm-common-doc
%defattr(-,root,root,-)
%{cgcs_doc_deploy_dir}/*
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*

View File

@ -1,5 +1,6 @@
from distutils.core import setup, Extension
from setuptools import setup
from distutils.core import Extension
setup(name="fm_core", version="1.0",
ext_modules=[Extension("fm_core", [

View File

@ -10,6 +10,8 @@ Source0: %{name}-%{version}.tar.gz
BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
BuildRequires: python-oslo-config
BuildRequires: python-oslo-db
BuildRequires: python-oslo-log
@ -42,6 +44,7 @@ echo "Start build"
export PBR_VERSION=%{version}
%{__python} setup.py build
%py2_build_wheel
PYTHONPATH=. oslo-config-generator --config-file=fm/config-generator.conf
%install
@ -52,6 +55,8 @@ export PBR_VERSION=%{version}
--prefix=/usr \
--install-data=/usr/share \
--single-version-externally-managed
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
install -p -D -m 644 scripts/fm-api.service %{buildroot}%{_unitdir}/fm-api.service
install -d -m 755 %{buildroot}%{local_initddir}
@ -94,3 +99,11 @@ rm -rf $RPM_BUILD_ROOT
# pmond config file
%{local_etc_pmond}/fm-api.conf
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*

View File

@ -13,6 +13,8 @@ Source0: %{name}-%{version}.tar.gz
BuildRequires: git
BuildRequires: python-pbr >= 2.0.0
BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
Requires: python-keystoneauth1 >= 3.1.0
Requires: python-pbr >= 2.0.0
@ -48,6 +50,7 @@ echo "Start build"
export PBR_VERSION=%{version}
%{__python} setup.py build
%py2_build_wheel
%install
echo "Start install"
@ -57,6 +60,8 @@ export PBR_VERSION=%{version}
--prefix=/usr \
--install-data=/usr/share \
--single-version-externally-managed
mkdir -p $RPM_BUILD_ROOT/wheels
install -m 644 dist/*.whl $RPM_BUILD_ROOT/wheels/
install -d -m 755 %{buildroot}%{local_etc_bash_completiond}
install -p -D -m 664 tools/fm.bash_completion %{buildroot}%{local_etc_bash_completiond}/fm.bash_completion
@ -80,3 +85,11 @@ rm -rf $RPM_BUILD_ROOT
%files sdk
/usr/share/remote-clients/%{name}-%{version}.tgz
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/wheels/*