]>
Commit | Line | Data |
---|---|---|
48363591 | 1 | # |
2 | # TODO: | |
d1c4ec5b | 3 | # - finish kernel/userspace bconds (deps, limit build to only selected part) |
48363591 | 4 | # - Home page says that some addons should be compiled, I don't see any except. |
5 | # vboxaddon kernel module and {vboxmouse,vboxvideo)_drv.so. Are they required? | |
05f1b1f5 | 6 | # - .desktop file |
7 | # - it seems that VBoxSVC should not be started by init script but I'm still | |
8 | # testing this | |
9 | # - /dev/vboxdrv should belong to vboxusers group and have rw rights to it | |
48363591 | 10 | # - Devel stuff is not packaged yet. |
eba4b2aa JB |
11 | # - Now its EA ix86 x8664, but looking into autogenerated env.sh suggests that |
12 | # code may be compiled exclusively for i686. | |
32b670ab | 13 | # - use %kernel_build macros |
48363591 | 14 | # |
15 | # Conditional build: | |
16 | %bcond_without dist_kernel # without distribution kernel | |
d1c4ec5b | 17 | %bcond_without kernel # don't build kernel module |
d1c4ec5b | 18 | %bcond_without userspace # don't build userspace package |
05f1b1f5 | 19 | |
210193ea | 20 | %define _rel 0.1 |
05f1b1f5 | 21 | |
d1c4ec5b JB |
22 | Summary: VirtualBox - x86 hardware virtualizer |
23 | Summary(pl.UTF-8): VirtualBox - wirtualizator sprzętu x86 | |
48363591 | 24 | Name: VirtualBox |
d6f0c54e | 25 | Version: 1.5.0 |
05f1b1f5 | 26 | Release: %{_rel} |
48363591 | 27 | License: GPL v2 |
28 | Group: Applications/Emulators | |
d6f0c54e | 29 | Source0: http://www.virtualbox.org/download/%{version}/VirtualBox-%{version}_OSE.tar.bz2 |
30 | # Source0-md5: 56c074900260c109ed735c08e726fe81 | |
05f1b1f5 | 31 | Source1: virtualbox.init |
7d1c0a63 | 32 | Source2: http://www.virtualbox.org/download/UserManual.pdf |
33 | # Source2-md5: 2e5458bd5b4b9acd18cc86866e8a7284 | |
48363591 | 34 | Patch0: %{name}-configure.patch |
35 | Patch1: %{name}-qt-paths.patch | |
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 | |
d6f0c54e | 45 | BuildRequires: libstdc++-static |
48363591 | 46 | BuildRequires: libuuid-devel |
e5aaadde | 47 | BuildRequires: libxslt-progs |
48 | BuildRequires: qt-devel >= 6:3.3.6 | |
d6f0c54e | 49 | BuildRequires: qt-linguist |
48363591 | 50 | BuildRequires: rpmbuild(macros) >= 1.329 |
e5aaadde | 51 | BuildRequires: xalan-c-devel >= 1.10.0 |
eba4b2aa | 52 | #BuildRequires: xcursor-devel |
e5aaadde | 53 | BuildRequires: xerces-c-devel >= 2.6.0 |
eba4b2aa | 54 | BuildRequires: xorg-lib-libXcursor-devel |
e5aaadde | 55 | BuildRequires: zlib-devel >= 1.2.1 |
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 | |
108 | %package -n kernel%{_alt_kernel}-misc-vboxdrv | |
eba4b2aa | 109 | Summary: Linux kernel module for VirtualBox |
4dab3322 | 110 | Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa |
48363591 | 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} | |
d6f0c54e | 116 | %requires_releq_kernel |
117 | Requires(postun): %releq_kernel | |
48363591 | 118 | %endif |
119 | Provides: kernel(vboxdrv) = %{version}-%{_rel} | |
120 | ||
121 | %description -n kernel%{_alt_kernel}-misc-vboxdrv | |
eba4b2aa | 122 | Linux kernel module vboxdrv for VirtualBox. |
48363591 | 123 | |
fd8fc899 JR |
124 | %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8 |
125 | Moduł jądra Linuksa vboxdrv dla VirtualBoksa. | |
48363591 | 126 | |
48363591 | 127 | %prep |
d6f0c54e | 128 | %setup -q -n %{name}-%{version}_OSE |
48363591 | 129 | %patch0 -p0 |
130 | %patch1 -p0 | |
131 | ||
5085c54c ER |
132 | cat > VBox.sh <<'EOF' |
133 | #!/bin/sh | |
134 | ||
135 | if [ ! -c /dev/vboxdrv ]; then | |
136 | echo "Special character device /dev/vboxdrv doesn't exists!" | |
137 | echo "Check your installation and if vboxdrv kernel module is loaded." | |
138 | exit 1 | |
139 | fi | |
140 | ||
141 | if [ ! -w /dev/vboxdrv ]; then | |
142 | echo "You don't have write access to /dev/vboxdrv!" | |
143 | echo "Correct this situation or contact with your system administrator." | |
144 | exit 1 | |
145 | fi | |
146 | ||
147 | BINFILE=$(basename "$0") | |
148 | LD_LIBRARY_PATH=%{_libdir}/VirtualBox %{_libdir}/VirtualBox/$BINFILE ${1:+"$@"} | |
149 | EOF | |
150 | ||
95389e4d | 151 | install %{SOURCE2} . |
fa19f650 | 152 | |
48363591 | 153 | %build |
05f1b1f5 | 154 | KDIR="%{_builddir}/%{buildsubdir}/kernel" |
155 | mkdir -p $KDIR | |
156 | cp -a %{_kernelsrcdir}/include $KDIR | |
157 | %ifarch %{x8664} | |
158 | ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm | |
159 | %else | |
160 | ln -sf $KDIR/include/asm-i386 $KDIR/include/asm | |
161 | %endif | |
d6f0c54e | 162 | ln -sf $KDIR/include/linux/autoconf-dist.h $KDIR/include/linux/autoconf.h |
05f1b1f5 | 163 | |
106d8451 | 164 | ./configure \ |
165 | --with-gcc="%{__cc}" \ | |
05f1b1f5 | 166 | --with-g++="%{__cxx}" \ |
167 | --with-linux="$KDIR" | |
48363591 | 168 | . ./env.sh |
169 | kmk | |
170 | ||
d1c4ec5b | 171 | %if %{with kernel} |
5088674d | 172 | cd out/linux.%{_outdir}/release/bin/src |
d6f0c54e | 173 | for cfg in %{?with_dist_kernel:dist}%{!?with_dist_kernel:nondist}; do |
48363591 | 174 | if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then |
175 | exit 1 | |
176 | fi | |
177 | rm -rf o | |
178 | install -d o/include/linux | |
179 | ln -sf %{_kernelsrcdir}/config-$cfg o/.config | |
180 | ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers | |
181 | ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h | |
182 | %if %{with dist_kernel} | |
183 | %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts | |
184 | %else | |
185 | touch o/include/config/MARKER | |
186 | ln -sf %{_kernelsrcdir}/scripts o/scripts | |
187 | %endif | |
188 | ln -sf ../../include/VBox o/include/VBox | |
189 | ln -sf ../../include/iprt o/include/iprt | |
190 | %{__make} -C %{_kernelsrcdir} clean \ | |
191 | SYSSRC=%{_kernelsrcdir} \ | |
192 | SYSOUT=$PWD/o \ | |
193 | M=$PWD O=$PWD/o \ | |
194 | %{?with_verbose:V=1} | |
195 | %{__make} -C %{_kernelsrcdir} modules \ | |
196 | CC="%{__cc}" CPP="%{__cpp}" \ | |
197 | SYSSRC=%{_kernelsrcdir} \ | |
198 | SYSOUT=$PWD/o \ | |
199 | M=$PWD O=$PWD/o \ | |
200 | %{?with_verbose:V=1} | |
05f1b1f5 | 201 | mv vboxdrv.ko ../../../../../vboxdrv-$cfg.ko |
48363591 | 202 | done |
d1c4ec5b | 203 | %endif |
48363591 | 204 | |
205 | %install | |
206 | rm -rf $RPM_BUILD_ROOT | |
207 | ||
d1c4ec5b | 208 | %if %{with userspace} |
48363591 | 209 | install -d \ |
210 | $RPM_BUILD_ROOT%{_bindir} \ | |
05f1b1f5 | 211 | $RPM_BUILD_ROOT%{_libdir}/VirtualBox \ |
212 | $RPM_BUILD_ROOT/etc/rc.d/init.d | |
213 | ||
5085c54c ER |
214 | for f in {VBox{BFE,Manage,SDL,SVC,XPCOMIPCD},VirtualBox}; do |
215 | install out/linux.%{_outdir}/release/bin/$f $RPM_BUILD_ROOT%{_libdir}/VirtualBox/$f | |
216 | install VBox.sh $RPM_BUILD_ROOT%{_bindir}/$f | |
05f1b1f5 | 217 | done |
218 | ||
d6f0c54e | 219 | install out/linux.%{_outdir}/release/bin/VBox*.so \ |
48363591 | 220 | $RPM_BUILD_ROOT%{_libdir}/VirtualBox |
05f1b1f5 | 221 | install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \ |
48363591 | 222 | $RPM_BUILD_ROOT%{_libdir}/VirtualBox |
223 | ||
d1c4ec5b JB |
224 | cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox |
225 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox | |
226 | %endif | |
227 | ||
228 | %if %{with kernel} | |
d6f0c54e | 229 | install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc |
230 | install vboxdrv-dist.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vboxdrv.ko | |
d1c4ec5b | 231 | %endif |
05f1b1f5 | 232 | |
48363591 | 233 | %clean |
234 | rm -rf $RPM_BUILD_ROOT | |
235 | ||
05f1b1f5 | 236 | %post |
237 | /sbin/chkconfig --add virtualbox | |
238 | %service virtualbox restart "VBoxSVC daemon" | |
239 | ||
240 | %preun | |
241 | if [ "$1" = "0" ]; then | |
242 | %service virtualbox stop | |
243 | /sbin/chkconfig --del virtualbox | |
244 | fi | |
245 | ||
48363591 | 246 | %post -n kernel%{_alt_kernel}-misc-vboxdrv |
247 | %depmod %{_kernel_ver} | |
248 | ||
249 | %postun -n kernel%{_alt_kernel}-misc-vboxdrv | |
250 | %depmod %{_kernel_ver} | |
251 | ||
d1c4ec5b | 252 | %if %{with userspace} |
48363591 | 253 | %files |
254 | %defattr(644,root,root,755) | |
7d1c0a63 | 255 | %doc UserManual.pdf |
48363591 | 256 | %attr(755,root,root) %{_bindir}/VBox* |
257 | %attr(755,root,root) %{_bindir}/VirtualBox | |
d1c4ec5b | 258 | %dir %{_libdir}/VirtualBox |
05f1b1f5 | 259 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSVC |
260 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxBFE | |
261 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxManage | |
262 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSDL | |
263 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxXPCOMIPCD | |
264 | %attr(755,root,root) %{_libdir}/VirtualBox/VirtualBox | |
265 | %{_libdir}/VirtualBox/*.gc | |
266 | %{_libdir}/VirtualBox/*.r0 | |
d1c4ec5b | 267 | %attr(755,root,root) %{_libdir}/VirtualBox/VBox*.so |
05f1b1f5 | 268 | %{_libdir}/VirtualBox/*.xpt |
d1c4ec5b | 269 | %dir %{_libdir}/VirtualBox/components |
05f1b1f5 | 270 | %{_libdir}/VirtualBox/components/* |
271 | %attr(754,root,root) /etc/rc.d/init.d/virtualbox | |
d1c4ec5b | 272 | %endif |
48363591 | 273 | |
d1c4ec5b | 274 | %if %{with kernel} |
d1c4ec5b | 275 | %files -n kernel%{_alt_kernel}-misc-vboxdrv |
48363591 | 276 | %defattr(644,root,root,755) |
d1c4ec5b | 277 | /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko* |
05f1b1f5 | 278 | %endif |