]> git.pld-linux.org Git - packages/VirtualBox.git/blob - VirtualBox.spec
623627afa33c00b86ff931efd548abe291000b13
[packages/VirtualBox.git] / VirtualBox.spec
1 #
2 # TODO:
3 # - finish kernel/userspace bconds (deps, limit build to only selected part)
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?
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
10 # - Devel stuff is not packaged yet.
11 # - Now its EA ix86 x8664, but looking into autogenerated env.sh suggests that
12 #   code may be compiled exclusively for i686.
13 # - use %kernel_build macros
14 #
15 # Conditional build:
16 %bcond_without  dist_kernel     # without distribution kernel
17 %bcond_without  kernel          # don't build kernel module
18 %bcond_without  userspace       # don't build userspace package
19
20 %define         _rel            0.2
21
22 Summary:        VirtualBox - x86 hardware virtualizer
23 Summary(pl.UTF-8):      VirtualBox - wirtualizator sprzętu x86
24 Name:           VirtualBox
25 Version:        1.5.0
26 Release:        %{_rel}
27 License:        GPL v2
28 Group:          Applications/Emulators
29 Source0:        http://www.virtualbox.org/download/%{version}/VirtualBox-%{version}_OSE.tar.bz2
30 # Source0-md5:  56c074900260c109ed735c08e726fe81
31 Source1:        virtualbox.init
32 Source2:        http://www.virtualbox.org/download/UserManual.pdf
33 # Source2-md5:  2e5458bd5b4b9acd18cc86866e8a7284
34 Source3:        %{name}.desktop
35 Patch0:         %{name}-configure.patch
36 Patch1:         %{name}-qt-paths.patch
37 URL:            http://www.virtualbox.org/
38 BuildRequires:  SDL-devel
39 BuildRequires:  bash
40 BuildRequires:  bcc
41 BuildRequires:  bin86
42 BuildRequires:  gcc >= 5:3.2.3
43 BuildRequires:  iasl
44 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.7}
45 BuildRequires:  libIDL-devel
46 BuildRequires:  libstdc++-static
47 BuildRequires:  libuuid-devel
48 BuildRequires:  libxslt-progs
49 BuildRequires:  qt-devel >= 6:3.3.6
50 BuildRequires:  qt-linguist
51 BuildRequires:  rpmbuild(macros) >= 1.329
52 BuildRequires:  xalan-c-devel >= 1.10.0
53 #BuildRequires: xcursor-devel
54 BuildRequires:  xerces-c-devel >= 2.6.0
55 BuildRequires:  xorg-lib-libXcursor-devel
56 BuildRequires:  zlib-devel >= 1.2.1
57 ExclusiveArch:  %{ix86} %{x8664}
58 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
60 %ifarch %{x8664}
61 %define         _outdir amd64
62 %else
63 %define         _outdir x86
64 %endif
65
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
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.
93
94 Przykładowe cechy VirtualBoksa:
95
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ą.
103
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.
108
109 %package -n kernel%{_alt_kernel}-misc-vboxdrv
110 Summary:        Linux kernel module for VirtualBox
111 Summary(pl.UTF-8):      Moduł jądra Linuksa dla VirtualBoksa
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}
117 %requires_releq_kernel
118 Requires(postun):       %releq_kernel
119 %endif
120 Provides:       kernel(vboxdrv) = %{version}-%{_rel}
121
122 %description -n kernel%{_alt_kernel}-misc-vboxdrv
123 Linux kernel module vboxdrv for VirtualBox.
124
125 %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8
126 Moduł jądra Linuksa vboxdrv dla VirtualBoksa.
127
128 %prep
129 %setup -q -n %{name}-%{version}_OSE
130 %patch0 -p0
131 %patch1 -p0
132
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
152 install %{SOURCE2} .
153
154 %build
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
163 ln -sf $KDIR/include/linux/autoconf-dist.h $KDIR/include/linux/autoconf.h
164
165 ./configure \
166         --with-gcc="%{__cc}" \
167         --with-g++="%{__cxx}" \
168         --with-linux="$KDIR"
169 . ./env.sh
170 kmk
171
172 %if %{with kernel}
173 cd out/linux.%{_outdir}/release/bin/src
174 for cfg in %{?with_dist_kernel:dist}%{!?with_dist_kernel:nondist}; do
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}
202         mv vboxdrv.ko ../../../../../vboxdrv-$cfg.ko
203 done
204 %endif
205
206 %install
207 rm -rf $RPM_BUILD_ROOT
208
209 %if %{with userspace}
210 install -d \
211         $RPM_BUILD_ROOT{%{_bindir},%{_pixmapsdir},%{_desktopdir}} \
212         $RPM_BUILD_ROOT%{_libdir}/VirtualBox \
213         $RPM_BUILD_ROOT/etc/rc.d/init.d
214
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
218 done
219
220 install out/linux.%{_outdir}/release/bin/VBox*.so \
221         $RPM_BUILD_ROOT%{_libdir}/VirtualBox
222 install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \
223         $RPM_BUILD_ROOT%{_libdir}/VirtualBox
224
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
227
228 install ./out/linux.x86/release/bin/VBox.png $RPM_BUILD_ROOT%{_pixmapsdir}/VBox.png
229 install %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
230 %endif
231
232 %if %{with kernel}
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
235 %endif
236
237 %clean
238 rm -rf $RPM_BUILD_ROOT
239
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
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
256 %if %{with userspace}
257 %files
258 %defattr(644,root,root,755)
259 %doc UserManual.pdf
260 %attr(755,root,root) %{_bindir}/VBox*
261 %attr(755,root,root) %{_bindir}/VirtualBox
262 %dir %{_libdir}/VirtualBox
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
271 %attr(755,root,root) %{_libdir}/VirtualBox/VBox*.so
272 %{_libdir}/VirtualBox/*.xpt
273 %dir %{_libdir}/VirtualBox/components
274 %{_libdir}/VirtualBox/components/*
275 %attr(754,root,root) /etc/rc.d/init.d/virtualbox
276 %{_pixmapsdir}/VBox.png
277 %{_desktopdir}/%{name}.desktop
278 %endif
279
280 %if %{with kernel}
281 %files -n kernel%{_alt_kernel}-misc-vboxdrv
282 %defattr(644,root,root,755)
283 /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko*
284 %endif
This page took 0.082952 seconds and 3 git commands to generate.