blob: 4a666e68aa44a3a4d98a49f96039cb705df0fde8 [file] [log] [blame]
Sachin693b7022016-06-18 15:28:08 +05301%define _vpp_install_dir ../%{_install_dir}
Ed Warnickecb9cada2015-12-08 15:45:58 -07002%define _vpp_build_dir ../build-tool-native
3%define _unitdir /lib/systemd/system
4%define _topdir %(pwd)
5%define _builddir %{_topdir}
6%define _version %(../scripts/version rpm-version)
7%define _release %(../scripts/version rpm-release)
8
9Name: vpp
10Summary: Vector Packet Processing
11License: MIT
12Version: %{_version}
13Release: %{_release}
14Requires: vpp-lib = %{_version}-%{_release}, net-tools, pciutils
15
16%description
Damjan Marion08ff7e02016-01-20 13:45:36 +010017This package provides VPP executables: vpp, vpp_api_test, vpp_json_test
18vpp - the vector packet engine
19vpp_api_test - vector packet engine API test tool
20vpp_json_test - vector packet engine JSON test tool
Ed Warnickecb9cada2015-12-08 15:45:58 -070021
22%package lib
23Summary: VPP libraries
24Group: System Environment/Libraries
25
26%description lib
27This package contains the VPP shared libraries, including:
28vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting.
29dpdk - Intel DPDK library
30svm - vm library
31vlib - vector processing library
32vlib-api - binary API library
33vnet - network stack library
34
35%package devel
36Summary: VPP header files, static libraries
37Group: Development/Libraries
38Requires: vpp-lib
39
40%description devel
41This package contains the header files and static libraries for
42vppinfra. Install this package if you want to write or compile a
43program that needs vpp.
44Do we need to list those header files or just leave it blank ?
45dynamic vectors (vec.c), dynamic bitmaps (bitmap.h), allocation heap of
46objects (heap.c), allocation pool(pool.h), dynamic hash tables (hash.c), memory
47allocator (mheap.c), extendable printf-like interface built on top of vectors
48(format.c), formats for data structures (std-formats.c), and support for clock
49time-based function calls (timer.c).
50TODO: reference and describe only the .h files
51
Ed Warnickeec6290a2016-06-08 17:15:08 -050052%pre
53# Add the vpp group
Ed Warnickeb10427e2016-06-08 19:49:40 -050054groupadd -f -r vpp
Ed Warnickeec6290a2016-06-08 17:15:08 -050055
Ed Warnickecb9cada2015-12-08 15:45:58 -070056%install
57#
58# binaries
59#
60mkdir -p -m755 %{buildroot}%{_bindir}
61mkdir -p -m755 %{buildroot}%{_unitdir}
62install -p -m 755 %{_vpp_install_dir}/*/bin/* %{buildroot}%{_bindir}
63install -p -m 755 %{_vpp_build_dir}/vppapigen/vppapigen %{buildroot}%{_bindir}
64#
65# configs
66#
67mkdir -p -m755 %{buildroot}/etc/vpp
68mkdir -p -m755 %{buildroot}/etc/sysctl.d
69install -p -m 644 vpp.service %{buildroot}%{_unitdir}
Ed Warnicke40c66392016-06-08 14:41:40 -050070install -p -m 644 ../../vpp/conf/startup.uiopcigeneric.conf %{buildroot}/etc/vpp/startup.conf
Ed Warnickecb9cada2015-12-08 15:45:58 -070071install -p -m 644 ../../vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d
72#
73# libraries
74#
75mkdir -p -m755 %{buildroot}%{_libdir}
76for file in $(find %{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*.*' -print )
77do
78 install -p -m 755 $file %{buildroot}%{_libdir}
79done
80for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
81do
82 # make lib symlinks
83 ( cd %{buildroot}%{_libdir} &&
84 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
85done
86#
87# devel
88#
89for dir in $(find %{_vpp_install_dir}/*/include/ -maxdepth 0 -type d -print | grep -v dpdk)
90do
91 for subdir in $(cd ${dir} && find . -type d -print)
92 do
93 mkdir -p -m755 %{buildroot}/usr/include/${subdir}
94 done
95 for file in $(cd ${dir} && find . -type f -print)
96 do
97 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
98 done
99done
100# sample plugin
101mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample
102for file in $(cd %{_vpp_install_dir}/../../sample-plugin && find -type f -print)
103do
104 install -p -m 644 %{_vpp_install_dir}/../../sample-plugin/$file \
105 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file
106done
107
108%post
109sysctl --system
110%systemd_post vpp.service
111
112%postun
113%systemd_postun_with_restart vpp.service
114
115%files
116%defattr(-,bin,bin)
117%{_unitdir}/vpp.service
Damjan Marion08ff7e02016-01-20 13:45:36 +0100118/usr/bin/vpp*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700119/usr/bin/svm*
Dave Barach0e5e3c32016-01-25 08:28:22 -0500120/usr/bin/elftool
Ed Warnickecb9cada2015-12-08 15:45:58 -0700121%config /etc/sysctl.d/80-vpp.conf
122%config /etc/vpp/startup.conf
123
124%files lib
125%defattr(-,bin,bin)
126%{_libdir}/*
127
128%files devel
129%defattr(-,bin,bin)
130/usr/bin/vppapigen
131%{_includedir}/*
132/usr/share/doc/vpp/examples/sample-plugin