summaryrefslogtreecommitdiffstats
path: root/build-root/rpm
diff options
context:
space:
mode:
authorGabriel Ganne <gabriel.ganne@qosmos.com>2016-12-06 19:12:49 +0100
committerOle Trøan <otroan@employees.org>2016-12-08 20:05:48 +0000
commit32905661d1d16198d74ec4596fe95659ebf81b67 (patch)
tree14fa8e0e8d6fbc386b8ffe9ffd76568a46bb9b64 /build-root/rpm
parentb868e4ea385544c96c26972e4f055bf3c6324449 (diff)
vpp-python-api packaging - use easy_install to install the python api
adds python-setuptools as dependency Change-Id: I186f5d4353ee7667377fb6b0486d16a1571bdf09 Signed-off-by: Gabriel Ganne <gabriel.ganne@qosmos.com>
Diffstat (limited to 'build-root/rpm')
-rw-r--r--build-root/rpm/vpp.spec17
1 files changed, 10 insertions, 7 deletions
diff --git a/build-root/rpm/vpp.spec b/build-root/rpm/vpp.spec
index 5db0c4bd7c1..dd4817ee920 100644
--- a/build-root/rpm/vpp.spec
+++ b/build-root/rpm/vpp.spec
@@ -74,7 +74,7 @@ This package contains VPP plugins
%package python-api
Summary: VPP api python bindings
Group: Development/Libraries
-Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}
+Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, python-setuptools
%description python-api
This package contains the python bindings for the vpp api
@@ -134,11 +134,8 @@ do
done
# Python bindings
-mkdir -p -m755 %{buildroot}%{python2_sitelib}/vpp_papi
-for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/lib/python2.7/site-packages/ -type f -print | grep -v pyc | grep -v pyo)
-do
- install -p -m 666 $file %{buildroot}%{python2_sitelib}/vpp_papi/
-done
+mkdir -p -m755 %{buildroot}%{python2_sitelib}
+install -p -m 666 %{_mu_build_dir}/%{_vpp_install_dir}/*/lib/python2.7/site-packages/vpp_papi-*.egg %{buildroot}%{python2_sitelib}
#
# devel
@@ -196,9 +193,15 @@ done
sysctl --system
%systemd_post vpp.service
+%post python-api
+easy_install -z %{python2_sitelib}/vpp_papi-*.egg
+
%preun
%systemd_preun vpp.service
+%preun python-api
+easy_install -mxNq vpp_papi
+
%postun
%systemd_postun
@@ -239,7 +242,7 @@ fi
%files python-api
%defattr(644,root,root)
-%{python2_sitelib}/vpp_papi/*
+%{python2_sitelib}/vpp_papi-*.egg
%files devel
%defattr(-,bin,bin)