blob: 96e6f0fd66af6521ade1afc2b6828b48e98e4515 [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 Warnickef5a14362016-09-12 20:40:24 +000052%package plugins
53Summary: Vector Packet Processing--runtime plugins
54Group: System Environment/Libraries
55Requires: vpp = %{_version}-%{_release}
56%description plugins
57This package contains VPP plugins
58
Ed Warnickeec6290a2016-06-08 17:15:08 -050059%pre
60# Add the vpp group
Ed Warnickeb10427e2016-06-08 19:49:40 -050061groupadd -f -r vpp
Ed Warnickeec6290a2016-06-08 17:15:08 -050062
Ed Warnickecb9cada2015-12-08 15:45:58 -070063%install
64#
65# binaries
66#
67mkdir -p -m755 %{buildroot}%{_bindir}
68mkdir -p -m755 %{buildroot}%{_unitdir}
69install -p -m 755 %{_vpp_install_dir}/*/bin/* %{buildroot}%{_bindir}
70install -p -m 755 %{_vpp_build_dir}/vppapigen/vppapigen %{buildroot}%{_bindir}
71#
72# configs
73#
74mkdir -p -m755 %{buildroot}/etc/vpp
75mkdir -p -m755 %{buildroot}/etc/sysctl.d
76install -p -m 644 vpp.service %{buildroot}%{_unitdir}
Ed Warnicke40c66392016-06-08 14:41:40 -050077install -p -m 644 ../../vpp/conf/startup.uiopcigeneric.conf %{buildroot}/etc/vpp/startup.conf
Ed Warnickecb9cada2015-12-08 15:45:58 -070078install -p -m 644 ../../vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d
79#
80# libraries
81#
82mkdir -p -m755 %{buildroot}%{_libdir}
83for file in $(find %{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*.*' -print )
84do
85 install -p -m 755 $file %{buildroot}%{_libdir}
86done
87for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
88do
89 # make lib symlinks
90 ( cd %{buildroot}%{_libdir} &&
91 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
Ed Warnickef5a0e732016-09-07 17:12:52 +000092 ( cd %{buildroot}%{_libdir} &&
93 ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
Ed Warnickecb9cada2015-12-08 15:45:58 -070094done
Ed Warnicke406ab9d2016-08-31 18:48:47 -070095
Ed Warnickecb9cada2015-12-08 15:45:58 -070096#
97# devel
98#
99for dir in $(find %{_vpp_install_dir}/*/include/ -maxdepth 0 -type d -print | grep -v dpdk)
100do
101 for subdir in $(cd ${dir} && find . -type d -print)
102 do
103 mkdir -p -m755 %{buildroot}/usr/include/${subdir}
104 done
105 for file in $(cd ${dir} && find . -type f -print)
106 do
107 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
108 done
109done
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700110
111mkdir -p -m755 %{buildroot}%{python2_sitelib}/jvppgen
112install -p -m755 ../../vpp-api/java/jvpp/gen/jvpp_gen.py %{buildroot}/usr/bin
113for i in $(ls ../../vpp-api/java/jvpp/gen/jvppgen/*.py); do
114 install -p -m666 ${i} %{buildroot}%{python2_sitelib}/jvppgen
115done;
116
Ed Warnickecb9cada2015-12-08 15:45:58 -0700117# sample plugin
118mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample
119for file in $(cd %{_vpp_install_dir}/../../sample-plugin && find -type f -print)
120do
121 install -p -m 644 %{_vpp_install_dir}/../../sample-plugin/$file \
122 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file
123done
124
Ed Warnickef5a14362016-09-12 20:40:24 +0000125
126#
127# vpp-plugins
128#
129mkdir -p -m755 %{buildroot}%{_libdir}/vpp_plugins
130mkdir -p -m755 %{buildroot}%{_libdir}/vpp_api_test_plugins
131for file in $(cd %{_vpp_install_dir}/plugins/lib64/vpp_plugins && find -type f -print)
132do
133 install -p -m 644 %{_vpp_install_dir}/plugins/lib64/vpp_plugins/$file \
134 %{buildroot}%{_libdir}/vpp_plugins/$file
135done
136
137for file in $(cd %{_vpp_install_dir}/plugins/lib64/vpp_api_test_plugins && find -type f -print)
138do
139 install -p -m 644 %{_vpp_install_dir}/plugins/lib64/vpp_api_test_plugins/$file \
140 %{buildroot}%{_libdir}/vpp_api_test_plugins/$file
141done
142
Ed Warnickecb9cada2015-12-08 15:45:58 -0700143%post
144sysctl --system
145%systemd_post vpp.service
146
147%postun
148%systemd_postun_with_restart vpp.service
149
150%files
151%defattr(-,bin,bin)
152%{_unitdir}/vpp.service
Damjan Marion08ff7e02016-01-20 13:45:36 +0100153/usr/bin/vpp*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700154/usr/bin/svm*
Dave Barach0e5e3c32016-01-25 08:28:22 -0500155/usr/bin/elftool
Ed Warnickecb9cada2015-12-08 15:45:58 -0700156%config /etc/sysctl.d/80-vpp.conf
157%config /etc/vpp/startup.conf
158
159%files lib
160%defattr(-,bin,bin)
Ed Warnickef5a14362016-09-12 20:40:24 +0000161%exclude %{_libdir}/vpp_plugins
162%exclude %{_libdir}/vpp_api_test_plugins
Ed Warnickecb9cada2015-12-08 15:45:58 -0700163%{_libdir}/*
164
165%files devel
166%defattr(-,bin,bin)
167/usr/bin/vppapigen
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700168/usr/bin/jvpp_gen.py
Ed Warnickecb9cada2015-12-08 15:45:58 -0700169%{_includedir}/*
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700170%{python2_sitelib}/jvppgen/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700171/usr/share/doc/vpp/examples/sample-plugin
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700172
Ed Warnickef5a14362016-09-12 20:40:24 +0000173%files plugins
174%defattr(-,bin,bin)
175%{_libdir}/vpp_plugins/*
176%{_libdir}/vpp_api_test_plugins/*