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
, python
>= 2.7, python
-six
36 BuildRequires
: openssl
-devel
37 BuildRequires
: checkpolicy
, selinux
-policy
-devel
40 %bcond_with check_datapath_kernel
43 Open vSwitch provides standard network bridging functions and
44 support
for the OpenFlow protocol
for remote per
-flow control of
48 Summary: Open vSwitch development package
49 Group: Development
/Libraries
52 This package provides openvswitch headers and libopenvswitch
for developers.
54 %package selinux
-policy
55 Summary: Open vSwitch SELinux policy
58 Requires: selinux
-policy
-targeted
60 %description selinux
-policy
61 Tailored Open vSwitch SELinux policy
67 .
/configure
--prefix
=/usr
--sysconfdir
=/etc
--localstatedir
=%{_localstatedir} \
68 --libdir
=%{_libdir} --enable-ssl
--enable-shared
71 make -f
%{_datadir}/selinux
/devel
/Makefile
74 rm -rf $RPM_BUILD_ROOT
75 make install DESTDIR
=$RPM_BUILD_ROOT
80 dst
=$RPM_BUILD_ROOT
/$
(echo $base | sed 's
,_
,/,g'
)
81 install -D
-m $mode rhel
/$base $dst
83 rhel_cp etc_init.d_openvswitch
0755
84 rhel_cp etc_logrotate.d_openvswitch
0644
85 rhel_cp etc_sysconfig_network
-scripts_ifup
-ovs
0755
86 rhel_cp etc_sysconfig_network
-scripts_ifdown
-ovs
0755
87 rhel_cp usr_share_openvswitch_scripts_sysconfig.template
0644
89 install -p
-m
644 -D selinux
/openvswitch
-custom.pp \
90 $RPM_BUILD_ROOT
%{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp
92 # Get rid of stuff we don't want to make RPM happy.
94 $RPM_BUILD_ROOT
/usr
/bin
/ovs
-testcontroller \
95 $RPM_BUILD_ROOT
/usr
/share
/man
/man8
/ovs
-testcontroller
.8 \
96 $RPM_BUILD_ROOT
/usr
/bin
/ovs
-test \
97 $RPM_BUILD_ROOT
/usr
/bin
/ovs
-l3ping \
98 $RPM_BUILD_ROOT
/usr
/share
/man
/man8
/ovs
-test.8 \
99 $RPM_BUILD_ROOT
/usr
/share
/man
/man8
/ovs
-l3ping
.8 \
100 $RPM_BUILD_ROOT
/usr
/sbin
/ovs
-vlan
-bug
-workaround \
101 $RPM_BUILD_ROOT
/usr
/share
/man
/man8
/ovs
-vlan
-bug
-workaround
.8 \
102 $RPM_BUILD_ROOT
/usr
/bin
/ovn
-* \
103 $RPM_BUILD_ROOT
/usr
/share
/man
/man?
/ovn
-* \
104 $RPM_BUILD_ROOT
/usr
/share
/openvswitch
/ovn
-* \
105 $RPM_BUILD_ROOT
/usr
/share
/openvswitch
/scripts
/ovn
-*
106 (cd "$RPM_BUILD_ROOT"
&& rm -rf usr
/%{_lib}/*.la
)
107 (cd "$RPM_BUILD_ROOT"
&& rm -rf usr
/include
)
109 install -d
-m
755 $RPM_BUILD_ROOT
/var
/lib
/openvswitch
113 dst
=$RPM_BUILD_ROOT
/$
2
114 install -d
-m
0755 $dst
115 install -m
0644 $src
/*.h $dst
117 copy_headers include
%{_includedir}/openvswitch
118 copy_headers include
/openflow
%{_includedir}/openvswitch
/openflow
119 copy_headers include
/openvswitch
%{_includedir}/openvswitch
/openvswitch
120 copy_headers include
/sparse
%{_includedir}/openvswitch
/sparse
121 copy_headers include
/sparse
/arpa
%{_includedir}/openvswitch
/sparse
/arpa
122 copy_headers include
/sparse
/netinet
%{_includedir}/openvswitch
/sparse
/netinet
123 copy_headers include
/sparse
/sys
%{_includedir}/openvswitch
/sparse
/sys
124 copy_headers lib
%{_includedir}/openvswitch
/lib
126 install -D
-m
0644 lib
/.libs
/libopenvswitch.a \
127 $RPM_BUILD_ROOT
/%{_libdir}/libopenvswitch.a
131 if make check TESTSUITEFLAGS
='
%{_smp_mflags}' RECHECK
=yes
; then :;
133 cat tests
/testsuite.log
137 %if %{with check_datapath_kernel}
138 if make check
-kernel RECHECK
=yes
; then :;
140 cat tests
/system
-kmod
-testsuite.log
146 rm -rf $RPM_BUILD_ROOT
149 # Create default or update existing /etc/sysconfig/openvswitch.
150 SYSCONFIG
=/etc
/sysconfig
/openvswitch
151 TEMPLATE
=/usr
/share
/openvswitch
/scripts
/sysconfig.template
152 if [ ! -e $SYSCONFIG
]; then
153 cp $TEMPLATE $SYSCONFIG
155 for var
in $
(awk
-F'
[ :]' '
/^
# [_A-Z0-9]+:/{print $2}' $TEMPLATE)
157 if ! grep $var $SYSCONFIG
>/dev
/null
2>&1; then
159 sed
-n "
/$var
:/,/$var
=/p" $TEMPLATE
>> $SYSCONFIG
164 # Ensure all required services are set to run
165 /sbin
/chkconfig
--add openvswitch
166 /sbin
/chkconfig openvswitch on
169 /usr
/sbin
/semodule
-i
%{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp
&> /dev
/null ||
:
172 if [ "$
1"
= "
0"
]; then # $1 = 0 for uninstall
173 /sbin
/service openvswitch stop
174 /sbin
/chkconfig
--del openvswitch
178 if [ "$
1"
= "
0"
]; then # $1 = 0 for uninstall
179 rm -f
/etc
/openvswitch
/conf.db
180 rm -f
/etc
/sysconfig
/openvswitch
181 rm -f
/etc
/openvswitch
/vswitchd.cacert
184 %postun selinux
-policy
185 if [ $
1 -eq
0 ] ; then
186 /usr
/sbin
/semodule
-r openvswitch
-custom
&> /dev
/null ||
:
192 %defattr(-,root
,root
)
193 %dir /etc
/openvswitch
194 /etc
/bash_completion.d
/ovs
-appctl
-bashcomp.bash
195 /etc
/bash_completion.d
/ovs
-vsctl
-bashcomp.bash
196 /etc
/init.d
/openvswitch
197 %config(noreplace
) /etc
/logrotate.d
/openvswitch
198 /etc
/sysconfig
/network
-scripts
/ifup
-ovs
199 /etc
/sysconfig
/network
-scripts
/ifdown
-ovs
202 /usr
/bin
/ovs
-dpctl
-top
205 /usr
/bin
/ovs
-parse
-backtrace
209 /usr
/bin
/ovs
-tcpundump
210 /usr
/bin
/ovs
-vlan
-test
212 /usr
/bin
/ovsdb
-client
216 /usr
/sbin
/ovs
-bugtool
217 /usr
/sbin
/ovs
-vswitchd
218 /usr
/sbin
/ovsdb
-server
219 /usr
/share
/man
/man1
/ovs
-pcap
.1.gz
220 /usr
/share
/man
/man1
/ovs
-tcpundump
.1.gz
221 /usr
/share
/man
/man1
/ovsdb
-client
.1.gz
222 /usr
/share
/man
/man1
/ovsdb
-server
.1.gz
223 /usr
/share
/man
/man1
/ovsdb
-tool
.1.gz
224 /usr
/share
/man
/man5
/ovs
-vswitchd.conf.db
.5.gz
225 /usr
/share
/man
/man5
/vtep
.5.gz
226 /usr
/share
/man
/man8
/ovs
-appctl
.8.gz
227 /usr
/share
/man
/man8
/ovs
-bugtool
.8.gz
228 /usr
/share
/man
/man8
/ovs
-ctl
.8.gz
229 /usr
/share
/man
/man8
/ovs
-dpctl
.8.gz
230 /usr
/share
/man
/man8
/ovs
-dpctl
-top
.8.gz
231 /usr
/share
/man
/man8
/ovs
-ofctl
.8.gz
232 /usr
/share
/man
/man8
/ovs
-parse
-backtrace
.8.gz
233 /usr
/share
/man
/man8
/ovs
-pki
.8.gz
234 /usr
/share
/man
/man8
/ovs
-tcpdump
.8.gz
235 /usr
/share
/man
/man8
/ovs
-vlan
-test.8.gz
236 /usr
/share
/man
/man8
/ovs
-vsctl
.8.gz
237 /usr
/share
/man
/man8
/ovs
-vswitchd
.8.gz
238 /usr
/share
/man
/man8
/vtep
-ctl
.8.gz
239 /usr
/share
/openvswitch
/bugtool
-plugins
/
240 /usr
/share
/openvswitch
/python
/
241 /usr
/share
/openvswitch
/scripts
/ovs
-bugtool
-*
242 /usr
/share
/openvswitch
/scripts
/ovs
-check
-dead
-ifs
243 /usr
/share
/openvswitch
/scripts
/ovs
-ctl
244 /usr
/share
/openvswitch
/scripts
/ovs
-lib
245 /usr
/share
/openvswitch
/scripts
/ovs
-save
246 /usr
/share
/openvswitch
/scripts
/ovs
-vtep
247 /usr
/share
/openvswitch
/scripts
/sysconfig.template
248 /usr
/share
/openvswitch
/vswitch.ovsschema
249 /usr
/share
/openvswitch
/vtep.ovsschema
250 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY
-OVS.md FAQ.md NEWS
251 %doc INSTALL.DPDK.rst rhel
/README.RHEL README
-native
-tunneling.md
259 %{_includedir}/openvswitch
/*
261 %files selinux
-policy
262 %defattr(-,root
,root
)
263 %{_datadir}/selinux/packages/%{name}/openvswitch
-custom.pp