1 # Spec file for Open vSwitch on Red Hat Enterprise Linux.
3 # Copyright (C) 2009, 2010, 2011, 2012, 2013 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: openvswitch-kmod, logrotate, python
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
39 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --enable-ssl
43 rm -rf $RPM_BUILD_ROOT
44 make install DESTDIR=$RPM_BUILD_ROOT
49 dst=$RPM_BUILD_ROOT/$(echo $base | sed 's,_,/,g')
50 install -D -m $mode rhel/$base $dst
52 rhel_cp etc_init.d_openvswitch 0755
53 rhel_cp etc_logrotate.d_openvswitch 0644
54 rhel_cp etc_sysconfig_network-scripts_ifup-ovs 0755
55 rhel_cp etc_sysconfig_network-scripts_ifdown-ovs 0755
56 rhel_cp usr_share_openvswitch_scripts_sysconfig.template 0644
58 docdir=$RPM_BUILD_ROOT/usr/share/doc/openvswitch-%{version}
59 install -d -m755 "$docdir"
60 install -m 0644 FAQ rhel/README.RHEL "$docdir"
61 install python/compat/uuid.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
62 install python/compat/argparse.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
64 # Get rid of stuff we don't want to make RPM happy.
66 $RPM_BUILD_ROOT/usr/bin/ovs-test \
67 $RPM_BUILD_ROOT/usr/bin/ovs-l3ping \
68 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-test.8 \
69 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-l3ping.8 \
70 $RPM_BUILD_ROOT/usr/sbin/ovs-vlan-bug-workaround \
71 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-vlan-bug-workaround.8
72 (cd "$RPM_BUILD_ROOT" && rm -rf usr/lib)
74 install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
78 if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
79 make check TESTSUITEFLAGS='--recheck'; then :;
81 cat tests/testsuite.log
87 rm -rf $RPM_BUILD_ROOT
90 # Create default or update existing /etc/sysconfig/openvswitch.
91 SYSCONFIG=/etc/sysconfig/openvswitch
92 TEMPLATE=/usr/share/openvswitch/scripts/sysconfig.template
93 if [ ! -e $SYSCONFIG ]; then
94 cp $TEMPLATE $SYSCONFIG
96 for var in $(awk -F'[ :]' '/^# [_A-Z0-9]+:/{print $2}' $TEMPLATE)
98 if ! grep $var $SYSCONFIG >/dev/null 2>&1; then
100 sed -n "/$var:/,/$var=/p" $TEMPLATE >> $SYSCONFIG
105 # Ensure all required services are set to run
106 /sbin/chkconfig --add openvswitch
107 /sbin/chkconfig openvswitch on
110 if [ "$1" = "0" ]; then # $1 = 0 for uninstall
111 /sbin/service openvswitch stop
112 /sbin/chkconfig --del openvswitch
116 if [ "$1" = "0" ]; then # $1 = 0 for uninstall
117 rm -f /etc/openvswitch/conf.db
118 rm -f /etc/sysconfig/openvswitch
119 rm -f /etc/openvswitch/vswitchd.cacert
125 %defattr(-,root,root)
126 /etc/init.d/openvswitch
127 %config(noreplace) /etc/logrotate.d/openvswitch
128 /etc/sysconfig/network-scripts/ifup-ovs
129 /etc/sysconfig/network-scripts/ifdown-ovs
131 /usr/bin/ovs-benchmark
133 /usr/bin/ovs-dpctl-top
135 /usr/bin/ovs-parse-backtrace
138 /usr/bin/ovs-tcpundump
139 /usr/bin/ovs-vlan-test
141 /usr/bin/ovsdb-client
144 /usr/sbin/ovs-bugtool
145 /usr/sbin/ovs-vswitchd
146 /usr/sbin/ovsdb-server
147 /usr/share/man/man1/ovs-benchmark.1.gz
148 /usr/share/man/man1/ovs-pcap.1.gz
149 /usr/share/man/man1/ovs-tcpundump.1.gz
150 /usr/share/man/man1/ovsdb-client.1.gz
151 /usr/share/man/man1/ovsdb-server.1.gz
152 /usr/share/man/man1/ovsdb-tool.1.gz
153 /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
154 /usr/share/man/man5/vtep.5.gz
155 /usr/share/man/man8/ovs-appctl.8.gz
156 /usr/share/man/man8/ovs-bugtool.8.gz
157 /usr/share/man/man8/ovs-ctl.8.gz
158 /usr/share/man/man8/ovs-dpctl.8.gz
159 /usr/share/man/man8/ovs-dpctl-top.8.gz
160 /usr/share/man/man8/ovs-ofctl.8.gz
161 /usr/share/man/man8/ovs-parse-backtrace.8.gz
162 /usr/share/man/man8/ovs-pki.8.gz
163 /usr/share/man/man8/ovs-vlan-test.8.gz
164 /usr/share/man/man8/ovs-vsctl.8.gz
165 /usr/share/man/man8/ovs-vswitchd.8.gz
166 /usr/share/man/man8/vtep-ctl.8.gz
167 /usr/share/openvswitch/bugtool-plugins/
168 /usr/share/openvswitch/python/
169 /usr/share/openvswitch/scripts/ovs-bugtool-*
170 /usr/share/openvswitch/scripts/ovs-check-dead-ifs
171 /usr/share/openvswitch/scripts/ovs-ctl
172 /usr/share/openvswitch/scripts/ovs-lib
173 /usr/share/openvswitch/scripts/ovs-save
174 /usr/share/openvswitch/scripts/ovs-vtep
175 /usr/share/openvswitch/scripts/sysconfig.template
176 /usr/share/openvswitch/vswitch.ovsschema
177 /usr/share/openvswitch/vtep.ovsschema
178 /usr/share/doc/openvswitch-%{version}/FAQ
179 /usr/share/doc/openvswitch-%{version}/README.RHEL