]> git.pld-linux.org Git - packages/openvswitch.git/blob - openvswitch.spec
- added docs
[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:  python-distribute
48 BuildRequires:  rpm-pythonprov
49 BuildRequires:  rpmbuild(macros) >= 1.647
50 %if %{with kernel}
51 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
52 %endif
53 Requires(post,preun):   /sbin/chkconfig
54 #BuildRequires: -
55 Requires:       python-modules
56 Requires:       rc-scripts
57 #Requires(postun):      -
58 #Requires(pre,post):    -
59 #Requires(preun):       -
60 #Requires:      -
61 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63 %description
64 Open vSwitch is a production quality, multilayer virtual switch
65 licensed under the open source Apache 2.0 license. It is designed to
66 enable massive network automation through programmatic extension,
67 while still supporting standard management interfaces and protocols
68 (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In addition,
69 it is designed to support distribution across multiple physical
70 servers similar to VMware's vNetwork distributed vswitch or Cisco's
71 Nexus 1000V.
72
73 #%description -l pl.UTF-8
74
75 %package test
76 Summary:        Open vSwitch test package
77 Group:          Networking/Admin
78 Requires:       python-modules
79
80 %description test
81 This package contains utilities that are useful to diagnose
82 performance and connectivity issues in Open vSwitch setup.
83
84 %package -n kernel%{_alt_kernel}-net-openvswitch
85 Summary:        Linux driver for openvswitch
86 Summary(pl.UTF-8):      Sterownik dla Linuksa do openvswitch
87 Release:        %{rel}@%{_kernel_ver_str}
88 Group:          Base/Kernel
89 Requires(post,postun):  /sbin/depmod
90 %if %{with dist_kernel}
91 %requires_releq_kernel
92 Requires(postun):       %releq_kernel
93 %endif
94
95 %description -n kernel%{_alt_kernel}-net-openvswitch
96 This is driver for openvswitch for Linux.
97
98 This package contains Linux module.
99
100 %description -n kernel%{_alt_kernel}-net-openvswitch -l pl.UTF-8
101 Sterownik dla Linuksa do openvswitch.
102
103 Ten pakiet zawiera moduł jądra Linuksa.
104
105 %prep
106 %setup -q
107 cp %{SOURCE3} .
108
109 %build
110 %configure \
111 %if %{with kernel}
112         --with-linux=%{_kernelsrcdir} \
113         --with-linux-source=%{_kernelsrcdir}
114 %endif
115
116 %{__make}
117
118 %install
119 rm -rf $RPM_BUILD_ROOT
120
121 %if %{with userspace}
122 install -d $RPM_BUILD_ROOT{%{py_sitescriptdir},%{systemdunitdir},%{systemdtmpfilesdir}} \
123         $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d,logrotate.d},/lib/rc-scripts}
124
125 %{__make} install \
126         DESTDIR=$RPM_BUILD_ROOT
127
128 install -p %{SOURCE1} $RPM_BUILD_ROOT/lib/rc-scripts/ifdown-ovs
129 install -p %{SOURCE2} $RPM_BUILD_ROOT/lib/rc-scripts/ifup-ovs
130 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/openvswitch
131 install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/openvswitch.conf
132 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/openvswitch
133 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/openvswitch
134 install -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/openvswitch.service
135
136 %{__mv} $RPM_BUILD_ROOT%{_datadir}/%{name}/python/{ovs,ovstest} $RPM_BUILD_ROOT%{py_sitescriptdir}
137 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/%{name}/python
138
139 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
140 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
141 %endif
142
143 %if %{with kernel}
144 cd datapath/linux
145 %install_kernel_modules -m brcompat_mod -d kernel/net/openvswitch
146 %install_kernel_modules -m openvswitch_mod -d kernel/net/openvswitch
147 %endif
148
149 %clean
150 rm -rf $RPM_BUILD_ROOT
151
152 %post
153 /sbin/chkconfig --add openvswitch
154 %service openvswitch restart
155 %systemd_post openvswitch.service
156
157 %preun
158 if [ "$1" = "0" ]; then
159         %service -q openvswitch stop
160         /sbin/chkconfig --del openvswitch
161 fi
162 %systemd_preun openvswitch.service
163
164 %postun
165 %systemd_reload
166
167 %if %{with userspace}
168 %files
169 %defattr(644,root,root,755)
170 %doc AUTHORS DESIGN INSTALL.KVM INSTALL.SSL INSTALL.bridge INSTALL.userspace NEWS README
171 %doc REPORTING-BUGS WHY-OVS README.PLD
172 %attr(755,root,root) /lib/rc-scripts/ifdown-ovs
173 %attr(755,root,root) /lib/rc-scripts/ifup-ovs
174 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/openvswitch
175 %{systemdtmpfilesdir}/openvswitch.conf
176 %{systemdunitdir}/openvswitch.service
177 %{_datadir}/%{name}
178
179 %attr(754,root,root) /etc/rc.d/init.d/openvswitch
180 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/openvswitch
181
182 %attr(755,root,root) %{_bindir}/ovs-appctl
183 %attr(755,root,root) %{_bindir}/ovs-benchmark
184 %attr(755,root,root) %{_bindir}/ovs-controller
185 %attr(755,root,root) %{_bindir}/ovs-dpctl
186 %attr(755,root,root) %{_bindir}/ovs-ofctl
187 %attr(755,root,root) %{_bindir}/ovs-parse-leaks
188 %attr(755,root,root) %{_bindir}/ovs-pcap
189 %attr(755,root,root) %{_bindir}/ovs-pki
190 %attr(755,root,root) %{_bindir}/ovs-tcpundump
191 %attr(755,root,root) %{_bindir}/ovs-vlan-test
192 %attr(755,root,root) %{_bindir}/ovs-vsctl
193 %attr(755,root,root) %{_bindir}/ovsdb-client
194 %attr(755,root,root) %{_bindir}/ovsdb-tool
195 %attr(755,root,root) %{_sbindir}/ovs-brcompatd
196 %attr(755,root,root) %{_sbindir}/ovs-bugtool
197 %attr(755,root,root) %{_sbindir}/ovs-vlan-bug-workaround
198 %attr(755,root,root) %{_sbindir}/ovs-vswitchd
199 %attr(755,root,root) %{_sbindir}/ovsdb-server
200 %{_mandir}/man1/ovs-benchmark.1*
201 %{_mandir}/man1/ovs-pcap.1*
202 %{_mandir}/man1/ovs-tcpundump.1*
203 %{_mandir}/man1/ovsdb-client.1*
204 %{_mandir}/man1/ovsdb-server.1*
205 %{_mandir}/man1/ovsdb-tool.1*
206 %{_mandir}/man5/ovs-vswitchd.conf.db.5*
207 %{_mandir}/man8/ovs-appctl.8*
208 %{_mandir}/man8/ovs-brcompatd.8*
209 %{_mandir}/man8/ovs-bugtool.8*
210 %{_mandir}/man8/ovs-controller.8*
211 %{_mandir}/man8/ovs-ctl.8*
212 %{_mandir}/man8/ovs-dpctl.8*
213 %{_mandir}/man8/ovs-ofctl.8*
214 %{_mandir}/man8/ovs-parse-leaks.8*
215 %{_mandir}/man8/ovs-pki.8*
216 %{_mandir}/man8/ovs-vlan-bug-workaround.8*
217 %{_mandir}/man8/ovs-vlan-test.8*
218 %{_mandir}/man8/ovs-vsctl.8*
219 %{_mandir}/man8/ovs-vswitchd.8*
220 %dir %{py_sitescriptdir}/ovs
221 %{py_sitescriptdir}/ovs/*.py*
222 %dir %{py_sitescriptdir}/ovs/db
223 %{py_sitescriptdir}/ovs/db/*.py*
224
225 %files test
226 %defattr(644,root,root,755)
227 %attr(755,root,root) %{_bindir}/ovs-test
228 %{py_sitescriptdir}/ovstest
229 %{_mandir}/man8/ovs-test.8*
230 %endif
231
232 %if %{with kernel}
233 %files -n kernel%{_alt_kernel}-net-openvswitch
234 %defattr(644,root,root,755)
235 /lib/modules/%{_kernel_ver}/kernel/net/openvswitch/*.ko*
236 %endif
This page took 0.264618 seconds and 4 git commands to generate.