]> git.pld-linux.org Git - packages/VirtualBox.git/blob - VirtualBox.spec
- improved module build,
[packages/VirtualBox.git] / VirtualBox.spec
1 #
2 # TODO:
3 # - Find how to compile with PLD CFLAGS/CXXFLAGS/LDFLAGS.
4 # - How to package video and mouse drivers for Guest OS ?
5 #   (There are binaries for multiple versions of X11)
6 # - Package SDK.
7 #
8 # Conditional build:
9 %bcond_without  dist_kernel     # without distribution kernel
10 %bcond_without  kernel          # don't build kernel module
11 %bcond_without  userspace       # don't build userspace package
12
13 %define         _rel            1
14
15 Summary:        VirtualBox - x86 hardware virtualizer
16 Summary(pl.UTF-8):      VirtualBox - wirtualizator sprzętu x86
17 Name:           VirtualBox
18 Version:        1.5.0
19 Release:        %{_rel}
20 License:        GPL v2
21 Group:          Applications/Emulators
22 Source0:        http://www.virtualbox.org/download/%{version}/%{name}-%{version}_OSE.tar.bz2
23 # Source0-md5:  56c074900260c109ed735c08e726fe81
24 Source1:        virtualbox.init
25 Source2:        http://www.virtualbox.org/download/UserManual.pdf
26 # Source2-md5:  2e5458bd5b4b9acd18cc86866e8a7284
27 Source3:        %{name}.desktop
28 Source4:        %{name}.sh
29 Patch0:         %{name}-configure.patch
30 Patch1:         %{name}-qt-paths.patch
31 Patch2:         %{name}-shared-libstdc++.patch
32 URL:            http://www.virtualbox.org/
33 BuildRequires:  SDL-devel
34 BuildRequires:  bash
35 BuildRequires:  bcc
36 BuildRequires:  bin86
37 BuildRequires:  gcc >= 5:3.2.3
38 BuildRequires:  iasl
39 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.7}
40 BuildRequires:  libIDL-devel
41 BuildRequires:  libuuid-devel
42 BuildRequires:  libxslt-progs
43 BuildRequires:  qt-devel >= 6:3.3.6
44 BuildRequires:  qt-linguist
45 BuildRequires:  rpmbuild(macros) >= 1.329
46 BuildRequires:  xalan-c-devel >= 1.10.0
47 #BuildRequires: xcursor-devel
48 BuildRequires:  xerces-c-devel >= 2.6.0
49 BuildRequires:  xorg-lib-libXcursor-devel
50 BuildRequires:  zlib-devel >= 1.2.1
51 Requires(postun):       /usr/sbin/groupdel
52 Requires(pre):  /usr/bin/getgid
53 Requires(pre):  /usr/sbin/groupadd
54 Suggests:       gxmessage
55 Provides:       group(vbox)
56 ExclusiveArch:  %{ix86} %{x8664}
57 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58
59 %ifarch %{x8664}
60 %define         _outdir amd64
61 %else
62 %define         _outdir x86
63 %endif
64
65 %description
66 InnoTek VirtualBox is a general-purpose full virtualizer for x86
67 hardware. Targeted at server, desktop and embedded use, it is now the
68 only professional-quality virtualization solution that is also Open
69 Source Software.
70
71 Some of the features of VirtualBox are:
72
73 Modularity: VirtualBox has an extremely modular design with
74 well-defined internal programming interfaces and a client/server
75 design. This makes it easy to control it from several interfaces at
76 once: for example, you can start a virtual machine in a typical
77 virtual machine GUI and then control that machine from the command
78 line. VirtualBox also comes with a full Software Development Kit: even
79 though it is Open Source Software, you don't have to hack the source
80 to write a new interface for VirtualBox.
81
82 Virtual machine descriptions in XML: the configuration settings of
83 virtual machines are stored entirely in XML and are independent of the
84 local machines. Virtual machine definitions can therefore easily be
85 ported to other computers.
86
87 %description -l pl.UTF-8
88 InnoTek VirtualBox jest emulatorem sprzętu x86. Kierowany do
89 zastosowań serwerowych, desktopowych oraz wbudowanych jest obecnie
90 jedynym wysokiej jakości rozwiązaniem wirtualizacyjnym dostępnym
91 również jako Otwarte Oprogramowanie.
92
93 Przykładowe cechy VirtualBoksa:
94
95 Modularność: VirtualBox jest wysoce zmodularyzowanym produktem z
96 dobrze zaprojektowanym wewnętrznym interfejsem programowym typu
97 klient/serwer. Dzięki temu można łatwo kontrolować go za pomocą
98 różnych interfejsów. Można na przykład uruchomić maszynę wirtualną z
99 poziomu interfejsu graficznego, a później kontrolować ją z linii
100 poleceń. VirtualBox dostarcza również pełny pakiet deweloperski, co
101 pozwala stworzyć dowolny inny interfejs zarządzania maszyną wirtualną.
102
103 Opisy maszyn wirtualnych w XML-u: konfiguracje poszczególnych maszyn
104 wirtualnych są w całości przechowywane w XML-u i są niezależne od
105 lokalnej maszyny. Dzięki temu można szybko i łatwo przenieść
106 konfigurację maszyny wirtualnej na inny komputer.
107
108 %package -n kernel%{_alt_kernel}-misc-vboxadd
109 Summary:        Linux kernel module for VirtualBox
110 Summary(pl.UTF-8):      Moduł jądra Linuksa dla VirtualBoksa
111 Release:        %{_rel}@%{_kernel_ver_str}
112 Group:          Base/Kernel
113 Requires(post,postun):  /sbin/depmod
114 Requires:       dev >= 2.9.0-7
115 %if %{with dist_kernel}
116 %requires_releq_kernel
117 Requires(postun):       %releq_kernel
118 %endif
119 Provides:       kernel(vboxadd) = %{version}-%{_rel}
120
121 %description -n kernel%{_alt_kernel}-misc-vboxadd
122 Linux kernel module vboxadd for VirtualBox.
123
124 %description -n kernel%{_alt_kernel}-misc-vboxadd -l pl.UTF-8
125 Moduł jądra Linuksa vboxadd dla VirtualBoksa.
126
127 %package -n kernel%{_alt_kernel}-misc-vboxdrv
128 Summary:        Linux kernel module for VirtualBox
129 Summary(pl.UTF-8):      Moduł jądra Linuksa dla VirtualBoksa
130 Release:        %{_rel}@%{_kernel_ver_str}
131 Group:          Base/Kernel
132 Requires(post,postun):  /sbin/depmod
133 Requires:       dev >= 2.9.0-7
134 %if %{with dist_kernel}
135 %requires_releq_kernel
136 Requires(postun):       %releq_kernel
137 %endif
138 Provides:       kernel(vboxdrv) = %{version}-%{_rel}
139
140 %description -n kernel%{_alt_kernel}-misc-vboxdrv
141 Linux kernel module vboxdrv for VirtualBox.
142
143 %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8
144 Moduł jądra Linuksa vboxdrv dla VirtualBoksa.
145
146 %package -n kernel%{_alt_kernel}-misc-vboxvfs
147 Summary:        Linux kernel module for VirtualBox
148 Summary(pl.UTF-8):      Moduł jądra Linuksa dla VirtualBoksa
149 Release:        %{_rel}@%{_kernel_ver_str}
150 Group:          Base/Kernel
151 Requires(post,postun):  /sbin/depmod
152 Requires:       dev >= 2.9.0-7
153 %if %{with dist_kernel}
154 %requires_releq_kernel
155 Requires(postun):       %releq_kernel
156 %endif
157 Provides:       kernel(vboxvfs) = %{version}-%{_rel}
158
159 %description -n kernel%{_alt_kernel}-misc-vboxvfs
160 Linux kernel module vboxvfs for VirtualBox.
161
162 %description -n kernel%{_alt_kernel}-misc-vboxvfs -l pl.UTF-8
163 Moduł jądra Linuksa vboxvfs dla VirtualBoksa.
164
165 %prep
166 %setup -q -n %{name}-%{version}_OSE
167 %patch0 -p0
168 %patch1 -p0
169 %patch2 -p1
170 install %{SOURCE2} .
171
172 %build
173 KDIR="%{_builddir}/%{buildsubdir}/kernel"
174 mkdir -p $KDIR
175 cp -Ra %{_kernelsrcdir}/include $KDIR
176 %ifarch %{x8664}
177 ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm
178 %else
179 ln -sf $KDIR/include/asm-i386 $KDIR/include/asm
180 %endif
181
182 %if %{with dist_kernel}
183 [ ! -f $KDIR/include/linux/autoconf.h ] && \
184     ln -sf $KDIR/include/linux/autoconf-dist.h $KDIR/include/linux/autoconf.h
185 %else
186 [ ! -f $KDIR/include/linux/autoconf.h ] && \
187     ln -sf $KDIR/include/linux/autoconf-nondist.h $KDIR/include/linux/autoconf.h
188 %endif
189
190 ./configure \
191         --with-gcc="%{__cc}" \
192         --with-g++="%{__cxx}" \
193         --with-linux="$KDIR"
194
195 %if %{with userspace}
196 . ./env.sh && kmk -j1
197 %endif
198
199 %if %{with kernel}
200 rm -rf PLD-MODULE-BUILD && mkdir PLD-MODULE-BUILD && cd PLD-MODULE-BUILD
201
202 ../src/VBox/HostDrivers/Support/linux/export_modules modules.tar.gz && \
203         tar -zxf modules.tar.gz && rm -f modules.tar.gz
204 ../src/VBox/Additions/linux/export_modules modules.tar.gz
205         tar -zxf modules.tar.gz && rm -f modules.tar.gz
206
207 %build_kernel_modules -m vboxadd -C vboxadd
208 %build_kernel_modules -m vboxdrv -C vboxdrv
209 %build_kernel_modules -m vboxvfs -C vboxvfs
210 cd ..
211 %endif
212
213 %install
214 rm -rf $RPM_BUILD_ROOT
215
216 %if %{with userspace}
217 install -d \
218         $RPM_BUILD_ROOT{%{_bindir},%{_pixmapsdir},%{_desktopdir}} \
219         $RPM_BUILD_ROOT%{_libdir}/VirtualBox \
220         $RPM_BUILD_ROOT/etc/rc.d/init.d
221
222 for f in {VBox{BFE,Manage,SDL,SVC,XPCOMIPCD},VirtualBox}; do
223         install out/linux.%{_outdir}/release/bin/$f $RPM_BUILD_ROOT%{_libdir}/VirtualBox/$f
224         install %{SOURCE4} $RPM_BUILD_ROOT%{_bindir}/$f
225 done
226
227 install out/linux.%{_outdir}/release/bin/VBox*.so \
228         $RPM_BUILD_ROOT%{_libdir}/VirtualBox
229 install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \
230         $RPM_BUILD_ROOT%{_libdir}/VirtualBox
231
232 cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox
233 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox
234
235 install out/linux.%{_outdir}/release/bin/VBox.png $RPM_BUILD_ROOT%{_pixmapsdir}/VBox.png
236 install %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
237 %endif
238
239 %if %{with kernel}
240 cd PLD-MODULE-BUILD
241 for MODULE in *; do
242         [ ! -d $MODULE ] && continue;
243
244         cd $MODULE
245         %install_kernel_modules -m $MODULE -d misc
246         cd ..
247 done
248 cd ..
249 %endif
250
251 %clean
252 rm -rf $RPM_BUILD_ROOT
253
254 %pre
255 %groupadd -g 221 -r -f vbox
256
257 %post
258 /sbin/chkconfig --add virtualbox
259 %service virtualbox restart "VBoxSVC daemon"
260 if [ "$1" = 1 ]; then
261 %banner -e %{name} <<'EOF'
262 Remember to add users which will use VirtualBox to vbox group or they won't be
263 able to write to /dev/vboxdrv.
264 EOF
265 #'
266 fi
267
268 %preun
269 if [ "$1" = "0" ]; then
270         %service virtualbox stop
271         /sbin/chkconfig --del virtualbox
272 fi
273
274 %postun
275 if [ "$1" = "0" ]; then
276         %groupremove vbox
277 fi
278
279 %post   -n kernel%{_alt_kernel}-misc-vboxadd
280 %depmod %{_kernel_ver}
281
282 %postun -n kernel%{_alt_kernel}-misc-vboxadd
283 %depmod %{_kernel_ver}
284
285 %post   -n kernel%{_alt_kernel}-misc-vboxdrv
286 %depmod %{_kernel_ver}
287
288 %postun -n kernel%{_alt_kernel}-misc-vboxdrv
289 %depmod %{_kernel_ver}
290
291 %post   -n kernel%{_alt_kernel}-misc-vboxvfs
292 %depmod %{_kernel_ver}
293
294 %postun -n kernel%{_alt_kernel}-misc-vboxvfs
295 %depmod %{_kernel_ver}
296
297 %if %{with userspace}
298 %files
299 %defattr(644,root,root,755)
300 %doc UserManual.pdf
301 %attr(755,root,root) %{_bindir}/VBox*
302 %attr(755,root,root) %{_bindir}/VirtualBox
303 %dir %{_libdir}/VirtualBox
304 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSVC
305 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxBFE
306 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxManage
307 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSDL
308 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxXPCOMIPCD
309 %attr(755,root,root) %{_libdir}/VirtualBox/VirtualBox
310 %{_libdir}/VirtualBox/*.gc
311 %{_libdir}/VirtualBox/*.r0
312 %attr(755,root,root) %{_libdir}/VirtualBox/VBox*.so
313 %{_libdir}/VirtualBox/*.xpt
314 %dir %{_libdir}/VirtualBox/components
315 %{_libdir}/VirtualBox/components/*
316 %attr(754,root,root) /etc/rc.d/init.d/virtualbox
317 %{_pixmapsdir}/VBox.png
318 %{_desktopdir}/%{name}.desktop
319 %endif
320
321 %if %{with kernel}
322 %files -n kernel%{_alt_kernel}-misc-vboxadd
323 %defattr(644,root,root,755)
324 /lib/modules/%{_kernel_ver}/misc/vboxadd.ko*
325
326 %files -n kernel%{_alt_kernel}-misc-vboxdrv
327 %defattr(644,root,root,755)
328 /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko*
329
330 %files -n kernel%{_alt_kernel}-misc-vboxvfs
331 %defattr(644,root,root,755)
332 /lib/modules/%{_kernel_ver}/misc/vboxvfs.ko*
333 %endif
This page took 0.05858 seconds and 4 git commands to generate.