1 # Spec file for Open vSwitch on Red Hat Enterprise Linux.
3 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
5 # Copying and distribution of this file, with or without modification,
6 # are permitted in any medium without royalty provided the copyright
7 # notice and this notice are preserved. This file is offered as-is,
8 # without warranty of any kind.
10 # If tests have to be skipped while building, specify the '--without check'
11 # option. For example:
12 # rpmbuild -bb --without check rhel/openvswitch.spec
14 # Support for executing kernel data path tests under rpmbuild is
15 # provided, however this is intended for use only in test environments
16 # and should not be used otherwise (these tests require root privileges).
17 # These tests can be executed, for example, via:
18 # rpmbuild -rb --with check_datapath_kernel openvswitch.src.rpm
20 # These tests will use the currently installed OVS kernel modules, when
21 # testing out of tree kernel modules the appropriate openvswitch-kmod
22 # package should be installed first.
25 Summary: Open vSwitch daemon
/database
/utilities
26 Group: System Environment
/Daemons
27 URL: http
://www.openvswitch.org
/
33 Source: openvswitch
-%{version}.tar.gz
34 Buildroot: /tmp
/openvswitch
-rpm
35 Requires: logrotate
, hostname
, python
>= 2.7, python
-six
36 BuildRequires
: python
-six
37 BuildRequires
: openssl
-devel
38 BuildRequires
: checkpolicy
, selinux
-policy
-devel
39 BuildRequires
: autoconf
, automake
, libtool
40 BuildRequires
: python
-sphinx
43 %bcond_with check_datapath_kernel
46 Open vSwitch provides standard network bridging functions and
47 support
for the OpenFlow protocol
for remote per
-flow control of
51 Summary: Open vSwitch development package
52 Group: Development
/Libraries
55 This package provides openvswitch headers and libopenvswitch
for developers.
57 %package selinux
-policy
58 Summary: Open vSwitch SELinux policy
61 Requires: selinux
-policy
-targeted
63 %description selinux
-policy
64 Tailored Open vSwitch SELinux policy
70 .
/configure
--prefix
=/usr
--sysconfdir
=/etc
--localstatedir
=%{_localstatedir} \
71 --libdir
=%{_libdir} --enable-ssl
--enable-shared
76 rm -rf $RPM_BUILD_ROOT
77 make install DESTDIR
=$RPM_BUILD_ROOT
82 dst
=$RPM_BUILD_ROOT
/$
(echo $base | sed 's
,_
,/,g'
)
83 install -D
-m $mode rhel
/$base $dst
85 rhel_cp etc_init.d_openvswitch
0755
86 rhel_cp etc_logrotate.d_openvswitch
0644
87 rhel_cp etc_sysconfig_network
-scripts_ifup
-ovs
0755
88 rhel_cp etc_sysconfig_network
-scripts_ifdown
-ovs
0755
89 rhel_cp usr_share_openvswitch_scripts_sysconfig.template
0644
91 install -p
-m
644 -D selinux
/openvswitch
-custom.pp \
92 $RPM_BUILD_ROOT
%{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp
94 # Get rid of stuff we don't want to make RPM happy.
96 $RPM_BUILD_ROOT
/usr
/bin
/ovs
-testcontroller \
97 $RPM_BUILD_ROOT
/usr
/share
/man
/man8
/ovs
-testcontroller
.8 \
98 $RPM_BUILD_ROOT
/usr
/bin
/ovs
-test \
99 $RPM_BUILD_ROOT
/usr
/bin
/ovs
-l3ping \
100 $RPM_BUILD_ROOT
/usr
/share
/man
/man8
/ovs
-test.8 \
101 $RPM_BUILD_ROOT
/usr
/share
/man
/man8
/ovs
-l3ping
.8 \
102 $RPM_BUILD_ROOT
/usr
/sbin
/ovs
-vlan
-bug
-workaround \
103 $RPM_BUILD_ROOT
/usr
/share
/man
/man1
/ovs
-sim
.1 \
104 $RPM_BUILD_ROOT
/usr
/share
/man
/man8
/ovs
-vlan
-bug
-workaround
.8 \
105 $RPM_BUILD_ROOT
/usr
/bin
/ovn
-* \
106 $RPM_BUILD_ROOT
/usr
/share
/man
/man?
/ovn
-* \
107 $RPM_BUILD_ROOT
/usr
/share
/openvswitch
/ovn
-* \
108 $RPM_BUILD_ROOT
/usr
/share
/openvswitch
/scripts
/ovn
*
109 (cd "$RPM_BUILD_ROOT"
&& rm -rf usr
/%{_lib}/*.la
)
110 (cd "$RPM_BUILD_ROOT"
&& rm -rf usr
/include
)
112 install -d
-m
0755 $RPM_BUILD_ROOT
%{_rundir}/openvswitch
113 install -d
-m
0755 $RPM_BUILD_ROOT
%{_localstatedir}/log
/openvswitch
114 install -d
-m
0755 $RPM_BUILD_ROOT
/var
/lib
/openvswitch
118 dst
=$RPM_BUILD_ROOT
/$
2
119 install -d
-m
0755 $dst
120 install -m
0644 $src
/*.h $dst
122 copy_headers include
%{_includedir}/openvswitch
123 copy_headers include
/openflow
%{_includedir}/openvswitch
/openflow
124 copy_headers include
/openvswitch
%{_includedir}/openvswitch
/openvswitch
125 copy_headers include
/sparse
%{_includedir}/openvswitch
/sparse
126 copy_headers include
/sparse
/arpa
%{_includedir}/openvswitch
/sparse
/arpa
127 copy_headers include
/sparse
/netinet
%{_includedir}/openvswitch
/sparse
/netinet
128 copy_headers include
/sparse
/sys
%{_includedir}/openvswitch
/sparse
/sys
129 copy_headers lib
%{_includedir}/openvswitch
/lib
131 install -D
-m
0644 lib
/.libs
/libopenvswitch.a \
132 $RPM_BUILD_ROOT
/%{_libdir}/libopenvswitch.a
136 if make check TESTSUITEFLAGS
='
%{_smp_mflags}' RECHECK
=yes
; then :;
138 cat tests
/testsuite.log
142 %if %{with check_datapath_kernel}
143 if make check
-kernel RECHECK
=yes
; then :;
145 cat tests
/system
-kmod
-testsuite.log
151 rm -rf $RPM_BUILD_ROOT
154 # Create default or update existing /etc/sysconfig/openvswitch.
155 SYSCONFIG
=/etc
/sysconfig
/openvswitch
156 TEMPLATE
=/usr
/share
/openvswitch
/scripts
/sysconfig.template
157 if [ ! -e $SYSCONFIG
]; then
158 cp $TEMPLATE $SYSCONFIG
160 for var
in $
(awk
-F'
[ :]' '
/^
# [_A-Z0-9]+:/{print $2}' $TEMPLATE)
162 if ! grep $var $SYSCONFIG
>/dev
/null
2>&1; then
164 sed
-n "
/$var
:/,/$var
=/p" $TEMPLATE
>> $SYSCONFIG
169 # Ensure all required services are set to run
170 /sbin
/chkconfig
--add openvswitch
171 /sbin
/chkconfig openvswitch on
174 /usr
/sbin
/semodule
-i
%{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp
&> /dev
/null ||
:
177 if [ "$
1"
= "
0"
]; then # $1 = 0 for uninstall
178 /sbin
/service openvswitch stop
179 /sbin
/chkconfig
--del openvswitch
183 if [ "$
1"
= "
0"
]; then # $1 = 0 for uninstall
184 rm -f
/etc
/openvswitch
/conf.db
185 rm -f
/etc
/sysconfig
/openvswitch
186 rm -f
/etc
/openvswitch
/vswitchd.cacert
189 %postun selinux
-policy
190 if [ $
1 -eq
0 ] ; then
191 /usr
/sbin
/semodule
-r openvswitch
-custom
&> /dev
/null ||
:
197 %defattr(-,root
,root
)
198 %dir /etc
/openvswitch
199 /etc
/bash_completion.d
/ovs
-appctl
-bashcomp.bash
200 /etc
/bash_completion.d
/ovs
-vsctl
-bashcomp.bash
201 /etc
/init.d
/openvswitch
202 %config(noreplace
) /etc
/logrotate.d
/openvswitch
203 /etc
/sysconfig
/network
-scripts
/ifup
-ovs
204 /etc
/sysconfig
/network
-scripts
/ifdown
-ovs
207 /usr
/bin
/ovs
-dpctl
-top
210 /usr
/bin
/ovs
-parse
-backtrace
214 /usr
/bin
/ovs
-tcpundump
215 /usr
/bin
/ovs
-vlan
-test
217 /usr
/bin
/ovsdb
-client
221 /usr
/sbin
/ovs
-bugtool
222 /usr
/sbin
/ovs
-vswitchd
223 /usr
/sbin
/ovsdb
-server
224 /usr
/share
/man
/man1
/ovs
-pcap
.1.gz
225 /usr
/share
/man
/man1
/ovs
-tcpundump
.1.gz
226 /usr
/share
/man
/man1
/ovsdb
-client
.1.gz
227 /usr
/share
/man
/man1
/ovsdb
-server
.1.gz
228 /usr
/share
/man
/man1
/ovsdb
-tool
.1.gz
229 /usr
/share
/man
/man5
/ovsdb
-server
.5.gz
230 /usr
/share
/man
/man5
/ovs
-vswitchd.conf.db
.5.gz
231 %{_mandir}/man5
/ovsdb
.5*
232 /usr
/share
/man
/man5
/vtep
.5.gz
233 /usr
/share
/man
/man7
/ovs
-fields
.7.gz
234 %{_mandir}/man7
/ovsdb
.7*
235 %{_mandir}/man7
/ovsdb
-server
.7*
236 /usr
/share
/man
/man8
/ovs
-appctl
.8.gz
237 /usr
/share
/man
/man8
/ovs
-bugtool
.8.gz
238 /usr
/share
/man
/man8
/ovs
-ctl
.8.gz
239 /usr
/share
/man
/man8
/ovs
-dpctl
.8.gz
240 /usr
/share
/man
/man8
/ovs
-dpctl
-top
.8.gz
241 /usr
/share
/man
/man8
/ovs
-kmod
-ctl
.8.gz
242 /usr
/share
/man
/man8
/ovs
-ofctl
.8.gz
243 /usr
/share
/man
/man8
/ovs
-parse
-backtrace
.8.gz
244 /usr
/share
/man
/man8
/ovs
-pki
.8.gz
245 /usr
/share
/man
/man8
/ovs
-tcpdump
.8.gz
246 /usr
/share
/man
/man8
/ovs
-vlan
-test.8.gz
247 /usr
/share
/man
/man8
/ovs
-vsctl
.8.gz
248 /usr
/share
/man
/man8
/ovs
-vswitchd
.8.gz
249 /usr
/share
/man
/man8
/vtep
-ctl
.8.gz
250 /usr
/share
/openvswitch
/bugtool
-plugins
/
251 /usr
/share
/openvswitch
/python
/
252 /usr
/share
/openvswitch
/scripts
/ovs
-bugtool
-*
253 /usr
/share
/openvswitch
/scripts
/ovs
-check
-dead
-ifs
254 /usr
/share
/openvswitch
/scripts
/ovs
-ctl
255 /usr
/share
/openvswitch
/scripts
/ovs
-kmod
-ctl
256 /usr
/share
/openvswitch
/scripts
/ovs
-lib
257 /usr
/share
/openvswitch
/scripts
/ovs
-save
258 /usr
/share
/openvswitch
/scripts
/ovs
-vtep
259 /usr
/share
/openvswitch
/scripts
/sysconfig.template
260 /usr
/share
/openvswitch
/vswitch.ovsschema
261 /usr
/share
/openvswitch
/vtep.ovsschema
262 %doc NOTICE README.rst NEWS rhel
/README.RHEL.rst
270 %{_includedir}/openvswitch
/*
272 %files selinux
-policy
273 %defattr(-,root
,root
)
274 %{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp