From 9b1b141207ca0ba303fda26026f0f254fb9a8dba Mon Sep 17 00:00:00 2001 From: Don Penney Date: Mon, 22 Oct 2018 16:51:01 -0400 Subject: [PATCH] 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 --- centos_wheels.inc | 2 ++ nfv/centos/nfv.spec | 14 ++++++++++++++ nova-api-proxy/centos/nova-api-proxy.spec | 14 ++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 centos_wheels.inc diff --git a/centos_wheels.inc b/centos_wheels.inc new file mode 100644 index 00000000..485553c4 --- /dev/null +++ b/centos_wheels.inc @@ -0,0 +1,2 @@ +nfv-wheels +nova-api-proxy-wheels diff --git a/nfv/centos/nfv.spec b/nfv/centos/nfv.spec index fce61641..109450fc 100755 --- a/nfv/centos/nfv.spec +++ b/nfv/centos/nfv.spec @@ -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/* diff --git a/nova-api-proxy/centos/nova-api-proxy.spec b/nova-api-proxy/centos/nova-api-proxy.spec index aada7763..1d187502 100644 --- a/nova-api-proxy/centos/nova-api-proxy.spec +++ b/nova-api-proxy/centos/nova-api-proxy.spec @@ -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/*