]> git.pld-linux.org Git - packages/openvswitch.git/blob - openvswitch.spec
3ea81e2a30810228c0c20d41b58a67e1156c480e
[packages/openvswitch.git] / openvswitch.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # allow non-distribution kernel
4 %bcond_without  kernel          # don't build kernel modules
5 %bcond_without  userspace       # don't build userspace programs
6 %bcond_with     verbose         # verbose build (V=1)
7
8 # set kernel_builtin to true for kernels with openvswitch module (>= 3.3)
9 %define         kernel_builtin  %(echo %{_kernel_ver} | awk '{ split($0, v, "."); vv=v[1]*1000+v[2]; if (vv >= 3003) print 1; else print 0 }')
10 #'
11 %if %{kernel_builtin} == 1
12 %undefine       with_kernel
13 %endif
14
15 %if %{without kernel}
16 %undefine       with_dist_kernel
17 %endif
18 %if "%{_alt_kernel}" != "%{nil}"
19 %undefine       with_userspace
20 %endif
21 %if %{without userspace}
22 # nothing to be placed to debuginfo package
23 %define         _enable_debug_packages  0
24 %endif
25
26 %define         rel     0.1
27 Summary:        Production Quality, Multilayer Open Virtual Switch
28 #Summary(pl.UTF-8):     -
29 Name:           openvswitch
30 Version:        1.4.0
31 Release:        %{rel}
32 License:        Apache v2.0
33 Group:          Networking/Daemons
34 Source0:        http://openvswitch.org/releases/%{name}-%{version}.tar.gz
35 # Source0-md5:  3847c60af329bfe81ff7220b9f489fa5
36 Source1:        ifdown-ovs
37 Source2:        ifup-ovs
38 Source3:        README.PLD
39 Source4:        %{name}.logrotate
40 Source5:        %{name}.tmpfiles
41 Source6:        %{name}.sysconfig
42 Source7:        %{name}.init
43 #Source8:       openvswitch-controller.init
44 #Source9:       openvswitch-ipsec.init
45 Source10:       %{name}.service
46 URL:            http://openvswitch.org/
47 BuildRequires:  graphviz
48 BuildRequires:  groff
49 BuildRequires:  openssl-devel
50 BuildRequires:  openssl-tools
51 BuildRequires:  pkgconfig
52 BuildRequires:  python-distribute
53 BuildRequires:  python-PyQt4-devel
54 BuildRequires:  python-PyQt4-devel-tools
55 BuildRequires:  python-TwistedConch
56 BuildRequires:  python-TwistedCore
57 BuildRequires:  rpmbuild(macros) >= 1.647
58 BuildRequires:  rpm-pythonprov
59 %if %{with kernel}
60 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
61 %endif
62 Requires(post,preun):   /sbin/chkconfig
63 Requires:       python-modules
64 Requires:       rc-scripts
65 Requires:       systemd-units
66 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67
68 %description
69 Open vSwitch is a production quality, multilayer virtual switch
70 licensed under the open source Apache 2.0 license. It is designed to
71 enable massive network automation through programmatic extension,
72 while still supporting standard management interfaces and protocols
73 (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition,
74 it is designed to support distribution across multiple physical
75 servers similar to VMware's vNetwork distributed vswitch or Cisco's
76 Nexus 1000V.
77
78 #%description -l pl.UTF-8
79
80 %package test
81 Summary:        Open vSwitch test package
82 Group:          Networking/Admin
83 Requires:       python-modules
84
85 %description test
86 This package contains utilities that are useful to diagnose
87 performance and connectivity issues in Open vSwitch setup.
88
89 %package -n kernel%{_alt_kernel}-net-openvswitch
90 Summary:        Linux driver for openvswitch
91 Summary(pl.UTF-8):      Sterownik dla Linuksa do openvswitch
92 Release:        %{rel}@%{_kernel_ver_str}
93 Group:          Base/Kernel
94 Requires(post,postun):  /sbin/depmod
95 %if %{with dist_kernel}
96 %requires_releq_kernel
97 Requires(postun):       %releq_kernel
98 %endif
99
100 %description -n kernel%{_alt_kernel}-net-openvswitch
101 This is driver for openvswitch for Linux.
102
103 This package contains Linux module.
104
105 %description -n kernel%{_alt_kernel}-net-openvswitch -l pl.UTF-8
106 Sterownik dla Linuksa do openvswitch.
107
108 Ten pakiet zawiera moduł jądra Linuksa.
109
110 %prep
111 %setup -q
112 cp %{SOURCE3} .
113
114 %build
115 %configure \
116 %if %{with kernel}
117         --with-linux=%{_kernelsrcdir} \
118         --with-linux-source=%{_kernelsrcdir}
119 %endif
120
121 %{__make}
122
123 %install
124 rm -rf $RPM_BUILD_ROOT
125
126 %if %{with userspace}
127 install -d $RPM_BUILD_ROOT{%{py_sitescriptdir},%{systemdunitdir},%{systemdtmpfilesdir}} \
128         $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d,logrotate.d},/lib/rc-scripts}
129
130 %{__make} install \
131         DESTDIR=$RPM_BUILD_ROOT
132
133 install -p %{SOURCE1} $RPM_BUILD_ROOT/lib/rc-scripts/ifdown-ovs
134 install -p %{SOURCE2} $RPM_BUILD_ROOT/lib/rc-scripts/ifup-ovs
135 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
136 install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/openvswitch.conf
137 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
138 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/openvswitch
139 install -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/openvswitch.service
140
141 %{__mv} $RPM_BUILD_ROOT%{_datadir}/%{name}/python/{ovs,ovstest} $RPM_BUILD_ROOT%{py_sitescriptdir}
142 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/%{name}/python
143
144 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
145 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
146 %endif
147
148 %if %{with kernel}
149 cd datapath/linux
150 %install_kernel_modules -m brcompat_mod -d kernel/net/openvswitch
151 %install_kernel_modules -m openvswitch_mod -d kernel/net/openvswitch
152 %endif
153
154 %clean
155 rm -rf $RPM_BUILD_ROOT
156
157 %post
158 /sbin/chkconfig --add openvswitch
159 %service openvswitch restart
160 %systemd_post openvswitch.service
161
162 %preun
163 if [ "$1" = "0" ]; then
164         %service -q openvswitch stop
165         /sbin/chkconfig --del openvswitch
166 fi
167 %systemd_preun openvswitch.service
168
169 %postun
170 %systemd_reload
171
172 %post   -n kernel%{_alt_kernel}-net-openvswitch
173 %depmod %{_kernel_ver}
174
175 %postun -n kernel%{_alt_kernel}-net-openvswitch
176 %depmod %{_kernel_ver}
177
178 %if %{with userspace}
179 %files
180 %defattr(644,root,root,755)
181 %doc AUTHORS DESIGN INSTALL.KVM INSTALL.SSL INSTALL.bridge INSTALL.userspace NEWS README
182 %doc REPORTING-BUGS WHY-OVS README.PLD
183 %attr(755,root,root) /lib/rc-scripts/ifdown-ovs
184 %attr(755,root,root) /lib/rc-scripts/ifup-ovs
185 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/openvswitch
186 %{systemdtmpfilesdir}/openvswitch.conf
187 %{systemdunitdir}/openvswitch.service
188 %dir %{_datadir}/%{name}
189 %{_datadir}/%{name}/pki
190 %dir %{_datadir}/%{name}/scripts
191 %attr(755,root,root) %{_datadir}/%{name}/scripts/*
192 %{_datadir}/%{name}/ovsdbmonitor
193 %{_datadir}/%{name}/bugtool-plugins
194 %{_datadir}/%{name}/vswitch.ovsschema
195
196 %attr(754,root,root) /etc/rc.d/init.d/openvswitch
197 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/openvswitch
198
199 %attr(755,root,root) %{_bindir}/ovs-appctl
200 %attr(755,root,root) %{_bindir}/ovs-benchmark
201 %attr(755,root,root) %{_bindir}/ovs-controller
202 %attr(755,root,root) %{_bindir}/ovs-dpctl
203 %attr(755,root,root) %{_bindir}/ovs-ofctl
204 %attr(755,root,root) %{_bindir}/ovs-parse-leaks
205 %attr(755,root,root) %{_bindir}/ovs-pcap
206 %attr(755,root,root) %{_bindir}/ovs-pki
207 %attr(755,root,root) %{_bindir}/ovs-tcpundump
208 %attr(755,root,root) %{_bindir}/ovs-vsctl
209 %attr(755,root,root) %{_bindir}/ovsdb-client
210 %attr(755,root,root) %{_bindir}/ovsdb-tool
211 %attr(755,root,root) %{_bindir}/ovsdbmonitor
212 %attr(755,root,root) %{_sbindir}/ovs-brcompatd
213 %attr(755,root,root) %{_sbindir}/ovs-bugtool
214 %attr(755,root,root) %{_sbindir}/ovs-vlan-bug-workaround
215 %attr(755,root,root) %{_sbindir}/ovs-vswitchd
216 %attr(755,root,root) %{_sbindir}/ovsdb-server
217 %{_mandir}/man1/ovs-benchmark.1*
218 %{_mandir}/man1/ovs-pcap.1*
219 %{_mandir}/man1/ovs-tcpundump.1*
220 %{_mandir}/man1/ovsdb-client.1*
221 %{_mandir}/man1/ovsdb-server.1*
222 %{_mandir}/man1/ovsdb-tool.1*
223 %{_mandir}/man1/ovsdbmonitor.1*
224 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
225 %{_mandir}/man8/ovs-appctl.8*
226 %{_mandir}/man8/ovs-brcompatd.8*
227 %{_mandir}/man8/ovs-bugtool.8*
228 %{_mandir}/man8/ovs-controller.8*
229 %{_mandir}/man8/ovs-ctl.8*
230 %{_mandir}/man8/ovs-dpctl.8*
231 %{_mandir}/man8/ovs-ofctl.8*
232 %{_mandir}/man8/ovs-parse-leaks.8*
233 %{_mandir}/man8/ovs-pki.8*
234 %{_mandir}/man8/ovs-vlan-bug-workaround.8*
235 %{_mandir}/man8/ovs-vlan-test.8*
236 %{_mandir}/man8/ovs-vsctl.8*
237 %{_mandir}/man8/ovs-vswitchd.8*
238 %dir %{py_sitescriptdir}/ovs
239 %{py_sitescriptdir}/ovs/*.py*
240 %dir %{py_sitescriptdir}/ovs/db
241 %{py_sitescriptdir}/ovs/db/*.py*
242
243 %files test
244 %defattr(644,root,root,755)
245 %attr(755,root,root) %{_bindir}/ovs-test
246 %attr(755,root,root) %{_bindir}/ovs-vlan-test
247 %{py_sitescriptdir}/ovstest
248 %{_mandir}/man8/ovs-test.8*
249 %endif
250
251 %if %{with kernel}
252 %files -n kernel%{_alt_kernel}-net-openvswitch
253 %defattr(644,root,root,755)
254 /lib/modules/%{_kernel_ver}/kernel/net/openvswitch/*.ko*
255 %endif
This page took 0.072298 seconds and 3 git commands to generate.