aboutsummaryrefslogtreecommitdiffstats
path: root/build-root/rpm/vpp.spec
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2016-09-12 22:00:32 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-09-23 13:18:46 +0000
commit57c3d66c55580f2ced6993ada22274941237fcd5 (patch)
tree55a856b3ddcc4f9e5284c7bc42b0126616825366 /build-root/rpm/vpp.spec
parent5fef9e523df67a96f3b9aedcec373e65f590b001 (diff)
Python API: Preparation for RPM/DEB packaging.
Recheck. Repackage the Python API binding to include all necessary modules in a single Python package. Change-Id: I5e35141d413bfb1aad650217e1ca07d85646c349 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'build-root/rpm/vpp.spec')
-rw-r--r--build-root/rpm/vpp.spec32
1 files changed, 32 insertions, 0 deletions
diff --git a/build-root/rpm/vpp.spec b/build-root/rpm/vpp.spec
index 96e6f0fd66a..35964b6df63 100644
--- a/build-root/rpm/vpp.spec
+++ b/build-root/rpm/vpp.spec
@@ -6,6 +6,17 @@
%define _version %(../scripts/version rpm-version)
%define _release %(../scripts/version rpm-release)
+# Failsafe backport of Python2-macros for RHEL <= 6
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%{!?python_version: %global python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")}
+%{!?__python2: %global __python2 %{__python}}
+%{!?python2_sitelib: %global python2_sitelib %{python_sitelib}}
+%{!?python2_sitearch: %global python2_sitearch %{python_sitearch}}
+%{!?python2_version: %global python2_version %{python_version}}
+
+%{!?python2_minor_version: %define python2_minor_version %(%{__python} -c "import sys ; print sys.version[2:3]")}
+
Name: vpp
Summary: Vector Packet Processing
License: MIT
@@ -56,6 +67,14 @@ Requires: vpp = %{_version}-%{_release}
%description plugins
This package contains VPP plugins
+%package python-api
+Summary: VPP api python bindings
+Group: Development/Libraries
+Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, devel = %{_version}-%{_release}
+
+%description python-api
+This package contains the python bindings for the vpp api
+
%pre
# Add the vpp group
groupadd -f -r vpp
@@ -68,6 +87,7 @@ mkdir -p -m755 %{buildroot}%{_bindir}
mkdir -p -m755 %{buildroot}%{_unitdir}
install -p -m 755 %{_vpp_install_dir}/*/bin/* %{buildroot}%{_bindir}
install -p -m 755 %{_vpp_build_dir}/vppapigen/vppapigen %{buildroot}%{_bindir}
+install -p -m 755 ../../vppapigen/pyvppapigen.py %{buildroot}%{_bindir}
#
# configs
#
@@ -93,6 +113,13 @@ do
ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
done
+# Python bindings
+mkdir -p -m755 %{buildroot}%{python2_sitelib}/vpp_papi
+for file in $(find %{_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
+
#
# devel
#
@@ -162,10 +189,15 @@ sysctl --system
%exclude %{_libdir}/vpp_api_test_plugins
%{_libdir}/*
+%files python-api
+%defattr(644,root,root)
+%{python2_sitelib}/vpp_papi/*
+
%files devel
%defattr(-,bin,bin)
/usr/bin/vppapigen
/usr/bin/jvpp_gen.py
+/usr/bin/pyvppapigen.py
%{_includedir}/*
%{python2_sitelib}/jvppgen/*
/usr/share/doc/vpp/examples/sample-plugin