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