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