fedora-spec: remove stale comment
[cascardo/ovs.git] / rhel / openvswitch-fedora.spec.in
1 # Spec file for Open vSwitch.
2
3 # Copyright (C) 2009, 2010, 2013, 2014 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 # If tests have to be skipped while building, specify the '--without check'
11 # option. For example:
12 # rpmbuild -bb --without check rhel/openvswitch-fedora.spec
13
14 #%define kernel 2.6.40.4-5.fc15.x86_64
15
16 Name: openvswitch
17 Summary: Open vSwitch
18 Group: System Environment/Daemons
19 URL: http://www.openvswitch.org/
20 Version: @VERSION@
21
22 # Nearly all of openvswitch is ASL 2.0.  The bugtool is LGPLv2+, and the
23 # lib/sflow*.[ch] files are SISSL
24 # datapath/ is GPLv2 (although not built into any of the binary packages)
25 # python/compat is Python (although not built into any of the binary packages)
26 License: ASL 2.0 and LGPLv2+ and SISSL
27 Release: 1%{?dist}
28 Source: openvswitch-%{version}.tar.gz
29
30 Requires(post):  systemd-units
31 Requires(preun): systemd-units
32 Requires(postun): systemd-units
33
34 %bcond_without check
35
36 %description
37 Open vSwitch provides standard network bridging functions augmented with
38 support for the OpenFlow protocol for remote per-flow control of
39 traffic.
40
41 %prep
42 %setup -q -n openvswitch-%{version}
43
44 %build
45 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=%{_localstatedir} --enable-ssl
46 make %{_smp_mflags}
47
48 %install
49 rm -rf $RPM_BUILD_ROOT
50 make install DESTDIR=$RPM_BUILD_ROOT
51 install -d -m 755 $RPM_BUILD_ROOT/etc
52 install -d -m 755 $RPM_BUILD_ROOT/etc/openvswitch
53 install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch.service \
54         $RPM_BUILD_ROOT%{_unitdir}/openvswitch.service
55 install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
56         $RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service
57 install -m 755 rhel/etc_init.d_openvswitch \
58         $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
59 install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig
60 install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d
61 install -m 755 rhel/etc_logrotate.d_openvswitch \
62         $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
63 install -d -m 755 $RPM_BUILD_ROOT/etc/profile.d
64 install -m 644 vswitchd/vswitch.ovsschema \
65         $RPM_BUILD_ROOT/usr/share/openvswitch/vswitch.ovsschema
66 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
67 install -d -m 0755 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/
68 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
69         $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifdown-ovs
70 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
71         $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifup-ovs
72 install -p -D -m 0644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
73         $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
74 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
75
76 install python/compat/uuid.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
77 install python/compat/argparse.py $RPM_BUILD_ROOT/usr/share/openvswitch/python
78
79 install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
80
81 # Get rid of stuff we don't want to make RPM happy.
82 (cd "$RPM_BUILD_ROOT" && rm -f usr/lib/lib*)
83
84 %check
85 %if %{with check}
86     if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
87        make check TESTSUITEFLAGS='--recheck'; then :;
88     else
89         cat tests/testsuite.log
90         exit 1
91     fi
92 %endif
93
94 %clean
95 rm -rf $RPM_BUILD_ROOT
96
97 %preun
98 # Package removal, not upgrade
99 systemctl stop openvswitch.service
100 systemctl disable openvswitch.service
101
102 %post
103 if test ! -e /etc/openvswitch/conf.db; then
104     install -d -m 755 -o root -g root /etc/openvswitch
105
106     # Create ovs-vswitchd config database
107     ovsdb-tool -vANY:console:emer create /etc/openvswitch/conf.db \
108             /usr/share/openvswitch/vswitch.ovsschema
109
110     # Create initial table in config database
111     ovsdb-tool -vANY:console:emer transact /etc/openvswitch/conf.db \
112             '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \
113             > /dev/null
114 fi
115 # Initial installation
116 systemctl enable openvswitch.service
117 systemctl start openvswitch.service
118
119 %postun
120
121 %files
122 %defattr(-,root,root)
123 %config /etc/sysconfig/openvswitch
124 %config /etc/logrotate.d/openvswitch
125 %{_unitdir}/openvswitch.service
126 %{_unitdir}/openvswitch-nonetwork.service
127 %{_datadir}/openvswitch/scripts/openvswitch.init
128 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
129 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
130 /usr/share/openvswitch/bugtool-plugins/
131 /usr/share/openvswitch/python/ovs/__init__.py*
132 /usr/share/openvswitch/python/ovs/daemon.py*
133 /usr/share/openvswitch/python/ovs/db/__init__.py*
134 /usr/share/openvswitch/python/ovs/db/data.py*
135 /usr/share/openvswitch/python/ovs/db/error.py*
136 /usr/share/openvswitch/python/ovs/db/idl.py*
137 /usr/share/openvswitch/python/ovs/db/parser.py*
138 /usr/share/openvswitch/python/ovs/db/schema.py*
139 /usr/share/openvswitch/python/ovs/db/types.py*
140 /usr/share/openvswitch/python/ovs/dirs.py*
141 /usr/share/openvswitch/python/ovs/fatal_signal.py*
142 /usr/share/openvswitch/python/ovs/json.py*
143 /usr/share/openvswitch/python/ovs/jsonrpc.py*
144 /usr/share/openvswitch/python/ovs/ovsuuid.py*
145 /usr/share/openvswitch/python/ovs/poller.py*
146 /usr/share/openvswitch/python/ovs/process.py*
147 /usr/share/openvswitch/python/ovs/reconnect.py*
148 /usr/share/openvswitch/python/ovs/socket_util.py*
149 /usr/share/openvswitch/python/ovs/stream.py*
150 /usr/share/openvswitch/python/ovs/timeval.py*
151 /usr/share/openvswitch/python/ovs/util.py*
152 /usr/share/openvswitch/python/ovs/version.py*
153 /usr/share/openvswitch/python/ovs/unixctl/__init__.py*
154 /usr/share/openvswitch/python/ovs/unixctl/client.py*
155 /usr/share/openvswitch/python/ovs/unixctl/server.py*
156 /usr/share/openvswitch/python/uuid.py*
157 /usr/share/openvswitch/python/argparse.py*
158 /usr/share/openvswitch/python/ovs/vlog.py*
159 /usr/share/openvswitch/python/ovstest/__init__.py*
160 /usr/share/openvswitch/python/ovstest/args.py*
161 /usr/share/openvswitch/python/ovstest/rpcserver.py*
162 /usr/share/openvswitch/python/ovstest/tcp.py*
163 /usr/share/openvswitch/python/ovstest/udp.py*
164 /usr/share/openvswitch/python/ovstest/util.py*
165 /usr/share/openvswitch/python/ovstest/vswitch.py*
166 /usr/share/openvswitch/python/ovstest/tests.py*
167 /usr/share/openvswitch/scripts/ovs-bugtool-*
168 /usr/share/openvswitch/scripts/ovs-check-dead-ifs
169 /usr/share/openvswitch/scripts/ovs-lib
170 /usr/share/openvswitch/scripts/ovs-vtep
171 %config /usr/share/openvswitch/vswitch.ovsschema
172 %config /usr/share/openvswitch/vtep.ovsschema
173 /usr/sbin/ovs-bugtool
174 /usr/sbin/ovs-vswitchd
175 /usr/sbin/ovsdb-server
176 /usr/bin/ovs-appctl
177 /usr/bin/ovs-docker
178 /usr/bin/ovs-dpctl
179 /usr/bin/ovs-dpctl-top
180 /usr/bin/ovs-ofctl
181 /usr/bin/ovs-vsctl
182 /usr/bin/ovsdb-client
183 /usr/bin/ovsdb-tool
184 /usr/bin/ovs-testcontroller
185 /usr/bin/ovs-pki
186 /usr/bin/ovs-test
187 /usr/bin/ovs-l3ping
188 /usr/bin/vtep-ctl
189 %doc /usr/share/man/man8/ovs-testcontroller.8.gz
190 %doc /usr/share/man/man8/ovs-pki.8.gz
191 %doc /usr/share/man/man1/ovsdb-client.1.gz
192 %doc /usr/share/man/man1/ovsdb-server.1.gz
193 %doc /usr/share/man/man1/ovsdb-tool.1.gz
194 %doc /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
195 %doc /usr/share/man/man5/vtep.5.gz
196 %doc /usr/share/man/man8/ovs-appctl.8.gz
197 %doc /usr/share/man/man8/ovs-bugtool.8.gz
198 %doc /usr/share/man/man8/ovs-ctl.8.gz
199 %doc /usr/share/man/man8/ovs-dpctl.8.gz
200 %doc /usr/share/man/man8/ovs-dpctl-top.8.gz
201 %doc /usr/share/man/man8/ovs-ofctl.8.gz
202 %doc /usr/share/man/man8/ovs-parse-backtrace.8.gz
203 %doc /usr/share/man/man8/ovs-vsctl.8.gz
204 %doc /usr/share/man/man8/ovs-vswitchd.8.gz
205 %doc /usr/share/man/man8/ovs-test.8.gz
206 %doc /usr/share/man/man8/ovs-l3ping.8.gz
207 %doc /usr/share/man/man8/vtep-ctl.8.gz
208 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md FAQ.md NEWS INSTALL.DPDK.md
209 /var/lib/openvswitch
210 /var/log/openvswitch
211 /usr/share/openvswitch/scripts/ovs-ctl
212 %exclude /etc/openvswitch
213 %exclude /usr/bin/ovs-benchmark
214 %exclude /usr/bin/ovs-parse-backtrace
215 %exclude /usr/bin/ovs-pcap
216 %exclude /usr/bin/ovs-tcpundump
217 %exclude /usr/bin/ovs-vlan-test
218 %exclude /usr/sbin/ovs-vlan-bug-workaround
219 %exclude /usr/share/man/man1/ovs-benchmark.1.gz
220 %exclude /usr/share/man/man1/ovs-pcap.1.gz
221 %exclude /usr/share/man/man1/ovs-tcpundump.1.gz
222 %exclude /usr/share/man/man8/ovs-vlan-bug-workaround.8.gz
223 %exclude /usr/share/man/man8/ovs-vlan-test.8.gz
224 %exclude /usr/share/openvswitch/scripts/ovs-save
225
226 %changelog
227 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>
228 - First build on F14