]>
Commit | Line | Data |
---|---|---|
48363591 | 1 | # |
2 | # TODO: | |
48363591 | 3 | # - Home page says that some addons should be compiled, I don't see any except. |
4 | # vboxaddon kernel module and {vboxmouse,vboxvideo)_drv.so. Are they required? | |
05f1b1f5 | 5 | # - .desktop file |
6 | # - it seems that VBoxSVC should not be started by init script but I'm still | |
7 | # testing this | |
8 | # - /dev/vboxdrv should belong to vboxusers group and have rw rights to it | |
48363591 | 9 | # - Devel stuff is not packaged yet. |
eba4b2aa JB |
10 | # - Now its EA ix86 x8664, but looking into autogenerated env.sh suggests that |
11 | # code may be compiled exclusively for i686. | |
32b670ab | 12 | # - use %kernel_build macros |
48363591 | 13 | # |
14 | # Conditional build: | |
15 | %bcond_without dist_kernel # without distribution kernel | |
05f1b1f5 | 16 | %bcond_without up # without up packages |
48363591 | 17 | %bcond_without smp # without SMP kernel modules |
05f1b1f5 | 18 | |
19 | %define _rel 0.2 | |
20 | ||
48363591 | 21 | Summary: VirtualBox |
4dab3322 | 22 | Summary(pl.UTF-8): VirtualBox |
48363591 | 23 | Name: VirtualBox |
722f3faf | 24 | Version: 1.3.6 |
05f1b1f5 | 25 | Release: %{_rel} |
48363591 | 26 | License: GPL v2 |
27 | Group: Applications/Emulators | |
245db1e9 | 28 | Source0: http://www.virtualbox.org/download/%{version}/VirtualBox-OSE-%{version}.tar.bz2 |
722f3faf | 29 | # Source0-md5: 70c24ccee8b5778efd8d22f9996fbec9 |
05f1b1f5 | 30 | Source1: virtualbox.init |
7d1c0a63 | 31 | Source2: http://www.virtualbox.org/download/UserManual.pdf |
32 | # Source2-md5: 2e5458bd5b4b9acd18cc86866e8a7284 | |
48363591 | 33 | Patch0: %{name}-configure.patch |
34 | Patch1: %{name}-qt-paths.patch | |
35 | URL: http://www.virtualbox.org/ | |
36 | BuildRequires: SDL-devel | |
e5aaadde | 37 | BuildRequires: bash |
48363591 | 38 | BuildRequires: bcc |
39 | BuildRequires: bin86 | |
eba4b2aa | 40 | BuildRequires: gcc >= 5:3.2.3 |
48363591 | 41 | BuildRequires: iasl |
42 | %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7} | |
43 | BuildRequires: libIDL-devel | |
44 | BuildRequires: libuuid-devel | |
e5aaadde | 45 | BuildRequires: libxslt-progs |
46 | BuildRequires: qt-devel >= 6:3.3.6 | |
48363591 | 47 | BuildRequires: rpmbuild(macros) >= 1.329 |
e5aaadde | 48 | BuildRequires: xalan-c-devel >= 1.10.0 |
eba4b2aa | 49 | #BuildRequires: xcursor-devel |
e5aaadde | 50 | BuildRequires: xerces-c-devel >= 2.6.0 |
eba4b2aa | 51 | BuildRequires: xorg-lib-libXcursor-devel |
e5aaadde | 52 | BuildRequires: zlib-devel >= 1.2.1 |
05f1b1f5 | 53 | Requires: kernel(vboxdrv) = %{version}-%{_rel} |
eba4b2aa | 54 | ExclusiveArch: %{ix86} %{x8664} |
48363591 | 55 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
56 | ||
eba4b2aa | 57 | %ifarch %{x8664} |
5088674d | 58 | %define _outdir amd64 |
59 | %else | |
60 | %define _outdir x86 | |
61 | %endif | |
62 | ||
48363591 | 63 | %description |
64 | InnoTek VirtualBox is a general-purpose full virtualizer for x86 | |
65 | hardware. Targeted at server, desktop and embedded use, it is now the | |
66 | only professional-quality virtualization solution that is also Open | |
67 | Source Software. | |
68 | ||
69 | Some of the features of VirtualBox are: | |
70 | ||
71 | Modularity: VirtualBox has an extremely modular design with | |
72 | well-defined internal programming interfaces and a client/server | |
73 | design. This makes it easy to control it from several interfaces at | |
74 | once: for example, you can start a virtual machine in a typical | |
75 | virtual machine GUI and then control that machine from the command | |
76 | line. VirtualBox also comes with a full Software Development Kit: even | |
77 | though it is Open Source Software, you don't have to hack the source | |
78 | to write a new interface for VirtualBox. | |
79 | ||
80 | Virtual machine descriptions in XML: the configuration settings of | |
81 | virtual machines are stored entirely in XML and are independent of the | |
82 | local machines. Virtual machine definitions can therefore easily be | |
83 | ported to other computers. | |
84 | ||
fd8fc899 JR |
85 | %description -l pl.UTF-8 |
86 | InnoTek VirtualBox jest emulatorem sprzętu x86. Kierowany do | |
87 | zastosowań serwerowych, desktopowych oraz wbudowanych jest obecnie | |
88 | jedynym wysokiej jakości rozwiązaniem wirtualizacyjnym dostępnym | |
89 | również jako Otwarte Oprogramowanie. | |
48363591 | 90 | |
fd8fc899 | 91 | Przykładowe cechy VirtualBoksa: |
48363591 | 92 | |
fd8fc899 JR |
93 | Modularność: VirtualBox jest wysoce zmodularyzowanym produktem z |
94 | dobrze zaprojektowanym wewnętrznym interfejsem programowym typu | |
95 | klient/serwer. Dzięki temu można łatwo kontrolować go za pomocą | |
96 | różnych interfejsów. Można na przykład uruchomić maszynę wirtualną z | |
97 | poziomu interfejsu graficznego, a później kontrolować ją z linii | |
98 | poleceń. VirtualBox dostarcza również pełny pakiet deweloperski, co | |
99 | pozwala stworzyć dowolny inny interfejs zarządzania maszyną wirtualną. | |
48363591 | 100 | |
fd8fc899 JR |
101 | Opisy maszyn wirtualnych w XML-u: konfiguracje poszczególnych maszyn |
102 | wirtualnych są w całości przechowywane w XML-u i są niezależne od | |
103 | lokalnej maszyny. Dzięki temu można szybko i łatwo przenieść | |
104 | konfigurację maszyny wirtualnej na inny komputer. | |
48363591 | 105 | |
106 | %package -n kernel%{_alt_kernel}-misc-vboxdrv | |
eba4b2aa | 107 | Summary: Linux kernel module for VirtualBox |
4dab3322 | 108 | Summary(pl.UTF-8): Moduł jądra Linuksa dla VirtualBoksa |
48363591 | 109 | Release: %{_rel}@%{_kernel_ver_str} |
110 | Group: Base/Kernel | |
111 | Requires(post,postun): /sbin/depmod | |
112 | Requires: dev >= 2.9.0-7 | |
113 | %if %{with dist_kernel} | |
114 | %requires_releq_kernel_up | |
115 | Requires(postun): %releq_kernel_up | |
116 | %endif | |
117 | Provides: kernel(vboxdrv) = %{version}-%{_rel} | |
118 | ||
119 | %description -n kernel%{_alt_kernel}-misc-vboxdrv | |
eba4b2aa | 120 | Linux kernel module vboxdrv for VirtualBox. |
48363591 | 121 | |
fd8fc899 JR |
122 | %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8 |
123 | Moduł jądra Linuksa vboxdrv dla VirtualBoksa. | |
48363591 | 124 | |
125 | %package -n kernel%{_alt_kernel}-smp-misc-vboxdrv | |
eba4b2aa | 126 | Summary: Linux SMP kernel module for VirtualBox |
4dab3322 | 127 | Summary(pl.UTF-8): Moduł jądra Linuksa SMP dla VirtualBoksa |
48363591 | 128 | Release: %{_rel}@%{_kernel_ver_str} |
129 | Group: Base/Kernel | |
130 | Requires(post,postun): /sbin/depmod | |
131 | Requires: dev >= 2.9.0-7 | |
132 | %if %{with dist_kernel} | |
133 | %requires_releq_kernel_smp | |
134 | Requires(postun): %releq_kernel_smp | |
135 | %endif | |
136 | Provides: kernel(vboxdrv) = %{version}-%{_rel} | |
137 | ||
138 | %description -n kernel%{_alt_kernel}-smp-misc-vboxdrv | |
eba4b2aa | 139 | Linux SMP kernel module vboxdrv for VirtualBox. |
48363591 | 140 | |
fd8fc899 JR |
141 | %description -n kernel%{_alt_kernel}-smp-misc-vboxdrv -l pl.UTF-8 |
142 | Moduł jądra Linuksa SMP vboxdrv dla VirtualBoksa. | |
48363591 | 143 | |
144 | %prep | |
b8f15f8d | 145 | %setup -q -n %{name}-OSE-%{version} |
48363591 | 146 | %patch0 -p0 |
147 | %patch1 -p0 | |
148 | ||
5085c54c ER |
149 | cat > VBox.sh <<'EOF' |
150 | #!/bin/sh | |
151 | ||
152 | if [ ! -c /dev/vboxdrv ]; then | |
153 | echo "Special character device /dev/vboxdrv doesn't exists!" | |
154 | echo "Check your installation and if vboxdrv kernel module is loaded." | |
155 | exit 1 | |
156 | fi | |
157 | ||
158 | if [ ! -w /dev/vboxdrv ]; then | |
159 | echo "You don't have write access to /dev/vboxdrv!" | |
160 | echo "Correct this situation or contact with your system administrator." | |
161 | exit 1 | |
162 | fi | |
163 | ||
164 | BINFILE=$(basename "$0") | |
165 | LD_LIBRARY_PATH=%{_libdir}/VirtualBox %{_libdir}/VirtualBox/$BINFILE ${1:+"$@"} | |
166 | EOF | |
167 | ||
48363591 | 168 | %build |
05f1b1f5 | 169 | KDIR="%{_builddir}/%{buildsubdir}/kernel" |
170 | mkdir -p $KDIR | |
171 | cp -a %{_kernelsrcdir}/include $KDIR | |
172 | %ifarch %{x8664} | |
173 | ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm | |
174 | %else | |
175 | ln -sf $KDIR/include/asm-i386 $KDIR/include/asm | |
176 | %endif | |
177 | ln -sf $KDIR/include/linux/autoconf-up.h $KDIR/include/linux/autoconf.h | |
178 | ||
106d8451 | 179 | ./configure \ |
180 | --with-gcc="%{__cc}" \ | |
05f1b1f5 | 181 | --with-g++="%{__cxx}" \ |
182 | --with-linux="$KDIR" | |
48363591 | 183 | . ./env.sh |
184 | kmk | |
185 | ||
5088674d | 186 | cd out/linux.%{_outdir}/release/bin/src |
48363591 | 187 | for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do |
188 | if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then | |
189 | exit 1 | |
190 | fi | |
191 | rm -rf o | |
192 | install -d o/include/linux | |
193 | ln -sf %{_kernelsrcdir}/config-$cfg o/.config | |
194 | ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers | |
195 | ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h | |
196 | %if %{with dist_kernel} | |
197 | %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts | |
198 | %else | |
199 | touch o/include/config/MARKER | |
200 | ln -sf %{_kernelsrcdir}/scripts o/scripts | |
201 | %endif | |
202 | ln -sf ../../include/VBox o/include/VBox | |
203 | ln -sf ../../include/iprt o/include/iprt | |
204 | %{__make} -C %{_kernelsrcdir} clean \ | |
205 | SYSSRC=%{_kernelsrcdir} \ | |
206 | SYSOUT=$PWD/o \ | |
207 | M=$PWD O=$PWD/o \ | |
208 | %{?with_verbose:V=1} | |
209 | %{__make} -C %{_kernelsrcdir} modules \ | |
210 | CC="%{__cc}" CPP="%{__cpp}" \ | |
211 | SYSSRC=%{_kernelsrcdir} \ | |
212 | SYSOUT=$PWD/o \ | |
213 | M=$PWD O=$PWD/o \ | |
214 | %{?with_verbose:V=1} | |
05f1b1f5 | 215 | mv vboxdrv.ko ../../../../../vboxdrv-$cfg.ko |
48363591 | 216 | done |
217 | ||
218 | %install | |
219 | rm -rf $RPM_BUILD_ROOT | |
220 | ||
221 | install -d \ | |
222 | $RPM_BUILD_ROOT%{_bindir} \ | |
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 | |
228 | install VBox.sh $RPM_BUILD_ROOT%{_bindir}/$f | |
05f1b1f5 | 229 | done |
230 | ||
231 | install out/linux.%{_outdir}/release/bin/VBox{C,DD,DD2,REM,REMImp,RT,VMM,XML,XPCOM,XPCOMIPCC}.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 | ||
48363591 | 236 | install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc |
05f1b1f5 | 237 | install vboxdrv-up.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vboxdrv.ko |
48363591 | 238 | %if %{with smp} && %{with dist_kernel} |
05f1b1f5 | 239 | install vboxdrv-smp.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/vboxdrv.ko |
48363591 | 240 | %endif |
241 | ||
05f1b1f5 | 242 | cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox |
243 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox | |
244 | ||
7d1c0a63 | 245 | cp %{SOURCE2} . |
246 | ||
48363591 | 247 | %clean |
248 | rm -rf $RPM_BUILD_ROOT | |
249 | ||
05f1b1f5 | 250 | %post |
251 | /sbin/chkconfig --add virtualbox | |
252 | %service virtualbox restart "VBoxSVC daemon" | |
253 | ||
254 | %preun | |
255 | if [ "$1" = "0" ]; then | |
256 | %service virtualbox stop | |
257 | /sbin/chkconfig --del virtualbox | |
258 | fi | |
259 | ||
48363591 | 260 | %post -n kernel%{_alt_kernel}-misc-vboxdrv |
261 | %depmod %{_kernel_ver} | |
262 | ||
263 | %postun -n kernel%{_alt_kernel}-misc-vboxdrv | |
264 | %depmod %{_kernel_ver} | |
265 | ||
266 | %if %{with smp} && %{with dist_kernel} | |
267 | %post -n kernel%{_alt_kernel}-smp-misc-vboxdrv | |
268 | %depmod %{_kernel_ver}smp | |
269 | ||
270 | %postun -n kernel%{_alt_kernel}-smp-misc-vboxdrv | |
271 | %depmod %{_kernel_ver}smp | |
272 | %endif | |
273 | ||
274 | %files | |
275 | %defattr(644,root,root,755) | |
7d1c0a63 | 276 | %doc UserManual.pdf |
05f1b1f5 | 277 | %dir %{_libdir}/VirtualBox |
278 | %dir %{_libdir}/VirtualBox/components | |
48363591 | 279 | %attr(755,root,root) %{_bindir}/VBox* |
280 | %attr(755,root,root) %{_bindir}/VirtualBox | |
05f1b1f5 | 281 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSVC |
282 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxBFE | |
283 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxManage | |
284 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSDL | |
285 | %attr(755,root,root) %{_libdir}/VirtualBox/VBoxXPCOMIPCD | |
286 | %attr(755,root,root) %{_libdir}/VirtualBox/VirtualBox | |
287 | %{_libdir}/VirtualBox/*.gc | |
288 | %{_libdir}/VirtualBox/*.r0 | |
289 | %{_libdir}/VirtualBox/VBox*.so | |
290 | %{_libdir}/VirtualBox/*.xpt | |
291 | %{_libdir}/VirtualBox/components/* | |
292 | %attr(754,root,root) /etc/rc.d/init.d/virtualbox | |
48363591 | 293 | |
05f1b1f5 | 294 | %if %{with up} || %{without dist_kernel} |
48363591 | 295 | %files -n kernel%{_alt_kernel}-misc-vboxdrv |
296 | %defattr(644,root,root,755) | |
05f1b1f5 | 297 | /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko.gz |
298 | %endif | |
48363591 | 299 | |
300 | %if %{with smp} && %{with dist_kernel} | |
301 | %files -n kernel%{_alt_kernel}-smp-misc-vboxdrv | |
302 | %defattr(644,root,root,755) | |
05f1b1f5 | 303 | /lib/modules/%{_kernel_ver}smp/misc/vboxdrv.ko.gz |
48363591 | 304 | %endif |