1 # Spec file for Open vSwitch.
3 # Copyright (C) 2009, 2010, 2013, 2014 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.
10 #%define kernel 2.6.40.4-5.fc15.x86_64
14 Group: System Environment/Daemons
15 URL: http://www.openvswitch.org/
18 # The entire source code is ASL 2.0 except datapath/ which is GPLv2
21 Source: openvswitch-%{version}.tar.gz
22 #Source1: openvswitch-init
23 Buildroot: /tmp/openvswitch-fedora-rpm
25 Requires(post): systemd-units
26 Requires(preun): systemd-units
27 Requires(postun): systemd-units
30 Open vSwitch provides standard network bridging functions augmented with
31 support for the OpenFlow protocol for remote per-flow control of
35 %setup -q -n openvswitch-%{version}
38 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --enable-ssl
42 rm -rf $RPM_BUILD_ROOT
43 make install DESTDIR=$RPM_BUILD_ROOT
44 install -d -m 755 $RPM_BUILD_ROOT/etc
45 install -d -m 755 $RPM_BUILD_ROOT/etc/openvswitch
46 install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch.service \
47 $RPM_BUILD_ROOT%{_unitdir}/openvswitch.service
48 install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
49 $RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service
50 install -m 755 rhel/etc_init.d_openvswitch \
51 $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
52 install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig
53 install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d
54 install -m 755 rhel/etc_logrotate.d_openvswitch \
55 $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
56 install -d -m 755 $RPM_BUILD_ROOT/etc/profile.d
57 install -m 644 vswitchd/vswitch.ovsschema \
58 $RPM_BUILD_ROOT/usr/share/openvswitch/vswitch.ovsschema
59 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
60 install -d -m 0755 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/
61 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
62 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifdown-ovs
63 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
64 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifup-ovs
65 install -p -D -m 0644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
66 $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
67 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
69 install python/compat/uuid.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
70 install python/compat/argparse.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
72 install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
74 # Get rid of stuff we don't want to make RPM happy.
75 (cd "$RPM_BUILD_ROOT" && rm -f usr/lib/lib*)
78 rm -rf $RPM_BUILD_ROOT
81 # Package removal, not upgrade
82 systemctl stop openvswitch.service
83 systemctl disable openvswitch.service
86 if test ! -e /etc/openvswitch/conf.db; then
87 install -d -m 755 -o root -g root /etc/openvswitch
89 # Create ovs-vswitchd config database
90 ovsdb-tool -vANY:console:emer create /etc/openvswitch/conf.db \
91 /usr/share/openvswitch/vswitch.ovsschema
93 # Create initial table in config database
94 ovsdb-tool -vANY:console:emer transact /etc/openvswitch/conf.db \
95 '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \
98 # Initial installation
99 systemctl enable openvswitch.service
100 systemctl start openvswitch.service
105 %defattr(-,root,root)
106 %config /etc/sysconfig/openvswitch
107 %config /etc/logrotate.d/openvswitch
108 %{_unitdir}/openvswitch.service
109 %{_unitdir}/openvswitch-nonetwork.service
110 %{_datadir}/openvswitch/scripts/openvswitch.init
111 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
112 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
113 /usr/share/openvswitch/bugtool-plugins/
114 /usr/share/openvswitch/python/ovs/__init__.py*
115 /usr/share/openvswitch/python/ovs/daemon.py*
116 /usr/share/openvswitch/python/ovs/db/__init__.py*
117 /usr/share/openvswitch/python/ovs/db/data.py*
118 /usr/share/openvswitch/python/ovs/db/error.py*
119 /usr/share/openvswitch/python/ovs/db/idl.py*
120 /usr/share/openvswitch/python/ovs/db/parser.py*
121 /usr/share/openvswitch/python/ovs/db/schema.py*
122 /usr/share/openvswitch/python/ovs/db/types.py*
123 /usr/share/openvswitch/python/ovs/dirs.py*
124 /usr/share/openvswitch/python/ovs/fatal_signal.py*
125 /usr/share/openvswitch/python/ovs/json.py*
126 /usr/share/openvswitch/python/ovs/jsonrpc.py*
127 /usr/share/openvswitch/python/ovs/ovsuuid.py*
128 /usr/share/openvswitch/python/ovs/poller.py*
129 /usr/share/openvswitch/python/ovs/process.py*
130 /usr/share/openvswitch/python/ovs/reconnect.py*
131 /usr/share/openvswitch/python/ovs/socket_util.py*
132 /usr/share/openvswitch/python/ovs/stream.py*
133 /usr/share/openvswitch/python/ovs/timeval.py*
134 /usr/share/openvswitch/python/ovs/util.py*
135 /usr/share/openvswitch/python/ovs/version.py*
136 /usr/share/openvswitch/python/ovs/unixctl/__init__.py*
137 /usr/share/openvswitch/python/ovs/unixctl/client.py*
138 /usr/share/openvswitch/python/ovs/unixctl/server.py*
139 /usr/share/openvswitch/python/uuid.py*
140 /usr/share/openvswitch/python/argparse.py*
141 /usr/share/openvswitch/python/ovs/vlog.py*
142 /usr/share/openvswitch/python/ovstest/__init__.py*
143 /usr/share/openvswitch/python/ovstest/args.py*
144 /usr/share/openvswitch/python/ovstest/rpcserver.py*
145 /usr/share/openvswitch/python/ovstest/tcp.py*
146 /usr/share/openvswitch/python/ovstest/udp.py*
147 /usr/share/openvswitch/python/ovstest/util.py*
148 /usr/share/openvswitch/python/ovstest/vswitch.py*
149 /usr/share/openvswitch/python/ovstest/tests.py*
150 /usr/share/openvswitch/scripts/ovs-bugtool-*
151 /usr/share/openvswitch/scripts/ovs-check-dead-ifs
152 /usr/share/openvswitch/scripts/ovs-lib
153 /usr/share/openvswitch/scripts/ovs-vtep
154 %config /usr/share/openvswitch/vswitch.ovsschema
155 %config /usr/share/openvswitch/vtep.ovsschema
156 /usr/sbin/ovs-bugtool
157 /usr/sbin/ovs-vswitchd
158 /usr/sbin/ovsdb-server
161 /usr/bin/ovs-dpctl-top
164 /usr/bin/ovsdb-client
170 %doc /usr/share/man/man8/ovs-pki.8.gz
171 %doc /usr/share/man/man1/ovsdb-client.1.gz
172 %doc /usr/share/man/man1/ovsdb-server.1.gz
173 %doc /usr/share/man/man1/ovsdb-tool.1.gz
174 %doc /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
175 %doc /usr/share/man/man5/vtep.5.gz
176 %doc /usr/share/man/man8/ovs-appctl.8.gz
177 %doc /usr/share/man/man8/ovs-bugtool.8.gz
178 %doc /usr/share/man/man8/ovs-ctl.8.gz
179 %doc /usr/share/man/man8/ovs-dpctl.8.gz
180 %doc /usr/share/man/man8/ovs-dpctl-top.8.gz
181 %doc /usr/share/man/man8/ovs-ofctl.8.gz
182 %doc /usr/share/man/man8/ovs-parse-backtrace.8.gz
183 %doc /usr/share/man/man8/ovs-vsctl.8.gz
184 %doc /usr/share/man/man8/ovs-vswitchd.8.gz
185 %doc /usr/share/man/man8/ovs-test.8.gz
186 %doc /usr/share/man/man8/ovs-l3ping.8.gz
187 %doc /usr/share/man/man8/vtep-ctl.8.gz
190 /usr/share/openvswitch/scripts/ovs-ctl
191 %exclude /etc/openvswitch
192 %exclude /usr/bin/ovs-benchmark
193 %exclude /usr/bin/ovs-parse-backtrace
194 %exclude /usr/bin/ovs-pcap
195 %exclude /usr/bin/ovs-tcpundump
196 %exclude /usr/bin/ovs-vlan-test
197 %exclude /usr/sbin/ovs-vlan-bug-workaround
198 %exclude /usr/share/man/man1/ovs-benchmark.1.gz
199 %exclude /usr/share/man/man1/ovs-pcap.1.gz
200 %exclude /usr/share/man/man1/ovs-tcpundump.1.gz
201 %exclude /usr/share/man/man8/ovs-vlan-bug-workaround.8.gz
202 %exclude /usr/share/man/man8/ovs-vlan-test.8.gz
203 %exclude /usr/share/openvswitch/scripts/ovs-save
206 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>