]> git.proxmox.com Git - mirror_ovs.git/blame - rhel/openvswitch.spec.in
utilities: a top like tool for ovs-dpctl dump-flows.
[mirror_ovs.git] / rhel / openvswitch.spec.in
CommitLineData
c434706a
BP
1# Spec file for Open vSwitch on Red Hat Enterprise Linux.
2
825da1c6 3# Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
c434706a
BP
4#
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.
9
10Name: openvswitch
11Summary: Open vSwitch daemon/database/utilities
12Group: System Environment/Daemons
13URL: http://www.openvswitch.org/
e0edde6f 14Vendor: Nicira, Inc.
c434706a
BP
15Version: @VERSION@
16
17License: ASL 2.0
18Release: 1
19Source: openvswitch-%{version}.tar.gz
20Buildroot: /tmp/openvswitch-rpm
21Requires: openvswitch-kmod, logrotate, python
22
23%description
24Open vSwitch provides standard network bridging functions and
25support for the OpenFlow protocol for remote per-flow control of
26traffic.
27
28%prep
29%setup -q
30
31%build
8a07709c 32./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --enable-ssl
c434706a
BP
33make %{_smp_mflags}
34
35%install
36rm -rf $RPM_BUILD_ROOT
37make install DESTDIR=$RPM_BUILD_ROOT
53755990
CW
38
39rhel_cp() {
40 base=$1
41 mode=$2
42 dst=$RPM_BUILD_ROOT/$(echo $base | sed 's,_,/,g')
43 install -D -m $mode rhel/$base $dst
44}
45rhel_cp etc_init.d_openvswitch 0755
46rhel_cp etc_logrotate.d_openvswitch 0644
47rhel_cp etc_sysconfig_network-scripts_ifup-ovs 0755
48rhel_cp etc_sysconfig_network-scripts_ifdown-ovs 0755
49rhel_cp usr_share_openvswitch_scripts_sysconfig.template 0644
50
0fb42626
AF
51docdir=$RPM_BUILD_ROOT/usr/share/doc/openvswitch-%{version}
52install -d -m755 "$docdir"
c483d489 53install -m 0644 FAQ rhel/README.RHEL "$docdir"
6c88547d
EJ
54install python/compat/uuid.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
55install python/compat/argparse.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
c434706a
BP
56
57# Get rid of stuff we don't want to make RPM happy.
58rm \
59 $RPM_BUILD_ROOT/usr/bin/ovs-controller \
c434706a 60 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-controller.8 \
9d7c5643 61 $RPM_BUILD_ROOT/usr/bin/ovs-test \
2d8bdd8f 62 $RPM_BUILD_ROOT/usr/bin/ovs-l3ping \
9d7c5643 63 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-test.8 \
2d8bdd8f 64 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-l3ping.8 \
c434706a
BP
65 $RPM_BUILD_ROOT/usr/sbin/ovs-vlan-bug-workaround \
66 $RPM_BUILD_ROOT/usr/share/man/man8/ovs-vlan-bug-workaround.8
67
68install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
69
70%clean
71rm -rf $RPM_BUILD_ROOT
72
73%post
74# Create default or update existing /etc/sysconfig/openvswitch.
75SYSCONFIG=/etc/sysconfig/openvswitch
76TEMPLATE=/usr/share/openvswitch/scripts/sysconfig.template
77if [ ! -e $SYSCONFIG ]; then
78 cp $TEMPLATE $SYSCONFIG
79else
80 for var in $(awk -F'[ :]' '/^# [_A-Z0-9]+:/{print $2}' $TEMPLATE)
81 do
82 if ! grep $var $SYSCONFIG >/dev/null 2>&1; then
83 echo >> $SYSCONFIG
84 sed -n "/$var:/,/$var=/p" $TEMPLATE >> $SYSCONFIG
85 fi
86 done
87fi
88
89# Ensure all required services are set to run
90/sbin/chkconfig --add openvswitch
91/sbin/chkconfig openvswitch on
92
93%preun
94if [ "$1" = "0" ]; then # $1 = 0 for uninstall
95 /sbin/service openvswitch stop
96 /sbin/chkconfig --del openvswitch
97fi
98
99%postun
100if [ "$1" = "0" ]; then # $1 = 0 for uninstall
101 rm -f /etc/openvswitch/conf.db
102 rm -f /etc/sysconfig/openvswitch
103 rm -f /etc/openvswitch/vswitchd.cacert
104fi
105
106exit 0
107
108%files
109%defattr(-,root,root)
110/etc/init.d/openvswitch
53755990 111%config(noreplace) /etc/logrotate.d/openvswitch
0fb42626
AF
112/etc/sysconfig/network-scripts/ifup-ovs
113/etc/sysconfig/network-scripts/ifdown-ovs
c434706a 114/usr/bin/ovs-appctl
5e00790e 115/usr/bin/ovs-benchmark
c434706a 116/usr/bin/ovs-dpctl
14b4c575 117/usr/bin/ovs-dpctl-top
c434706a 118/usr/bin/ovs-ofctl
013061cf 119/usr/bin/ovs-parse-backtrace
c434706a 120/usr/bin/ovs-pcap
def046d5 121/usr/bin/ovs-pki
c434706a
BP
122/usr/bin/ovs-tcpundump
123/usr/bin/ovs-vlan-test
124/usr/bin/ovs-vsctl
125/usr/bin/ovsdb-client
126/usr/bin/ovsdb-tool
51a5f442 127/usr/sbin/ovs-bugtool
c434706a
BP
128/usr/sbin/ovs-vswitchd
129/usr/sbin/ovsdb-server
5e00790e 130/usr/share/man/man1/ovs-benchmark.1.gz
c434706a
BP
131/usr/share/man/man1/ovs-pcap.1.gz
132/usr/share/man/man1/ovs-tcpundump.1.gz
133/usr/share/man/man1/ovsdb-client.1.gz
134/usr/share/man/man1/ovsdb-server.1.gz
135/usr/share/man/man1/ovsdb-tool.1.gz
136/usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
137/usr/share/man/man8/ovs-appctl.8.gz
2ad7bf32 138/usr/share/man/man8/ovs-bugtool.8.gz
c434706a
BP
139/usr/share/man/man8/ovs-ctl.8.gz
140/usr/share/man/man8/ovs-dpctl.8.gz
14b4c575 141/usr/share/man/man8/ovs-dpctl-top.8.gz
c434706a 142/usr/share/man/man8/ovs-ofctl.8.gz
013061cf 143/usr/share/man/man8/ovs-parse-backtrace.8.gz
def046d5 144/usr/share/man/man8/ovs-pki.8.gz
c434706a
BP
145/usr/share/man/man8/ovs-vlan-test.8.gz
146/usr/share/man/man8/ovs-vsctl.8.gz
147/usr/share/man/man8/ovs-vswitchd.8.gz
4b38c153 148/usr/share/openvswitch/bugtool-plugins/
c434706a 149/usr/share/openvswitch/python/
b2df0225 150/usr/share/openvswitch/scripts/ovs-bugtool-*
2dc7590d 151/usr/share/openvswitch/scripts/ovs-check-dead-ifs
c434706a 152/usr/share/openvswitch/scripts/ovs-ctl
d422c118 153/usr/share/openvswitch/scripts/ovs-lib
c434706a
BP
154/usr/share/openvswitch/scripts/ovs-save
155/usr/share/openvswitch/scripts/sysconfig.template
156/usr/share/openvswitch/vswitch.ovsschema
c483d489 157/usr/share/doc/openvswitch-%{version}/FAQ
0fb42626 158/usr/share/doc/openvswitch-%{version}/README.RHEL
c434706a 159/var/lib/openvswitch
c649fe54 160/var/log/openvswitch