1 # Spec file for Open vSwitch on Red Hat Enterprise Linux.
3 # Copyright (C) 2009, 2010, 2011 Nicira Networks, 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.
11 Summary: Open vSwitch daemon/database/utilities
12 Group: System Environment/Daemons
13 URL: http://www.openvswitch.org/
14 Vendor: Nicira Networks, Inc.
19 Source: openvswitch-%{version}.tar.gz
20 Buildroot: /tmp/openvswitch-rpm
21 Requires: openvswitch-kmod, logrotate, python
24 Open vSwitch provides standard network bridging functions and
25 support for the OpenFlow protocol for remote per-flow control of
32 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --enable-ssl %{?build_number}
36 rm -rf $RPM_BUILD_ROOT
37 make install DESTDIR=$RPM_BUILD_ROOT
38 install -d -m 755 $RPM_BUILD_ROOT/etc
39 install -d -m 755 $RPM_BUILD_ROOT/etc/init.d
40 install -m 755 rhel/etc_init.d_openvswitch \
41 $RPM_BUILD_ROOT/etc/init.d/openvswitch
42 install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig
43 install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d
44 install -m 755 rhel/etc_logrotate.d_openvswitch \
45 $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
46 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
47 install -m 755 rhel/usr_share_openvswitch_scripts_sysconfig.template \
48 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts/sysconfig.template
49 install xenserver/uuid.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
51 # Get rid of stuff we don't want to make RPM happy.
53 $RPM_BUILD_ROOT/usr/bin/ovs-controller \
54 $RPM_BUILD_ROOT/usr/bin/ovs-pki \
55 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-controller.8 \
56 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-pki.8 \
57 $RPM_BUILD_ROOT/usr/sbin/ovs-vlan-bug-workaround \
58 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-vlan-bug-workaround.8
60 install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
63 rm -rf $RPM_BUILD_ROOT
66 # Create default or update existing /etc/sysconfig/openvswitch.
67 SYSCONFIG=/etc/sysconfig/openvswitch
68 TEMPLATE=/usr/share/openvswitch/scripts/sysconfig.template
69 if [ ! -e $SYSCONFIG ]; then
70 cp $TEMPLATE $SYSCONFIG
72 for var in $(awk -F'[ :]' '/^# [_A-Z0-9]+:/{print $2}' $TEMPLATE)
74 if ! grep $var $SYSCONFIG >/dev/null 2>&1; then
76 sed -n "/$var:/,/$var=/p" $TEMPLATE >> $SYSCONFIG
81 # Ensure all required services are set to run
82 /sbin/chkconfig --add openvswitch
83 /sbin/chkconfig openvswitch on
86 if [ "$1" = "0" ]; then # $1 = 0 for uninstall
87 /sbin/service openvswitch stop
88 /sbin/chkconfig --del openvswitch
92 if [ "$1" = "0" ]; then # $1 = 0 for uninstall
93 rm -f /etc/openvswitch/conf.db
94 rm -f /etc/sysconfig/openvswitch
95 rm -f /etc/openvswitch/vswitchd.cacert
101 %defattr(-,root,root)
102 /etc/init.d/openvswitch
103 /etc/logrotate.d/openvswitch
104 /etc/openvswitch/bugtool-plugins/*
106 /usr/bin/ovs-benchmark
109 /usr/bin/ovs-parse-leaks
111 /usr/bin/ovs-tcpundump
112 /usr/bin/ovs-vlan-test
114 /usr/bin/ovsdb-client
116 /usr/sbin/ovs-brcompatd
117 /usr/sbin/ovs-bugtool
118 /usr/sbin/ovs-vswitchd
119 /usr/sbin/ovsdb-server
120 /usr/share/man/man1/ovs-benchmark.1.gz
121 /usr/share/man/man1/ovs-pcap.1.gz
122 /usr/share/man/man1/ovs-tcpundump.1.gz
123 /usr/share/man/man1/ovsdb-client.1.gz
124 /usr/share/man/man1/ovsdb-server.1.gz
125 /usr/share/man/man1/ovsdb-tool.1.gz
126 /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
127 /usr/share/man/man8/ovs-appctl.8.gz
128 /usr/share/man/man8/ovs-brcompatd.8.gz
129 /usr/share/man/man8/ovs-bugtool.8.gz
130 /usr/share/man/man8/ovs-ctl.8.gz
131 /usr/share/man/man8/ovs-dpctl.8.gz
132 /usr/share/man/man8/ovs-ofctl.8.gz
133 /usr/share/man/man8/ovs-parse-leaks.8.gz
134 /usr/share/man/man8/ovs-vlan-test.8.gz
135 /usr/share/man/man8/ovs-vsctl.8.gz
136 /usr/share/man/man8/ovs-vswitchd.8.gz
137 /usr/share/openvswitch/python/
138 /usr/share/openvswitch/scripts/ovs-bugtool-*
139 /usr/share/openvswitch/scripts/ovs-ctl
140 /usr/share/openvswitch/scripts/ovs-lib.sh
141 /usr/share/openvswitch/scripts/ovs-save
142 /usr/share/openvswitch/scripts/sysconfig.template
143 /usr/share/openvswitch/vswitch.ovsschema