401698dc9f9de25f650176b2a75dbfb5101ffe24
[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 # Enable PIE, bz#955181
17 %global _hardened_build 1
18
19 Name: openvswitch
20 Summary: Open vSwitch
21 Group: System Environment/Daemons
22 URL: http://www.openvswitch.org/
23 Version: @VERSION@
24
25 # Nearly all of openvswitch is ASL 2.0.  The bugtool is LGPLv2+, and the
26 # lib/sflow*.[ch] files are SISSL
27 # datapath/ is GPLv2 (although not built into any of the binary packages)
28 # python/compat is Python (although not built into any of the binary packages)
29 License: ASL 2.0 and LGPLv2+ and SISSL
30 Release: 1%{?dist}
31 Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
32
33 BuildRequires: autoconf
34 BuildRequires: systemd-units openssl openssl-devel
35 BuildRequires: python python-twisted-core python-zope-interface PyQt4
36 BuildRequires: desktop-file-utils
37 BuildRequires: groff graphviz
38
39 Requires: openssl iproute module-init-tools
40 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
41 Requires: kernel >= 3.15.0-0
42
43 Requires(post): systemd-units
44 Requires(preun): systemd-units
45 Requires(postun): systemd-units
46
47 %bcond_without check
48
49 %description
50 Open vSwitch provides standard network bridging functions and
51 support for the OpenFlow protocol for remote per-flow control of
52 traffic.
53
54 %package -n python-openvswitch
55 Summary: Open vSwitch python bindings
56 License: ASL 2.0
57 BuildArch: noarch
58 Requires: python
59
60 %description -n python-openvswitch
61 Python bindings for the Open vSwitch database
62
63 %package test
64 Summary: Open vSwitch testing utilities
65 License: ASL 2.0
66 BuildArch: noarch
67 Requires: python-openvswitch = %{version}-%{release}
68 Requires: python python-twisted-core python-twisted-web
69
70 %description test
71 Utilities that are useful to diagnose performance and connectivity
72 issues in Open vSwitch setup.
73
74 %package devel
75 Summary: Open vSwitch OpenFlow development package (library, headers)
76 License: ASL 2.0
77 Provides: openvswitch-static = %{version}-%{release}
78
79 %description devel
80 This provides static library, libopenswitch.a and the openvswitch header
81 files needed to build an external application.
82
83
84 %prep
85 %setup -q -n openvswitch-%{version}
86
87 %build
88 %configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki
89 make %{_smp_mflags}
90
91 %install
92 rm -rf $RPM_BUILD_ROOT
93 make install DESTDIR=$RPM_BUILD_ROOT
94 install -d -m 755 $RPM_BUILD_ROOT/etc
95 install -d -m 755 $RPM_BUILD_ROOT/etc/openvswitch
96 install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch.service \
97         $RPM_BUILD_ROOT%{_unitdir}/openvswitch.service
98 install -p -D -m 0644 rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
99         $RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service
100 install -m 755 rhel/etc_init.d_openvswitch \
101         $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
102 install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig
103 install -d -m 755 $RPM_BUILD_ROOT/etc/logrotate.d
104 install -m 755 rhel/etc_logrotate.d_openvswitch \
105         $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
106 install -d -m 755 $RPM_BUILD_ROOT/etc/profile.d
107 install -m 644 vswitchd/vswitch.ovsschema \
108         $RPM_BUILD_ROOT/usr/share/openvswitch/vswitch.ovsschema
109 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
110 install -d -m 0755 $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/
111 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
112         $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifdown-ovs
113 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
114         $RPM_BUILD_ROOT/etc/sysconfig/network-scripts/ifup-ovs
115 install -p -D -m 0644 rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
116         $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
117 install -d -m 755 $RPM_BUILD_ROOT/usr/share/openvswitch/scripts
118
119 install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib}
120 mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* $RPM_BUILD_ROOT%{python_sitelib}
121 rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
122
123 install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
124
125 install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openvswitch
126 install -p -D -m 0644 include/openvswitch/*.h \
127         -t $RPM_BUILD_ROOT%{_includedir}/openvswitch
128 install -p -D -m 0644 config.h -t $RPM_BUILD_ROOT%{_includedir}/openvswitch
129
130 install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openvswitch/lib
131 install -p -D -m 0644 lib/*.h \
132         -t $RPM_BUILD_ROOT%{_includedir}/openvswitch/lib
133
134 install -d -m 0755 $RPM_BUILD_ROOT%{_includedir}/openflow
135 install -p -D -m 0644 include/openflow/*.h \
136         -t $RPM_BUILD_ROOT%{_includedir}/openflow
137
138 %check
139 %if %{with check}
140     if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
141        make check TESTSUITEFLAGS='--recheck'; then :;
142     else
143         cat tests/testsuite.log
144         exit 1
145     fi
146 %endif
147
148 %clean
149 rm -rf $RPM_BUILD_ROOT
150
151 %preun
152 # Package removal, not upgrade
153 systemctl stop openvswitch.service
154 systemctl disable openvswitch.service
155
156 %post
157 if test ! -e /etc/openvswitch/conf.db; then
158     install -d -m 755 -o root -g root /etc/openvswitch
159
160     # Create ovs-vswitchd config database
161     ovsdb-tool -vANY:console:emer create /etc/openvswitch/conf.db \
162             /usr/share/openvswitch/vswitch.ovsschema
163
164     # Create initial table in config database
165     ovsdb-tool -vANY:console:emer transact /etc/openvswitch/conf.db \
166             '[{"op": "insert", "table": "Open_vSwitch", "row": {}}]' \
167             > /dev/null
168 fi
169 # Initial installation
170 systemctl enable openvswitch.service
171 systemctl start openvswitch.service
172
173 %postun
174
175 %files -n python-openvswitch
176 %{python_sitelib}/ovs
177 %doc COPYING
178
179 %files test
180 %{_bindir}/ovs-test
181 %{_bindir}/ovs-vlan-test
182 %{_bindir}/ovs-l3ping
183 %{_mandir}/man8/ovs-test.8*
184 %{_mandir}/man8/ovs-vlan-test.8*
185 %{_mandir}/man8/ovs-l3ping.8*
186 %{python_sitelib}/ovstest
187
188 %files devel
189 %{_libdir}/*.a
190 %{_libdir}/*.la
191 %{_includedir}/openvswitch/*
192 %{_includedir}/openflow/*
193
194 %files
195 %defattr(-,root,root)
196 %config /etc/sysconfig/openvswitch
197 %config /etc/logrotate.d/openvswitch
198 %{_unitdir}/openvswitch.service
199 %{_unitdir}/openvswitch-nonetwork.service
200 %{_datadir}/openvswitch/scripts/openvswitch.init
201 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
202 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
203 /usr/share/openvswitch/bugtool-plugins/
204 /usr/share/openvswitch/scripts/ovs-bugtool-*
205 /usr/share/openvswitch/scripts/ovs-check-dead-ifs
206 /usr/share/openvswitch/scripts/ovs-lib
207 /usr/share/openvswitch/scripts/ovs-vtep
208 %config /usr/share/openvswitch/vswitch.ovsschema
209 %config /usr/share/openvswitch/vtep.ovsschema
210 /usr/sbin/ovs-bugtool
211 /usr/sbin/ovs-vswitchd
212 /usr/sbin/ovsdb-server
213 /usr/bin/ovs-appctl
214 /usr/bin/ovs-docker
215 /usr/bin/ovs-dpctl
216 /usr/bin/ovs-dpctl-top
217 /usr/bin/ovs-ofctl
218 /usr/bin/ovs-vsctl
219 /usr/bin/ovsdb-client
220 /usr/bin/ovsdb-tool
221 /usr/bin/ovs-testcontroller
222 /usr/bin/ovs-pki
223 /usr/bin/vtep-ctl
224 %doc /usr/share/man/man8/ovs-testcontroller.8.gz
225 %doc /usr/share/man/man8/ovs-pki.8.gz
226 %doc /usr/share/man/man1/ovsdb-client.1.gz
227 %doc /usr/share/man/man1/ovsdb-server.1.gz
228 %doc /usr/share/man/man1/ovsdb-tool.1.gz
229 %doc /usr/share/man/man5/ovs-vswitchd.conf.db.5.gz
230 %doc /usr/share/man/man5/vtep.5.gz
231 %doc /usr/share/man/man8/ovs-appctl.8.gz
232 %doc /usr/share/man/man8/ovs-bugtool.8.gz
233 %doc /usr/share/man/man8/ovs-ctl.8.gz
234 %doc /usr/share/man/man8/ovs-dpctl.8.gz
235 %doc /usr/share/man/man8/ovs-dpctl-top.8.gz
236 %doc /usr/share/man/man8/ovs-ofctl.8.gz
237 %doc /usr/share/man/man8/ovs-parse-backtrace.8.gz
238 %doc /usr/share/man/man8/ovs-vsctl.8.gz
239 %doc /usr/share/man/man8/ovs-vswitchd.8.gz
240 %doc /usr/share/man/man8/vtep-ctl.8.gz
241 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md FAQ.md NEWS INSTALL.DPDK.md
242 /var/lib/openvswitch
243 /var/log/openvswitch
244 /usr/share/openvswitch/scripts/ovs-ctl
245 %exclude /etc/openvswitch
246 %exclude /usr/bin/ovs-benchmark
247 %exclude /usr/bin/ovs-parse-backtrace
248 %exclude /usr/bin/ovs-pcap
249 %exclude /usr/bin/ovs-tcpundump
250 %exclude /usr/sbin/ovs-vlan-bug-workaround
251 %exclude /usr/share/man/man1/ovs-benchmark.1.gz
252 %exclude /usr/share/man/man1/ovs-pcap.1.gz
253 %exclude /usr/share/man/man1/ovs-tcpundump.1.gz
254 %exclude /usr/share/man/man8/ovs-vlan-bug-workaround.8.gz
255 %exclude /usr/share/openvswitch/scripts/ovs-save
256
257 %changelog
258 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>
259 - First build on F14