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