]>
Commit | Line | Data |
---|---|---|
48363591 | 1 | # |
2 | # TODO: | |
74268e47 | 3 | # - Find how to compile with PLD CFLAGS/CXXFLAGS/LDFLAGS. |
4 | # - How to package video and mouse drivers for Guest OS ? | |
8833bce1 | 5 | # (There are several binaries for multiple versions of X11) |
74268e47 | 6 | # - Package SDK. |
48363591 | 7 | # |
8 | # Conditional build: | |
9 | %bcond_without dist_kernel # without distribution kernel | |
d1c4ec5b | 10 | %bcond_without kernel # don't build kernel module |
d1c4ec5b | 11 | %bcond_without userspace # don't build userspace package |
05f1b1f5 | 12 | |
74268e47 | 13 | %define _rel 1 |
05f1b1f5 | 14 | |
8833bce1 | 15 | %if %{without kernel} |
16 | %undefine with_dist_kernel | |
17 | %endif | |
18 | ||
d1c4ec5b JB |
19 | Summary: VirtualBox - x86 hardware virtualizer |
20 | Summary(pl.UTF-8): VirtualBox - wirtualizator sprzętu x86 | |
48363591 | 21 | Name: VirtualBox |
d6f0c54e | 22 | Version: 1.5.0 |
05f1b1f5 | 23 | Release: %{_rel} |
48363591 | 24 | License: GPL v2 |
25 | Group: Applications/Emulators | |
5f1cec1f | 26 | Source0: http://www.virtualbox.org/download/%{version}/%{name}-%{version}_OSE.tar.bz2 |
d6f0c54e | 27 | # Source0-md5: 56c074900260c109ed735c08e726fe81 |
05f1b1f5 | 28 | Source1: virtualbox.init |
7d1c0a63 | 29 | Source2: http://www.virtualbox.org/download/UserManual.pdf |
30 | # Source2-md5: 2e5458bd5b4b9acd18cc86866e8a7284 | |
d89980c7 | 31 | Source3: %{name}.desktop |
fb661e50 | 32 | Source4: %{name}.sh |
48363591 | 33 | Patch0: %{name}-configure.patch |
34 | Patch1: %{name}-qt-paths.patch | |
74268e47 | 35 | Patch2: %{name}-shared-libstdc++.patch |
48363591 | 36 | URL: http://www.virtualbox.org/ |
37 | BuildRequires: SDL-devel | |
e5aaadde | 38 | BuildRequires: bash |
48363591 | 39 | BuildRequires: bcc |
40 | BuildRequires: bin86 | |
eba4b2aa | 41 | BuildRequires: gcc >= 5:3.2.3 |
48363591 | 42 | BuildRequires: iasl |
43 | %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7} | |
44 | BuildRequires: libIDL-devel | |
45 | BuildRequires: libuuid-devel | |
e5aaadde | 46 | BuildRequires: libxslt-progs |
47 | BuildRequires: qt-devel >= 6:3.3.6 | |
d6f0c54e | 48 | BuildRequires: qt-linguist |
48363591 | 49 | BuildRequires: rpmbuild(macros) >= 1.329 |
e5aaadde | 50 | BuildRequires: xalan-c-devel >= 1.10.0 |
eba4b2aa | 51 | #BuildRequires: xcursor-devel |
e5aaadde | 52 | BuildRequires: xerces-c-devel >= 2.6.0 |
eba4b2aa | 53 | BuildRequires: xorg-lib-libXcursor-devel |
e5aaadde | 54 | BuildRequires: zlib-devel >= 1.2.1 |
5f1cec1f ER |
55 | Requires(postun): /usr/sbin/groupdel |
56 | Requires(pre): /usr/bin/getgid | |
57 | Requires(pre): /usr/sbin/groupadd | |
fb661e50 | 58 | Suggests: gxmessage |
5f1cec1f | 59 | Provides: group(vbox) |
eba4b2aa | 60 | ExclusiveArch: %{ix86} %{x8664} |
48363591 | 61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
62 | ||
eba4b2aa | 63 | %ifarch %{x8664} |
5088674d | 64 | %define _outdir amd64 |
65 | %else | |
66 | %define _outdir x86 | |
67 | %endif | |
68 | ||
48363591 | 69 | %description |
70 | InnoTek VirtualBox is a general-purpose full virtualizer for x86 | |
71 | hardware. Targeted at server, desktop and embedded use, it is now the | |
72 | only professional-quality virtualization solution that is also Open | |
73 | Source Software. | |
74 | ||
75 | Some of the features of VirtualBox are: | |
76 | ||
77 | Modularity: VirtualBox has an extremely modular design with | |
78 | well-defined internal programming interfaces and a client/server | |
79 | design. This makes it easy to control it from several interfaces at | |
80 | once: for example, you can start a virtual machine in a typical | |
81 | virtual machine GUI and then control that machine from the command | |
82 | line. VirtualBox also comes with a full Software Development Kit: even | |
83 | though it is Open Source Software, you don't have to hack the source | |
84 | to write a new interface for VirtualBox. | |
85 | ||
86 | Virtual machine descriptions in XML: the configuration settings of | |
87 | virtual machines are stored entirely in XML and are independent of the | |
88 | local machines. Virtual machine definitions can therefore easily be | |
89 | ported to other computers. | |
90 | ||
fd8fc899 JR |
91 | %description -l pl.UTF-8 |
92 | InnoTek VirtualBox jest emulatorem sprzętu x86. Kierowany do | |
93 | zastosowań serwerowych, desktopowych oraz wbudowanych jest obecnie | |
94 | jedynym wysokiej jakości rozwiązaniem wirtualizacyjnym dostępnym | |
95 | również jako Otwarte Oprogramowanie. | |
48363591 | 96 | |
fd8fc899 | 97 | Przykładowe cechy VirtualBoksa: |
48363591 | 98 | |
fd8fc899 JR |
99 | Modularność: VirtualBox jest wysoce zmodularyzowanym produktem z |
100 | dobrze zaprojektowanym wewnętrznym interfejsem programowym typu | |
101 | klient/serwer. Dzięki temu można łatwo kontrolować go za pomocą | |
102 | różnych interfejsów. Można na przykład uruchomić maszynę wirtualną z | |
103 | poziomu interfejsu graficznego, a później kontrolować ją z linii | |
104 | poleceń. VirtualBox dostarcza również pełny pakiet deweloperski, co | |
105 | pozwala stworzyć dowolny inny interfejs zarządzania maszyną wirtualną. | |
48363591 | 106 | |
fd8fc899 JR |
107 | Opisy maszyn wirtualnych w XML-u: konfiguracje poszczególnych maszyn |
108 | wirtualnych są w całości przechowywane w XML-u i są niezależne od | |
109 | lokalnej maszyny. Dzięki temu można szybko i łatwo przenieść | |
110 | konfigurację maszyny wirtualnej na inny komputer. | |
48363591 | 111 | |
74268e47 | 112 | %package -n kernel%{_alt_kernel}-misc-vboxadd |
113 | Summary: Linux kernel module for VirtualBox | |
114 | Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa | |
115 | Release: %{_rel}@%{_kernel_ver_str} | |
116 | Group: Base/Kernel | |
117 | Requires(post,postun): /sbin/depmod | |
118 | Requires: dev >= 2.9.0-7 | |
119 | %if %{with dist_kernel} | |
120 | %requires_releq_kernel | |
121 | Requires(postun): %releq_kernel | |
122 | %endif | |
123 | Provides: kernel(vboxadd) = %{version}-%{_rel} | |
124 | ||
125 | %description -n kernel%{_alt_kernel}-misc-vboxadd | |
126 | Linux kernel module vboxadd for VirtualBox. | |
127 | ||
128 | %description -n kernel%{_alt_kernel}-misc-vboxadd -l pl.UTF-8 | |
129 | Moduł jądra Linuksa vboxadd dla VirtualBoksa. | |
130 | ||
48363591 | 131 | %package -n kernel%{_alt_kernel}-misc-vboxdrv |
eba4b2aa | 132 | Summary: Linux kernel module for VirtualBox |
4dab3322 | 133 | Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa |
48363591 | 134 | Release: %{_rel}@%{_kernel_ver_str} |
135 | Group: Base/Kernel | |
136 | Requires(post,postun): /sbin/depmod | |
137 | Requires: dev >= 2.9.0-7 | |
138 | %if %{with dist_kernel} | |
d6f0c54e | 139 | %requires_releq_kernel |
140 | Requires(postun): %releq_kernel | |
48363591 | 141 | %endif |
142 | Provides: kernel(vboxdrv) = %{version}-%{_rel} | |
143 | ||
144 | %description -n kernel%{_alt_kernel}-misc-vboxdrv | |
eba4b2aa | 145 | Linux kernel module vboxdrv for VirtualBox. |
48363591 | 146 | |
fd8fc899 JR |
147 | %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8 |
148 | Moduł jądra Linuksa vboxdrv dla VirtualBoksa. | |
48363591 | 149 | |
74268e47 | 150 | %package -n kernel%{_alt_kernel}-misc-vboxvfs |
151 | Summary: Linux kernel module for VirtualBox | |
152 | Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa | |
153 | Release: %{_rel}@%{_kernel_ver_str} | |
154 | Group: Base/Kernel | |
155 | Requires(post,postun): /sbin/depmod | |
156 | Requires: dev >= 2.9.0-7 | |
157 | %if %{with dist_kernel} | |
158 | %requires_releq_kernel | |
159 | Requires(postun): %releq_kernel | |
160 | %endif | |
161 | Provides: kernel(vboxvfs) = %{version}-%{_rel} | |
162 | ||
163 | %description -n kernel%{_alt_kernel}-misc-vboxvfs | |
164 | Linux kernel module vboxvfs for VirtualBox. | |
165 | ||
166 | %description -n kernel%{_alt_kernel}-misc-vboxvfs -l pl.UTF-8 | |
167 | Moduł jądra Linuksa vboxvfs dla VirtualBoksa. | |
168 | ||
48363591 | 169 | %prep |
d6f0c54e | 170 | %setup -q -n %{name}-%{version}_OSE |
48363591 | 171 | %patch0 -p0 |
172 | %patch1 -p0 | |
74268e47 | 173 | %patch2 -p1 |
95389e4d | 174 | install %{SOURCE2} . |
fa19f650 | 175 | |
48363591 | 176 | %build |
05f1b1f5 | 177 | KDIR="%{_builddir}/%{buildsubdir}/kernel" |
178 | mkdir -p $KDIR | |
74268e47 | 179 | cp -Ra %{_kernelsrcdir}/include $KDIR |
05f1b1f5 | 180 | %ifarch %{x8664} |
181 | ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm | |
182 | %else | |
183 | ln -sf $KDIR/include/asm-i386 $KDIR/include/asm | |
184 | %endif | |
74268e47 | 185 | |
186 | %if %{with dist_kernel} | |
187 | [ ! -f $KDIR/include/linux/autoconf.h ] && \ | |
188 | ln -sf $KDIR/include/linux/autoconf-dist.h $KDIR/include/linux/autoconf.h | |
189 | %else | |
190 | [ ! -f $KDIR/include/linux/autoconf.h ] && \ | |
191 | ln -sf $KDIR/include/linux/autoconf-nondist.h $KDIR/include/linux/autoconf.h | |
192 | %endif | |
05f1b1f5 | 193 | |
106d8451 | 194 | ./configure \ |
195 | --with-gcc="%{__cc}" \ | |
05f1b1f5 | 196 | --with-g++="%{__cxx}" \ |
197 | --with-linux="$KDIR" | |
48363591 | 198 | |
74268e47 | 199 | %if %{with userspace} |
200 | . ./env.sh && kmk -j1 | |
48363591 | 201 | %endif |
74268e47 | 202 | |
203 | %if %{with kernel} | |
204 | rm -rf PLD-MODULE-BUILD && mkdir PLD-MODULE-BUILD && cd PLD-MODULE-BUILD | |
205 | ||
206 | ../src/VBox/HostDrivers/Support/linux/export_modules modules.tar.gz && \ | |
207 | tar -zxf modules.tar.gz && rm -f modules.tar.gz | |
208 | ../src/VBox/Additions/linux/export_modules modules.tar.gz | |
209 | tar -zxf modules.tar.gz && rm -f modules.tar.gz | |
210 | ||
211 | %build_kernel_modules -m vboxadd -C vboxadd | |
212 | %build_kernel_modules -m vboxdrv -C vboxdrv | |
213 | %build_kernel_modules -m vboxvfs -C vboxvfs | |
214 | cd .. | |
d1c4ec5b | 215 | %endif |
48363591 | 216 | |
217 | %install | |
218 | rm -rf $RPM_BUILD_ROOT | |
219 | ||
d1c4ec5b | 220 | %if %{with userspace} |
48363591 | 221 | install -d \ |
d89980c7 | 222 | $RPM_BUILD_ROOT{%{_bindir},%{_pixmapsdir},%{_desktopdir}} \ |
05f1b1f5 | 223 | $RPM_BUILD_ROOT%{_libdir}/VirtualBox \ |
224 | $RPM_BUILD_ROOT/etc/rc.d/init.d | |
225 | ||
5085c54c ER |
226 | for f in {VBox{BFE,Manage,SDL,SVC,XPCOMIPCD},VirtualBox}; do |
227 | install out/linux.%{_outdir}/release/bin/$f $RPM_BUILD_ROOT%{_libdir}/VirtualBox/$f | |
fb661e50 | 228 | install %{SOURCE4} $RPM_BUILD_ROOT%{_bindir}/$f |
05f1b1f5 | 229 | done |
230 | ||
d6f0c54e | 231 | install out/linux.%{_outdir}/release/bin/VBox*.so \ |
48363591 | 232 | $RPM_BUILD_ROOT%{_libdir}/VirtualBox |
05f1b1f5 | 233 | install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \ |
48363591 | 234 | $RPM_BUILD_ROOT%{_libdir}/VirtualBox |
235 | ||
d1c4ec5b | 236 | cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox |
8833bce1 | 237 | |
238 | install -d $RPM_BUILD_ROOT%{_libdir}/VirtualBox/nls | |
239 | cp -a out/linux.%{_outdir}/release/bin/nls/VirtualBox* $RPM_BUILD_ROOT%{_libdir}/VirtualBox/nls | |
240 | ||
d1c4ec5b | 241 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox |
d89980c7 | 242 | |
b1f8956a | 243 | install out/linux.%{_outdir}/release/bin/VBox.png $RPM_BUILD_ROOT%{_pixmapsdir}/VBox.png |
d89980c7 | 244 | install %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop |
d1c4ec5b JB |
245 | %endif |
246 | ||
247 | %if %{with kernel} | |
74268e47 | 248 | cd PLD-MODULE-BUILD |
249 | for MODULE in *; do | |
250 | [ ! -d $MODULE ] && continue; | |
251 | ||
252 | cd $MODULE | |
253 | %install_kernel_modules -m $MODULE -d misc | |
254 | cd .. | |
255 | done | |
256 | cd .. | |
d1c4ec5b | 257 | %endif |
05f1b1f5 | 258 | |
48363591 | 259 | %clean |
260 | rm -rf $RPM_BUILD_ROOT | |
261 | ||
3b63d3e8 | 262 | %pre |
263 | %groupadd -g 221 -r -f vbox | |
264 | ||
05f1b1f5 | 265 | %post |
266 | /sbin/chkconfig --add virtualbox | |
267 | %service virtualbox restart "VBoxSVC daemon" | |
3b63d3e8 | 268 | if [ "$1" = 1 ]; then |
269 | %banner -e %{name} <<'EOF' | |
270 | Remember to add users which will use VirtualBox to vbox group or they won't be | |
271 | able to write to /dev/vboxdrv. | |
272 | EOF | |
273 | #' | |
274 | fi | |
05f1b1f5 | 275 | |
5f1cec1f | 276 | %preun |
05f1b1f5 | 277 | if [ "$1" = "0" ]; then |
278 | %service virtualbox stop | |
279 | /sbin/chkconfig --del virtualbox | |
280 | fi | |
281 | ||
3b63d3e8 | 282 | %postun |
283 | if [ "$1" = "0" ]; then | |
284 | %groupremove vbox | |
285 | fi | |
286 | ||
74268e47 | 287 | %post -n kernel%{_alt_kernel}-misc-vboxadd |
288 | %depmod %{_kernel_ver} | |
289 | ||
290 | %postun -n kernel%{_alt_kernel}-misc-vboxadd | |
291 | %depmod %{_kernel_ver} | |
292 | ||
48363591 | 293 | %post -n kernel%{_alt_kernel}-misc-vboxdrv |
294 | %depmod %{_kernel_ver} | |
295 | ||
296 | %postun -n kernel%{_alt_kernel}-misc-vboxdrv | |
297 | %depmod %{_kernel_ver} | |
298 | ||
74268e47 | 299 | %post -n kernel%{_alt_kernel}-misc-vboxvfs |
300 | %depmod %{_kernel_ver} | |
301 | ||
302 | %postun -n kernel%{_alt_kernel}-misc-vboxvfs | |
303 | %depmod %{_kernel_ver} | |
304 | ||
d1c4ec5b | 305 | %if %{with userspace} |
48363591 | 306 | %files |
307 | %defattr(644,root,root,755) | |
7d1c0a63 | 308 | %doc UserManual.pdf |
8833bce1 | 309 | %dir %{_libdir}/VirtualBox |
310 | %dir %{_libdir}/VirtualBox/components | |
311 | %dir %{_libdir}/VirtualBox/nls | |
48363591 | 312 | %attr(755,root,root) %{_bindir}/VBox* |
313 | %attr(755,root,root) %{_bindir}/VirtualBox | |
05f1b1f5 | 314 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSVC |
315 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxBFE | |
316 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxManage | |
317 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSDL | |
318 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxXPCOMIPCD | |
319 | %attr(755,root,root) %{_libdir}/VirtualBox/VirtualBox | |
8833bce1 | 320 | %attr(755,root,root) %{_libdir}/VirtualBox/VBox*.so |
05f1b1f5 | 321 | %{_libdir}/VirtualBox/*.gc |
322 | %{_libdir}/VirtualBox/*.r0 | |
05f1b1f5 | 323 | %{_libdir}/VirtualBox/*.xpt |
324 | %{_libdir}/VirtualBox/components/* | |
8833bce1 | 325 | %lang(ar) %{_libdir}/VirtualBox/nls/VirtualBox_ar.qm |
326 | %lang(cs) %{_libdir}/VirtualBox/nls/VirtualBox_cs.qm | |
327 | %lang(de) %{_libdir}/VirtualBox/nls/VirtualBox_de.qm | |
328 | %lang(es) %{_libdir}/VirtualBox/nls/VirtualBox_es.qm | |
329 | %lang(fi) %{_libdir}/VirtualBox/nls/VirtualBox_fi.qm | |
330 | %lang(fr) %{_libdir}/VirtualBox/nls/VirtualBox_fr.qm | |
331 | %lang(hu) %{_libdir}/VirtualBox/nls/VirtualBox_hu.qm | |
332 | %lang(it) %{_libdir}/VirtualBox/nls/VirtualBox_it.qm | |
333 | %lang(ja) %{_libdir}/VirtualBox/nls/VirtualBox_ja.qm | |
334 | %lang(ko) %{_libdir}/VirtualBox/nls/VirtualBox_ko.qm | |
335 | %lang(pl) %{_libdir}/VirtualBox/nls/VirtualBox_pl.qm | |
336 | %lang(pt_BR) %{_libdir}/VirtualBox/nls/VirtualBox_pt_BR.qm | |
337 | %lang(ro) %{_libdir}/VirtualBox/nls/VirtualBox_ro.qm | |
338 | %lang(ru) %{_libdir}/VirtualBox/nls/VirtualBox_ru.qm | |
339 | %lang(sv) %{_libdir}/VirtualBox/nls/VirtualBox_sv.qm | |
340 | %lang(zh_CN) %{_libdir}/VirtualBox/nls/VirtualBox_zh_CN.qm | |
341 | %lang(zh_TW) %{_libdir}/VirtualBox/nls/VirtualBox_zh_TW.qm | |
05f1b1f5 | 342 | %attr(754,root,root) /etc/rc.d/init.d/virtualbox |
d89980c7 | 343 | %{_pixmapsdir}/VBox.png |
344 | %{_desktopdir}/%{name}.desktop | |
d1c4ec5b | 345 | %endif |
48363591 | 346 | |
d1c4ec5b | 347 | %if %{with kernel} |
74268e47 | 348 | %files -n kernel%{_alt_kernel}-misc-vboxadd |
349 | %defattr(644,root,root,755) | |
350 | /lib/modules/%{_kernel_ver}/misc/vboxadd.ko* | |
351 | ||
d1c4ec5b | 352 | %files -n kernel%{_alt_kernel}-misc-vboxdrv |
48363591 | 353 | %defattr(644,root,root,755) |
d1c4ec5b | 354 | /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko* |
74268e47 | 355 | |
356 | %files -n kernel%{_alt_kernel}-misc-vboxvfs | |
357 | %defattr(644,root,root,755) | |
358 | /lib/modules/%{_kernel_ver}/misc/vboxvfs.ko* | |
05f1b1f5 | 359 | %endif |