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:
- nfv
- nova-api-proxy

Change-Id: Ibda4e57c840b8aa5da5d33a92c1146759a3f9a77
Story: 2003907
Task: 27528
Signed-off-by: Don Penney <don.penney@windriver.com>
This commit is contained in:
Don Penney 2018-10-22 16:51:01 -04:00
parent cdcdd5ebb3
commit 9b1b141207
3 changed files with 30 additions and 0 deletions

2
centos_wheels.inc Normal file
View File

@ -0,0 +1,2 @@
nfv-wheels
nova-api-proxy-wheels

View File

@ -11,6 +11,8 @@ Source0: %{name}-%{version}.tar.gz
%define debug_package %{nil}
BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
%description
Titanium Cloud Config Info
@ -21,6 +23,7 @@ Titanium Cloud Config Info
%define build_python() ( \
pushd %1; \
%{__python} setup.py build; \
%{__python} setup.py bdist_wheel; \
popd)
%define install_python() ( \
@ -31,6 +34,8 @@ Titanium Cloud Config Info
--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/; \
popd)
# TODO: nfv-docs
@ -185,3 +190,12 @@ rm -rf $RPM_BUILD_ROOT
%{pythonroot}/nfv_client/*
%dir %{pythonroot}/nfv_client-%{version}.0-py2.7.egg-info
%{pythonroot}/nfv_client-%{version}.0-py2.7.egg-info/*
%package wheels
Summary: NFV wheels
%description wheels
Contains python wheels for NFV
%files wheels
/wheels/*

View File

@ -11,6 +11,8 @@ Source0: %{name}-%{version}.tar.gz
%define debug_package %{nil}
BuildRequires: python-setuptools
BuildRequires: python2-pip
BuildRequires: python2-wheel
Requires: python-eventlet
Requires: python-routes
Requires: python-webob
@ -31,6 +33,7 @@ Nova Computer API Proxy
%build
%{__python} setup.py build
%py2_build_wheel
%install
%{__python} setup.py install --root=$RPM_BUILD_ROOT \
@ -38,6 +41,8 @@ Nova Computer API Proxy
--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_systemd}
install -p -D -m 644 nova_api_proxy/scripts/api-proxy.service %{buildroot}%{local_etc_systemd}/api-proxy.service
@ -64,3 +69,12 @@ rm -rf $RPM_BUILD_ROOT
%dir %{pythonroot}/nova_api_proxy
%{pythonroot}/nova_api_proxy/*
%{pythonroot}/api_proxy-%{version}.0-py2.7.egg-info/*
%package wheels
Summary: %{module_name} wheels
%description wheels
Contains python wheels for %{module_name}
%files wheels
/wheels/*