]> git.pld-linux.org Git - packages/vde2.git/blob - vde2.spec
- support building both python modules
[packages/vde2.git] / vde2.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5
6 Summary:        VDE2: Virtual Distributed Ethernet
7 Summary(pl.UTF-8):      VDE2: wirtualny rozproszony ethernet
8 Name:           vde2
9 Version:        2.3.2
10 Release:        7
11 License:        LGPL v2.1+ (libvdeplug), BSD (slirpvde), GPL v2+ (the rest)
12 Group:          Networking/Utilities
13 Source0:        http://downloads.sourceforge.net/vde/%{name}-%{version}.tar.bz2
14 # Source0-md5:  46fbc5f97f03dc517aa3b2c9d9ea6628
15 Patch0:         %{name}-pathmax.patch
16 Patch1:         %{name}-format.patch
17 Patch2:         %{name}-openssl-1.1.patch
18 Patch3:         python3.patch
19 URL:            http://sourceforge.net/projects/vde/
20 BuildRequires:  autoconf >= 2.59
21 BuildRequires:  automake
22 BuildRequires:  libpcap-devel
23 BuildRequires:  libtool
24 BuildRequires:  openssl-devel
25 %{?with_python2:BuildRequires:  python-devel >= 1:2.5}
26 %{?with_python3:BuildRequires:  python3-devel >= 1:3.2}
27 BuildRequires:  rpm-pythonprov
28 BuildRequires:  rpmbuild(macros) >= 1.507
29 Requires:       %{name}-libs = %{version}-%{release}
30 Obsoletes:      vde < 2
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 # expects "prompt" symbol from user
34 %define         skip_post_check_so      libvdehist.*
35
36 %description
37 VDE2: Virtual Distributed Ethernet. It creates the abstraction of a
38 virtual ethernet: a single vde can be accessed by virtual and real
39 computers.
40
41 %description -l pl.UTF-8
42 VDE2: wirtualny rozproszony ethernet. Narzędzie to tworzy abstrakcyjny
43 wirtualny ethernet - pojedynczy vde może być dostępny z wirtualnych
44 jak i rzeczywistych komputerów.
45
46 %package libs
47 Summary:        VDE2 libraries
48 Summary(pl.UTF-8):      Biblioteki VDE2
49 Group:          Libraries
50 Conflicts:      vde2 < 2.3.2
51
52 %description libs
53 VDE2 libraries.
54
55 %description libs -l pl.UTF-8
56 Biblioteki VDE2.
57
58 %package devel
59 Summary:        Header files for VDE2 libraries
60 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek VDE2
61 Group:          Development/Libraries
62 Requires:       %{name}-libs = %{version}-%{release}
63
64 %description devel
65 Header files for VDE2 libraries.
66
67 %description devel -l pl.UTF-8
68 Pliki nagłówkowe bibliotek VDE2.
69
70 %package static
71 Summary:        Static VDE2 library
72 Summary(pl.UTF-8):      Statyczna biblioteka VDE2
73 Group:          Development/Libraries
74 Requires:       %{name}-devel = %{version}-%{release}
75
76 %description static
77 Static VDE2 library.
78
79 %description static -l pl.UTF-8
80 Statyczna biblioteka VDE2.
81
82 %package -n python-vde2
83 Summary:        Python interface to VDE2
84 Summary(pl.UTF-8):      Pythonowy interfejs do VDE2
85 Group:          Libraries/Python
86 Requires:       %{name}-libs = %{version}-%{release}
87
88 %description -n python-vde2
89 Python interface to VDE2.
90
91 %description -n python-vde2 -l pl.UTF-8
92 Pythonowy interfejs do VDE2.
93
94 %package -n python3-vde2
95 Summary:        Python interface to VDE2
96 Summary(pl.UTF-8):      Pythonowy interfejs do VDE2
97 Group:          Libraries/Python
98 Requires:       %{name}-libs = %{version}-%{release}
99
100 %description -n python3-vde2
101 Python interface to VDE2.
102
103 %description -n python3-vde2 -l pl.UTF-8
104 Pythonowy interfejs do VDE2.
105
106 %prep
107 %setup -q 
108 %patch0 -p1
109 %patch1 -p1
110 %patch2 -p1
111 %patch3 -p1
112
113 %build
114 %{__libtoolize}
115 %{__aclocal}
116 %{__autoconf}
117 %{__autoheader}
118 %{__automake}
119 %if %{with python2}
120 install -d build-py2
121 cd build-py2
122 ../%configure  \
123         PYTHON=%{__python} \
124         --disable-silent-rules \
125         --enable-kernel-switch
126
127 %{__make} -j1 \
128         pythondir=%{py_sitedir}
129 cd ..
130 %endif
131
132 %if %{with python3}
133 install -d build-py3
134 cd build-py3
135 ../%configure  \
136         PYTHON=%{__python3} \
137         --disable-silent-rules \
138         --enable-kernel-switch
139
140 %{__make} -j1 \
141         pythondir=%{py3_sitedir}
142 cd ..
143 %endif
144
145 %install
146 rm -rf $RPM_BUILD_ROOT
147
148 %if %{with python3}
149 %{__make} -C build-py3 install  \
150         DESTDIR=$RPM_BUILD_ROOT \
151         pythondir=%{py3_sitedir}
152 %endif
153
154 %if %{with python2}
155 %{__make} -C build-py2%{?with_python3:/src/lib/python} install \
156         DESTDIR=$RPM_BUILD_ROOT \
157         pythondir=%{py_sitedir}
158 %endif
159
160 # loadable modules
161 %{__rm} $RPM_BUILD_ROOT%{_libdir}/vde2/libvdetap.{la,a}
162 %{__rm} $RPM_BUILD_ROOT%{_libdir}/vde2/vde_l3/*.la
163 %if %{with python2}
164 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/vdeplug_python.la
165 %endif
166 %if %{with python3}
167 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/vdeplug_python.la
168 %endif
169 # libs .la kept - no Requires/Libs.private
170
171 cp -p src/slirpvde/README README.slirpvde
172
173 %if %{with python2}
174 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
175 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
176 %py_postclean
177 %endif
178 %if %{with python3}
179 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
180 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
181 %endif
182
183 %clean
184 rm -rf $RPM_BUILD_ROOT
185
186 %post   libs -p /sbin/ldconfig
187 %postun libs -p /sbin/ldconfig
188
189 %files
190 %defattr(644,root,root,755)
191 %doc COPYING.slirpvde Changelog README README.slirpvde
192 %dir %{_sysconfdir}/vde2
193 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vde2/vdecmd
194 %dir %{_sysconfdir}/vde2/libvdemgmt
195 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vde2/libvdemgmt/asyncrecv.rc
196 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vde2/libvdemgmt/closemachine.rc
197 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vde2/libvdemgmt/openmachine.rc
198 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vde2/libvdemgmt/sendcmd.rc
199 %attr(755,root,root) %{_bindir}/dpipe
200 %attr(755,root,root) %{_bindir}/kvde_switch
201 %attr(755,root,root) %{_bindir}/slirpvde
202 %attr(755,root,root) %{_bindir}/unixcmd
203 %attr(755,root,root) %{_bindir}/unixterm
204 %attr(755,root,root) %{_bindir}/vde_autolink
205 %attr(755,root,root) %{_bindir}/vde_cryptcab
206 %attr(755,root,root) %{_bindir}/vde_l3
207 %attr(755,root,root) %{_bindir}/vde_over_ns
208 %attr(755,root,root) %{_bindir}/vde_pcapplug
209 %attr(755,root,root) %{_bindir}/vde_plug
210 %attr(755,root,root) %{_bindir}/vde_plug2tap
211 %attr(755,root,root) %{_bindir}/vde_switch
212 %attr(755,root,root) %{_bindir}/vdecmd
213 %attr(755,root,root) %{_bindir}/vdekvm
214 %attr(755,root,root) %{_bindir}/vdeq
215 %attr(755,root,root) %{_bindir}/vdeqemu
216 %attr(755,root,root) %{_bindir}/vdeterm
217 %attr(755,root,root) %{_bindir}/wirefilter
218 %attr(755,root,root) %{_sbindir}/vde_tunctl
219 %attr(755,root,root) %{_libexecdir}/vdetap
220 %dir %{_libdir}/vde2
221 %attr(755,root,root) %{_libdir}/vde2/libvdetap.so
222 %dir %{_libdir}/vde2/vde_l3
223 %attr(755,root,root) %{_libdir}/vde2/vde_l3/bfifo.so
224 %attr(755,root,root) %{_libdir}/vde2/vde_l3/pfifo.so
225 %attr(755,root,root) %{_libdir}/vde2/vde_l3/tbf.so
226 %{_mandir}/man1/dpipe.1*
227 %{_mandir}/man1/slirpvde.1*
228 %{_mandir}/man1/unixcmd.1*
229 %{_mandir}/man1/unixterm.1*
230 %{_mandir}/man1/vde_autolink.1*
231 %{_mandir}/man1/vde_cryptcab.1*
232 %{_mandir}/man1/vde_l3.1*
233 %{_mandir}/man1/vde_over_ns.1*
234 %{_mandir}/man1/vde_pcapplug.1*
235 %{_mandir}/man1/vde_plug.1*
236 %{_mandir}/man1/vde_plug2tap.1*
237 %{_mandir}/man1/vde_switch.1*
238 %{_mandir}/man1/vdecmd.1*
239 %{_mandir}/man1/vdekvm.1*
240 %{_mandir}/man1/vdeq.1*
241 %{_mandir}/man1/vdeqemu.1*
242 %{_mandir}/man1/vdetaplib.1*
243 %{_mandir}/man1/vdeterm.1*
244 %{_mandir}/man1/wirefilter.1*
245 %{_mandir}/man8/vde_tunctl.8*
246
247 %files libs
248 %defattr(644,root,root,755)
249 %attr(755,root,root) %{_libdir}/libvdehist.so.*.*.*
250 %attr(755,root,root) %ghost %{_libdir}/libvdehist.so.0
251 %attr(755,root,root) %{_libdir}/libvdemgmt.so.*.*.*
252 %attr(755,root,root) %ghost %{_libdir}/libvdemgmt.so.0
253 %attr(755,root,root) %{_libdir}/libvdeplug.so.*.*.*
254 %attr(755,root,root) %ghost %{_libdir}/libvdeplug.so.3
255 %attr(755,root,root) %{_libdir}/libvdesnmp.so.*.*.*
256 %attr(755,root,root) %ghost %{_libdir}/libvdesnmp.so.0
257
258 %files devel
259 %defattr(644,root,root,755)
260 %attr(755,root,root) %{_libdir}/libvdehist.so
261 %attr(755,root,root) %{_libdir}/libvdemgmt.so
262 %attr(755,root,root) %{_libdir}/libvdeplug.so
263 %attr(755,root,root) %{_libdir}/libvdesnmp.so
264 %{_libdir}/libvdehist.la
265 %{_libdir}/libvdemgmt.la
266 %{_libdir}/libvdeplug.la
267 %{_libdir}/libvdesnmp.la
268 %{_includedir}/libvdehist.h
269 %{_includedir}/libvdemgmt.h
270 %{_includedir}/libvdeplug.h
271 %{_includedir}/libvdeplug_dyn.h
272 %{_includedir}/libvdesnmp.h
273 %{_pkgconfigdir}/vdehist.pc
274 %{_pkgconfigdir}/vdemgmt.pc
275 %{_pkgconfigdir}/vdeplug.pc
276 %{_pkgconfigdir}/vdesnmp.pc
277
278 %files static
279 %defattr(644,root,root,755)
280 %{_libdir}/libvdehist.a
281 %{_libdir}/libvdemgmt.a
282 %{_libdir}/libvdeplug.a
283 %{_libdir}/libvdesnmp.a
284
285 %if %{with python2}
286 %files -n python-vde2
287 %defattr(644,root,root,755)
288 %attr(755,root,root) %{py_sitedir}/vdeplug_python.so
289 %{py_sitedir}/VdePlug.py[co]
290 %endif
291
292 %if %{with python3}
293 %files -n python3-vde2
294 %defattr(644,root,root,755)
295 %attr(755,root,root) %{py3_sitedir}/vdeplug_python.so
296 %{py3_sitedir}/VdePlug.py
297 %{py3_sitedir}/__pycache__/VdePlug.cpython-*.py[co]
298 %endif
This page took 0.133373 seconds and 3 git commands to generate.