ovs-controller: Rename test-controller and do not install or package.
[sliver-openvswitch.git] / rhel / openvswitch-fedora.spec.in
1 # Spec file for Open vSwitch.
2
3 # Copyright (C) 2009, 2010, 2013 Nicira Networks, Inc.
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
10 #%define kernel 2.6.40.4-5.fc15.x86_64
11
12 Name: openvswitch
13 Summary: Open vSwitch
14 Group: System Environment/Daemons
15 URL: http://www.openvswitch.org/
16 Version: @VERSION@
17
18 # The entire source code is ASL 2.0 except datapath/ which is GPLv2
19 License: ASL 2.0
20 Release: 1%{?dist}
21 Source: openvswitch-%{version}.tar.gz
22 #Source1: openvswitch-init
23 Buildroot: /tmp/openvswitch-fedora-rpm
24
25 Requires(post):  systemd-units
26 Requires(preun): systemd-units
27 Requires(postun): systemd-units
28
29 %description
30 Open vSwitch provides standard network bridging functions augmented with
31 support for the OpenFlow protocol for remote per-flow control of
32 traffic.
33
34 %prep
35 %setup -q -n openvswitch-%{version}
36
37 %build
38 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --enable-ssl %{build_number}
39 make %{_smp_mflags}
40
41 %install
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 -m 755 rhel/etc_init.d_openvswitch \
49         $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
50 install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig
51 install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d
52 install -m 755 rhel/etc_logrotate.d_openvswitch \
53         $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
54 install -d -m 755 $RPM_BUILD_ROOT/etc/profile.d
55 install -m 644 vswitchd/vswitch.ovsschema \
56         $RPM_BUILD_ROOT/usr/share/openvswitch/vswitch.ovsschema
57 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
58 install -d -m 0755 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/
59 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
60         $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifdown-ovs
61 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
62         $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifup-ovs
63 install -p -D -m 0644 rhel/usr_share_openvswitch_scripts_sysconfig.template \
64         $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
65 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
66
67 install python/compat/uuid.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
68 install python/compat/argparse.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
69
70 install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
71
72 %clean
73 rm -rf $RPM_BUILD_ROOT
74
75 %preun
76 # Package removal, not upgrade
77 systemctl stop openvswitch.service
78 systemctl disable openvswitch.service
79
80 %post
81 if test ! -e /etc/openvswitch/conf.db; then
82     install -d -m 755 -o root -g root /etc/openvswitch
83
84     # Create ovs-vswitchd config database
85     ovsdb-tool -vANY:console:emer create /etc/openvswitch/conf.db \
86             /usr/share/openvswitch/vswitch.ovsschema
87
88     # Create initial table in config database
89     ovsdb-tool -vANY:console:emer transact /etc/openvswitch/conf.db \
90             '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \
91             > /dev/null
92 fi
93 # Initial installation
94 systemctl enable openvswitch.service
95 systemctl start openvswitch.service
96
97 %postun
98
99 %files
100 %defattr(-,root,root)
101 %config /etc/sysconfig/openvswitch
102 %config /etc/logrotate.d/openvswitch
103 %{_unitdir}/openvswitch.service
104 %{_datadir}/openvswitch/scripts/openvswitch.init
105 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
106 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
107 /usr/share/openvswitch/bugtool-plugins/
108 /usr/share/openvswitch/python/ovs/__init__.py
109 /usr/share/openvswitch/python/ovs/daemon.py
110 /usr/share/openvswitch/python/ovs/db/__init__.py
111 /usr/share/openvswitch/python/ovs/db/data.py
112 /usr/share/openvswitch/python/ovs/db/error.py
113 /usr/share/openvswitch/python/ovs/db/idl.py
114 /usr/share/openvswitch/python/ovs/db/parser.py
115 /usr/share/openvswitch/python/ovs/db/schema.py
116 /usr/share/openvswitch/python/ovs/db/types.py
117 /usr/share/openvswitch/python/ovs/dirs.py
118 /usr/share/openvswitch/python/ovs/fatal_signal.py
119 /usr/share/openvswitch/python/ovs/json.py
120 /usr/share/openvswitch/python/ovs/jsonrpc.py
121 /usr/share/openvswitch/python/ovs/ovsuuid.py
122 /usr/share/openvswitch/python/ovs/poller.py
123 /usr/share/openvswitch/python/ovs/process.py
124 /usr/share/openvswitch/python/ovs/reconnect.py
125 /usr/share/openvswitch/python/ovs/socket_util.py
126 /usr/share/openvswitch/python/ovs/stream.py
127 /usr/share/openvswitch/python/ovs/timeval.py
128 /usr/share/openvswitch/python/ovs/util.py
129 /usr/share/openvswitch/python/ovs/version.py
130 /usr/share/openvswitch/python/ovs/unixctl/__init__.py
131 /usr/share/openvswitch/python/ovs/unixctl/client.py
132 /usr/share/openvswitch/python/ovs/unixctl/server.py
133 /usr/share/openvswitch/python/uuid.py
134 /usr/share/openvswitch/python/argparse.py
135 /usr/share/openvswitch/python/ovs/vlog.py
136 /usr/share/openvswitch/python/ovstest/__init__.py
137 /usr/share/openvswitch/python/ovstest/args.py
138 /usr/share/openvswitch/python/ovstest/rpcserver.py
139 /usr/share/openvswitch/python/ovstest/tcp.py
140 /usr/share/openvswitch/python/ovstest/udp.py
141 /usr/share/openvswitch/python/ovstest/util.py
142 /usr/share/openvswitch/python/ovstest/vswitch.py
143 /usr/share/openvswitch/python/ovstest/tests.py
144 /usr/share/openvswitch/scripts/ovs-bugtool-*
145 /usr/share/openvswitch/scripts/ovs-check-dead-ifs
146 /usr/share/openvswitch/scripts/ovs-lib
147 /usr/share/openvswitch/scripts/ovs-vtep
148 %config /usr/share/openvswitch/vswitch.ovsschema
149 %config /usr/share/openvswitch/vtep.ovsschema
150 /usr/sbin/ovs-bugtool
151 /usr/sbin/ovs-vswitchd
152 /usr/sbin/ovsdb-server
153 /usr/bin/ovs-appctl
154 /usr/bin/ovs-dpctl
155 /usr/bin/ovs-dpctl-top
156 /usr/bin/ovs-ofctl
157 /usr/bin/ovs-vsctl
158 /usr/bin/ovsdb-client
159 /usr/bin/ovsdb-tool
160 /usr/bin/ovs-pki
161 /usr/bin/ovs-test
162 /usr/bin/ovs-l3ping
163 /usr/bin/vtep-ctl
164 %doc /usr/share/man/man8/ovs-pki.8.gz
165 %doc /usr/share/man/man1/ovsdb-client.1.gz
166 %doc /usr/share/man/man1/ovsdb-server.1.gz
167 %doc /usr/share/man/man1/ovsdb-tool.1.gz
168 %doc /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
169 %doc /usr/share/man/man5/vtep.5.gz
170 %doc /usr/share/man/man8/ovs-appctl.8.gz
171 %doc /usr/share/man/man8/ovs-bugtool.8.gz
172 %doc /usr/share/man/man8/ovs-dpctl.8.gz
173 %doc /usr/share/man/man8/ovs-dpctl-top.8.gz
174 %doc /usr/share/man/man8/ovs-ofctl.8.gz
175 %doc /usr/share/man/man8/ovs-parse-backtrace.8.gz
176 %doc /usr/share/man/man8/ovs-vsctl.8.gz
177 %doc /usr/share/man/man8/ovs-vswitchd.8.gz
178 %doc /usr/share/man/man8/ovs-test.8.gz
179 %doc /usr/share/man/man8/ovs-l3ping.8.gz
180 %doc /usr/share/man/man8/vtep-ctl.8.gz
181 /var/lib/openvswitch
182 /var/log/openvswitch
183 /usr/share/openvswitch/scripts/ovs-ctl
184 %exclude /etc/openvswitch
185 %exclude /usr/bin/ovs-benchmark
186 %exclude /usr/bin/ovs-parse-backtrace
187 %exclude /usr/bin/ovs-pcap
188 %exclude /usr/bin/ovs-tcpundump
189 %exclude /usr/bin/ovs-vlan-test
190 %exclude /usr/sbin/ovs-vlan-bug-workaround
191 %exclude /usr/share/man/man1/ovs-benchmark.1.gz
192 %exclude /usr/share/man/man1/ovs-pcap.1.gz
193 %exclude /usr/share/man/man1/ovs-tcpundump.1.gz
194 %exclude /usr/share/man/man8/ovs-ctl.8.gz
195 %exclude /usr/share/man/man8/ovs-vlan-bug-workaround.8.gz
196 %exclude /usr/share/man/man8/ovs-vlan-test.8.gz
197 %exclude /usr/share/openvswitch/scripts/ovs-save
198
199 %changelog
200 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>
201 - First build on F14