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