blob: 85b1286c76ee8893ddd772dee5c7cf9b4ec9235a [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001%define _vpp_install_dir ../install-vpp-native
2%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
52%install
53#
54# binaries
55#
56mkdir -p -m755 %{buildroot}%{_bindir}
57mkdir -p -m755 %{buildroot}%{_unitdir}
58install -p -m 755 %{_vpp_install_dir}/*/bin/* %{buildroot}%{_bindir}
59install -p -m 755 %{_vpp_build_dir}/vppapigen/vppapigen %{buildroot}%{_bindir}
60#
61# configs
62#
63mkdir -p -m755 %{buildroot}/etc/vpp
64mkdir -p -m755 %{buildroot}/etc/sysctl.d
65install -p -m 644 vpp.service %{buildroot}%{_unitdir}
66install -p -m 644 ../../vpp/conf/startup.conf %{buildroot}/etc/vpp
67install -p -m 644 ../../vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d
68#
69# libraries
70#
71mkdir -p -m755 %{buildroot}%{_libdir}
72for file in $(find %{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*.*' -print )
73do
74 install -p -m 755 $file %{buildroot}%{_libdir}
75done
76for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
77do
78 # make lib symlinks
79 ( cd %{buildroot}%{_libdir} &&
80 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
81done
82#
83# devel
84#
85for dir in $(find %{_vpp_install_dir}/*/include/ -maxdepth 0 -type d -print | grep -v dpdk)
86do
87 for subdir in $(cd ${dir} && find . -type d -print)
88 do
89 mkdir -p -m755 %{buildroot}/usr/include/${subdir}
90 done
91 for file in $(cd ${dir} && find . -type f -print)
92 do
93 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
94 done
95done
96# sample plugin
97mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample
98for file in $(cd %{_vpp_install_dir}/../../sample-plugin && find -type f -print)
99do
100 install -p -m 644 %{_vpp_install_dir}/../../sample-plugin/$file \
101 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file
102done
103
104%post
105sysctl --system
106%systemd_post vpp.service
107
108%postun
109%systemd_postun_with_restart vpp.service
110
111%files
112%defattr(-,bin,bin)
113%{_unitdir}/vpp.service
Damjan Marion08ff7e02016-01-20 13:45:36 +0100114/usr/bin/vpp*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700115/usr/bin/svm*
Dave Barach0e5e3c32016-01-25 08:28:22 -0500116/usr/bin/elftool
Ed Warnickecb9cada2015-12-08 15:45:58 -0700117%config /etc/sysctl.d/80-vpp.conf
118%config /etc/vpp/startup.conf
119
120%files lib
121%defattr(-,bin,bin)
122%{_libdir}/*
123
124%files devel
125%defattr(-,bin,bin)
126/usr/bin/vppapigen
127%{_includedir}/*
128/usr/share/doc/vpp/examples/sample-plugin