Merge "master" into "ovn".
[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 # make check dependencies
39 BuildRequires: procps-ng
40
41 Requires: openssl iproute module-init-tools
42 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
43 #Requires: kernel >= 3.15.0-0
44
45 Requires(post): systemd-units
46 Requires(preun): systemd-units
47 Requires(postun): systemd-units
48 Obsoletes: openvswitch-controller <= 0:2.1.0-1
49
50 %bcond_without check
51
52 %description
53 Open vSwitch provides standard network bridging functions and
54 support for the OpenFlow protocol for remote per-flow control of
55 traffic.
56
57 %package -n python-openvswitch
58 Summary: Open vSwitch python bindings
59 License: ASL 2.0
60 BuildArch: noarch
61 Requires: python
62
63 %description -n python-openvswitch
64 Python bindings for the Open vSwitch database
65
66 %package test
67 Summary: Open vSwitch testing utilities
68 License: ASL 2.0
69 BuildArch: noarch
70 Requires: python-openvswitch = %{version}-%{release}
71 Requires: python python-twisted-core python-twisted-web
72
73 %description test
74 Utilities that are useful to diagnose performance and connectivity
75 issues in Open vSwitch setup.
76
77 %package devel
78 Summary: Open vSwitch OpenFlow development package (library, headers)
79 License: ASL 2.0
80 Provides: openvswitch-static = %{version}-%{release}
81
82 %description devel
83 This provides static library, libopenswitch.a and the openvswitch header
84 files needed to build an external application.
85
86
87 %prep
88 %setup -q
89
90 %build
91 %configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki
92 make %{?_smp_mflags}
93
94 %install
95 rm -rf $RPM_BUILD_ROOT
96 make install DESTDIR=$RPM_BUILD_ROOT
97
98 install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch
99
100 install -p -D -m 0644 \
101         rhel/usr_share_openvswitch_scripts_systemd_sysconfig.template \
102         $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/openvswitch
103 install -p -D -m 0644 \
104         rhel/usr_lib_systemd_system_openvswitch.service \
105         $RPM_BUILD_ROOT%{_unitdir}/openvswitch.service
106 install -p -D -m 0644 \
107         rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \
108         $RPM_BUILD_ROOT%{_unitdir}/openvswitch-nonetwork.service
109
110 install -m 0755 rhel/etc_init.d_openvswitch \
111         $RPM_BUILD_ROOT%{_datadir}/openvswitch/scripts/openvswitch.init
112
113 install -p -D -m 0644 rhel/etc_logrotate.d_openvswitch \
114         $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/openvswitch
115
116 install -m 0644 vswitchd/vswitch.ovsschema \
117         $RPM_BUILD_ROOT/%{_datadir}/openvswitch/vswitch.ovsschema
118
119 install -d -m 0755 $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/
120 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \
121         $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
122 install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \
123         $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
124
125 install -d -m 0755 $RPM_BUILD_ROOT%{python_sitelib}
126 mv $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \
127    $RPM_BUILD_ROOT%{python_sitelib}
128 rmdir $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/
129
130 install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch
131
132 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/conf.db
133 touch $RPM_BUILD_ROOT%{_sysconfdir}/openvswitch/system-id.conf
134
135 %check
136 %if %{with check}
137     if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
138        make check TESTSUITEFLAGS='--recheck'; then :;
139     else
140         cat tests/testsuite.log
141         exit 1
142     fi
143 %endif
144
145 %clean
146 rm -rf $RPM_BUILD_ROOT
147
148 %preun
149 %if 0%{?systemd_preun:1}
150     %systemd_preun %{name}.service
151 %else
152     if [ $1 -eq 0 ] ; then
153     # Package removal, not upgrade
154         /bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || :
155         /bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
156     fi
157 %endif
158
159
160 %post
161 %if 0%{?systemd_post:1}
162     %systemd_post %{name}.service
163 %else
164     # Package install, not upgrade
165     if [ $1 -eq 1 ]; then
166         /bin/systemctl daemon-reload >dev/null || :
167     fi
168 %endif
169
170
171 %postun
172 %if 0%{?systemd_postun_with_restart:1}
173     %systemd_postun_with_restart %{name}.service
174 %else
175     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
176     if [ "$1" -ge "1" ] ; then
177     # Package upgrade, not uninstall
178         /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
179     fi
180 %endif
181
182
183 %files -n python-openvswitch
184 %{python_sitelib}/ovs
185 %doc COPYING
186
187 %files test
188 %{_bindir}/ovs-test
189 %{_bindir}/ovs-vlan-test
190 %{_bindir}/ovs-l3ping
191 %{_mandir}/man8/ovs-test.8*
192 %{_mandir}/man8/ovs-vlan-test.8*
193 %{_mandir}/man8/ovs-l3ping.8*
194 %{python_sitelib}/ovstest
195
196 %files devel
197 %{_libdir}/*.a
198 %{_libdir}/*.la
199 %{_libdir}/pkgconfig/*.pc
200 %{_includedir}/openvswitch/*
201 %{_includedir}/openflow/*
202
203 %files
204 %defattr(-,root,root)
205 %{_sysconfdir}/bash_completion.d/ovs-appctl-bashcomp.bash
206 %{_sysconfdir}/bash_completion.d/ovs-vsctl-bashcomp.bash
207 %dir %{_sysconfdir}/openvswitch
208 %config %ghost %{_sysconfdir}/openvswitch/conf.db
209 %config %ghost %{_sysconfdir}/openvswitch/system-id.conf
210 %config(noreplace) %{_sysconfdir}/sysconfig/openvswitch
211 %config(noreplace) %{_sysconfdir}/logrotate.d/openvswitch
212 %{_unitdir}/openvswitch.service
213 %{_unitdir}/openvswitch-nonetwork.service
214 %{_datadir}/openvswitch/scripts/openvswitch.init
215 %{_sysconfdir}/sysconfig/network-scripts/ifup-ovs
216 %{_sysconfdir}/sysconfig/network-scripts/ifdown-ovs
217 %{_datadir}/openvswitch/bugtool-plugins/
218 %{_datadir}/openvswitch/scripts/ovs-bugtool-*
219 %{_datadir}/openvswitch/scripts/ovs-check-dead-ifs
220 %{_datadir}/openvswitch/scripts/ovs-lib
221 %{_datadir}/openvswitch/scripts/ovs-vtep
222 %{_datadir}/openvswitch/scripts/ovs-ctl
223 %config %{_datadir}/openvswitch/vswitch.ovsschema
224 %config %{_datadir}/openvswitch/vtep.ovsschema
225 %{_bindir}/ovs-appctl
226 %{_bindir}/ovs-docker
227 %{_bindir}/ovs-dpctl
228 %{_bindir}/ovs-dpctl-top
229 %{_bindir}/ovs-ofctl
230 %{_bindir}/ovs-vsctl
231 %{_bindir}/ovsdb-client
232 %{_bindir}/ovsdb-tool
233 %{_bindir}/ovs-testcontroller
234 %{_bindir}/ovs-pki
235 %{_bindir}/vtep-ctl
236 %{_sbindir}/ovs-bugtool
237 %{_sbindir}/ovs-vswitchd
238 %{_sbindir}/ovsdb-server
239 %{_mandir}/man1/ovs-benchmark.1*
240 %{_mandir}/man1/ovs-pcap.1*
241 %{_mandir}/man1/ovs-tcpundump.1*
242 %{_mandir}/man1/ovsdb-client.1*
243 %{_mandir}/man1/ovsdb-server.1*
244 %{_mandir}/man1/ovsdb-tool.1*
245 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
246 %{_mandir}/man5/vtep.5*
247 %{_mandir}/man8/vtep-ctl.8*
248 %{_mandir}/man8/ovs-appctl.8*
249 %{_mandir}/man8/ovs-bugtool.8*
250 %{_mandir}/man8/ovs-ctl.8*
251 %{_mandir}/man8/ovs-dpctl.8*
252 %{_mandir}/man8/ovs-dpctl-top.8*
253 %{_mandir}/man8/ovs-ofctl.8*
254 %{_mandir}/man8/ovs-pki.8*
255 %{_mandir}/man8/ovs-vsctl.8*
256 %{_mandir}/man8/ovs-vswitchd.8*
257 %{_mandir}/man8/ovs-parse-backtrace.8*
258 %{_mandir}/man8/ovs-testcontroller.8*
259 %doc COPYING DESIGN.md INSTALL.SSL.md NOTICE README.md WHY-OVS.md
260 %doc FAQ.md NEWS INSTALL.DPDK.md rhel/README.RHEL
261 /var/lib/openvswitch
262 /var/log/openvswitch
263 %ghost %attr(755,root,root) %{_rundir}/openvswitch
264 %exclude %{_bindir}/ovs-benchmark
265 %exclude %{_bindir}/ovs-parse-backtrace
266 %exclude %{_bindir}/ovs-pcap
267 %exclude %{_bindir}/ovs-tcpundump
268 %exclude %{_sbindir}/ovs-vlan-bug-workaround
269 %exclude %{_mandir}/man1/ovs-benchmark.1.gz
270 %exclude %{_mandir}/man1/ovs-pcap.1.gz
271 %exclude %{_mandir}/man1/ovs-tcpundump.1.gz
272 %exclude %{_mandir}/man8/ovs-vlan-bug-workaround.8.gz
273 %exclude %{_datadir}/openvswitch/scripts/ovs-save
274
275 %changelog
276 * Wed Jan 12 2011 Ralf Spenneberg <ralf@os-s.net>
277 - First build on F14