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
15 Summary: Open vSwitch daemon/database/utilities
16 Group: System Environment/Daemons
17 URL: http://www.openvswitch.org/
23 Source: openvswitch-%{version}.tar.gz
24 Buildroot: /tmp/openvswitch-rpm
25 Requires: logrotate, python >= 2.7, python-six
26 BuildRequires: openssl-devel
31 Open vSwitch provides standard network bridging functions and
32 support for the OpenFlow protocol for remote per-flow control of
36 Summary: Open vSwitch development package
37 Group: Development/Libraries
40 This package provides openvswitch headers and libopenvswitch for developers.
46 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} \
47 --libdir=%{_libdir} --enable-ssl --enable-shared
51 rm -rf $RPM_BUILD_ROOT
52 make install DESTDIR=$RPM_BUILD_ROOT
57 dst=$RPM_BUILD_ROOT/$(echo $base | sed 's,_,/,g')
58 install -D -m $mode rhel/$base $dst
60 rhel_cp etc_init.d_openvswitch 0755
61 rhel_cp etc_logrotate.d_openvswitch 0644
62 rhel_cp etc_sysconfig_network-scripts_ifup-ovs 0755
63 rhel_cp etc_sysconfig_network-scripts_ifdown-ovs 0755
64 rhel_cp usr_share_openvswitch_scripts_sysconfig.template 0644
66 # Get rid of stuff we don't want to make RPM happy.
68 $RPM_BUILD_ROOT/usr/bin/ovs-testcontroller \
69 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-testcontroller.8 \
70 $RPM_BUILD_ROOT/usr/bin/ovs-test \
71 $RPM_BUILD_ROOT/usr/bin/ovs-l3ping \
72 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-test.8 \
73 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-l3ping.8 \
74 $RPM_BUILD_ROOT/usr/sbin/ovs-vlan-bug-workaround \
75 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-vlan-bug-workaround.8 \
76 $RPM_BUILD_ROOT/usr/bin/ovn-* \
77 $RPM_BUILD_ROOT/usr/share/man/man?/ovn-* \
78 $RPM_BUILD_ROOT/usr/share/openvswitch/ovn-* \
79 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/ovn-*
80 (cd "$RPM_BUILD_ROOT" && rm -rf usr/%{_lib}/*.la)
81 (cd "$RPM_BUILD_ROOT" && rm -rf usr/include)
83 install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
87 dst=$RPM_BUILD_ROOT/$2
88 install -d -m 0755 $dst
89 install -m 0644 $src/*.h $dst
91 copy_headers include %{_includedir}/openvswitch
92 copy_headers include/openflow %{_includedir}/openvswitch/openflow
93 copy_headers include/openvswitch %{_includedir}/openvswitch/openvswitch
94 copy_headers include/sparse %{_includedir}/openvswitch/sparse
95 copy_headers include/sparse/arpa %{_includedir}/openvswitch/sparse/arpa
96 copy_headers include/sparse/netinet %{_includedir}/openvswitch/sparse/netinet
97 copy_headers include/sparse/sys %{_includedir}/openvswitch/sparse/sys
98 copy_headers lib %{_includedir}/openvswitch/lib
100 install -D -m 0644 lib/.libs/libopenvswitch.a \
101 $RPM_BUILD_ROOT/%{_libdir}/libopenvswitch.a
105 if make check TESTSUITEFLAGS='%{_smp_mflags}' RECHECK=yes; then :;
107 cat tests/testsuite.log
113 rm -rf $RPM_BUILD_ROOT
116 # Create default or update existing /etc/sysconfig/openvswitch.
117 SYSCONFIG=/etc/sysconfig/openvswitch
118 TEMPLATE=/usr/share/openvswitch/scripts/sysconfig.template
119 if [ ! -e $SYSCONFIG ]; then
120 cp $TEMPLATE $SYSCONFIG
122 for var in $(awk -F'[ :]' '/^# [_A-Z0-9]+:/{print $2}' $TEMPLATE)
124 if ! grep $var $SYSCONFIG >/dev/null 2>&1; then
126 sed -n "/$var:/,/$var=/p" $TEMPLATE >> $SYSCONFIG
131 # Ensure all required services are set to run
132 /sbin/chkconfig --add openvswitch
133 /sbin/chkconfig openvswitch on
136 if [ "$1" = "0" ]; then # $1 = 0 for uninstall
137 /sbin/service openvswitch stop
138 /sbin/chkconfig --del openvswitch
142 if [ "$1" = "0" ]; then # $1 = 0 for uninstall
143 rm -f /etc/openvswitch/conf.db
144 rm -f /etc/sysconfig/openvswitch
145 rm -f /etc/openvswitch/vswitchd.cacert
151 %defattr(-,root,root)
152 %dir /etc/openvswitch
153 /etc/bash_completion.d/ovs-appctl-bashcomp.bash
154 /etc/bash_completion.d/ovs-vsctl-bashcomp.bash
155 /etc/init.d/openvswitch
156 %config(noreplace) /etc/logrotate.d/openvswitch
157 /etc/sysconfig/network-scripts/ifup-ovs
158 /etc/sysconfig/network-scripts/ifdown-ovs
161 /usr/bin/ovs-dpctl-top
164 /usr/bin/ovs-parse-backtrace
167 /usr/bin/ovs-tcpundump
168 /usr/bin/ovs-vlan-test
170 /usr/bin/ovsdb-client
174 /usr/sbin/ovs-bugtool
175 /usr/sbin/ovs-vswitchd
176 /usr/sbin/ovsdb-server
177 /usr/share/man/man1/ovs-pcap.1.gz
178 /usr/share/man/man1/ovs-tcpundump.1.gz
179 /usr/share/man/man1/ovsdb-client.1.gz
180 /usr/share/man/man1/ovsdb-server.1.gz
181 /usr/share/man/man1/ovsdb-tool.1.gz
182 /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
183 /usr/share/man/man5/vtep.5.gz
184 /usr/share/man/man8/ovs-appctl.8.gz
185 /usr/share/man/man8/ovs-bugtool.8.gz
186 /usr/share/man/man8/ovs-ctl.8.gz
187 /usr/share/man/man8/ovs-dpctl.8.gz
188 /usr/share/man/man8/ovs-dpctl-top.8.gz
189 /usr/share/man/man8/ovs-ofctl.8.gz
190 /usr/share/man/man8/ovs-parse-backtrace.8.gz
191 /usr/share/man/man8/ovs-pki.8.gz
192 /usr/share/man/man8/ovs-vlan-test.8.gz
193 /usr/share/man/man8/ovs-vsctl.8.gz
194 /usr/share/man/man8/ovs-vswitchd.8.gz
195 /usr/share/man/man8/vtep-ctl.8.gz
196 /usr/share/openvswitch/bugtool-plugins/
197 /usr/share/openvswitch/python/
198 /usr/share/openvswitch/scripts/ovs-bugtool-*
199 /usr/share/openvswitch/scripts/ovs-check-dead-ifs
200 /usr/share/openvswitch/scripts/ovs-ctl
201 /usr/share/openvswitch/scripts/ovs-lib
202 /usr/share/openvswitch/scripts/ovs-save
203 /usr/share/openvswitch/scripts/ovs-vtep
204 /usr/share/openvswitch/scripts/sysconfig.template
205 /usr/share/openvswitch/vswitch.ovsschema
206 /usr/share/openvswitch/vtep.ovsschema
207 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md FAQ.md NEWS
208 %doc INSTALL.DPDK.md rhel/README.RHEL README-native-tunneling.md
216 %{_includedir}/openvswitch/*