diff options
author | Ed Warnicke <eaw@cisco.com> | 2016-09-13 20:04:28 +0000 |
---|---|---|
committer | Ed Warnicke <hagbard@gmail.com> | 2016-09-16 19:07:54 +0000 |
commit | 6e811b1125f1be24575270594ff2a46b8d62c3f0 (patch) | |
tree | 20b9c71e797b0fd7a261c63c88965c1b77a08db6 /nsh-plugin/packaging | |
parent | 7e1fb32a85d72b147b9d3b2aa92223d782d166e3 (diff) |
nsh-plugin rpm packaging
Change-Id: I7acc688b3c40cbce34ada9be957b274c34780570
Signed-off-by: Ed Warnicke <eaw@cisco.com>
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
Diffstat (limited to 'nsh-plugin/packaging')
-rw-r--r-- | nsh-plugin/packaging/rpm/.gitignore | 6 | ||||
-rw-r--r-- | nsh-plugin/packaging/rpm/vpp-nsh-plugin.spec | 47 | ||||
-rwxr-xr-x | nsh-plugin/packaging/scripts/version | 27 |
3 files changed, 80 insertions, 0 deletions
diff --git a/nsh-plugin/packaging/rpm/.gitignore b/nsh-plugin/packaging/rpm/.gitignore new file mode 100644 index 0000000..2410124 --- /dev/null +++ b/nsh-plugin/packaging/rpm/.gitignore @@ -0,0 +1,6 @@ +BUILD +BUILDROOT +RPMS +SOURCES +SPECS +SRPMS diff --git a/nsh-plugin/packaging/rpm/vpp-nsh-plugin.spec b/nsh-plugin/packaging/rpm/vpp-nsh-plugin.spec new file mode 100644 index 0000000..c114200 --- /dev/null +++ b/nsh-plugin/packaging/rpm/vpp-nsh-plugin.spec @@ -0,0 +1,47 @@ +%define _topdir %(pwd) +%define _builddir %{_topdir} +%define _version %(../scripts/version rpm-version) +%define _release %(../scripts/version rpm-release) + +Name: vpp-nsh-plugin +Summary: Vector Packet Processing +License: Apache +Version: %{_version} +Release: %{_release} +Requires: vpp +%description +This package provides an nsh plugin for vpp + +%package devel +Summary: VPP header files, static libraries +Group: Development/Libraries +Requires: vpp-nsh-plugin = %{_version}-%{_release}, vpp-devel +%description devel +This package contains the headers for C bindings for the vpp-nsh-plugin + +%install +# +# vpp-nsh-plugin +# +mkdir -p -m755 %{buildroot}%{_libdir}/vpp_plugins +install -m 644 %{_plugin_prefix}/lib/vpp_plugins/nsh_plugin.so %{buildroot}%{_libdir}/vpp_plugins/nsh_plugin.so +mkdir -p -m755 %{buildroot}%{_libdir}/vpp_api_test_plugins +install -m 644 %{_plugin_prefix}/lib/vpp_api_test_plugins/nsh_test_plugin.so %{buildroot}%{_libdir}/vpp_api_test_plugins/nsh_test_plugin.so + +# +# vpp-nsh-plugin-devel +# +mkdir -p -m755 %{buildroot}%{_includedir}/vpp-api/ +install -m 644 %{_plugin_prefix}/include/vpp-api/nsh_all_api_h.h %{buildroot}%{_includedir}/vpp-api/nsh_all_api_h.h +install -m 644 %{_plugin_prefix}/include/vpp-api/nsh_msg_enum.h %{buildroot}%{_includedir}/vpp-api/nsh_msg_enum.h +install -m 644 %{_plugin_prefix}/include/vpp-api/nsh.api.h %{buildroot}%{_includedir}/vpp-api/nsh.api.h + + +%files +%defattr(-,bin,bin) +%{_libdir}/vpp_plugins/nsh_plugin.so +%{_libdir}/vpp_api_test_plugins/nsh_test_plugin.so + +%files devel +%defattr(-,bin,bin) +%{_includedir}/* diff --git a/nsh-plugin/packaging/scripts/version b/nsh-plugin/packaging/scripts/version new file mode 100755 index 0000000..84ee5db --- /dev/null +++ b/nsh-plugin/packaging/scripts/version @@ -0,0 +1,27 @@ +#!/bin/bash + +TAG=$(git describe | cut -d- -f1 | sed -e 's/^v//') +ADD=$(git describe | cut -s -d- -f2) +CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4) + +if [ -n "${BUILD_NUMBER}" ]; then + BLD="~b${BUILD_NUMBER}" +fi + +if [ "$1" = "rpm-version" ]; then + echo ${TAG} + exit +fi + +if [ "$1" = "rpm-release" ]; then + [ -z "${ADD}" ] && echo release && exit + CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4 | sed 's/-/_/') + echo ${ADD}${CMT:+~${CMT}}${BLD} + exit +fi + +if [ -n "${ADD}" ]; then + echo ${TAG}-${ADD}${CMT:+~${CMT}}${BLD} +else + echo ${TAG} +fi |