]> git.pld-linux.org Git - packages/VirtualBox.git/blob - VirtualBox.spec
- Release 0.4, VBox.sh moved to Source4, use gxmessage when possible
[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 # - it seems that VBoxSVC should not be started by init script but I'm still
7 #   testing this
8 # - Devel stuff is not packaged yet.
9 # - Now its EA ix86 x8664, but looking into autogenerated env.sh suggests that
10 #   code may be compiled exclusively for i686.
11 # - use %kernel_build macros
12 #
13 # Conditional build:
14 %bcond_without  dist_kernel     # without distribution kernel
15 %bcond_without  kernel          # don't build kernel module
16 %bcond_without  userspace       # don't build userspace package
17
18 %define         _rel            0.4
19
20 Summary:        VirtualBox - x86 hardware virtualizer
21 Summary(pl.UTF-8):      VirtualBox - wirtualizator sprzętu x86
22 Name:           VirtualBox
23 Version:        1.5.0
24 Release:        %{_rel}
25 License:        GPL v2
26 Group:          Applications/Emulators
27 Source0:        http://www.virtualbox.org/download/%{version}/%{name}-%{version}_OSE.tar.bz2
28 # Source0-md5:  56c074900260c109ed735c08e726fe81
29 Source1:        virtualbox.init
30 Source2:        http://www.virtualbox.org/download/UserManual.pdf
31 # Source2-md5:  2e5458bd5b4b9acd18cc86866e8a7284
32 Source3:        %{name}.desktop
33 Source4:        %{name}.sh
34 Patch0:         %{name}-configure.patch
35 Patch1:         %{name}-qt-paths.patch
36 URL:            http://www.virtualbox.org/
37 BuildRequires:  SDL-devel
38 BuildRequires:  bash
39 BuildRequires:  bcc
40 BuildRequires:  bin86
41 BuildRequires:  gcc >= 5:3.2.3
42 BuildRequires:  iasl
43 %{?with_dist_kernel:BuildRequires:      kernel%{_alt_kernel}-module-build >= 3:2.6.7}
44 BuildRequires:  libIDL-devel
45 BuildRequires:  libstdc++-static
46 BuildRequires:  libuuid-devel
47 BuildRequires:  libxslt-progs
48 BuildRequires:  qt-devel >= 6:3.3.6
49 BuildRequires:  qt-linguist
50 BuildRequires:  rpmbuild(macros) >= 1.329
51 BuildRequires:  xalan-c-devel >= 1.10.0
52 #BuildRequires: xcursor-devel
53 BuildRequires:  xerces-c-devel >= 2.6.0
54 BuildRequires:  xorg-lib-libXcursor-devel
55 BuildRequires:  zlib-devel >= 1.2.1
56 Requires(postun):       /usr/sbin/groupdel
57 Requires(pre):  /usr/bin/getgid
58 Requires(pre):  /usr/sbin/groupadd
59 Suggests:       gxmessage
60 Provides:       group(vbox)
61 ExclusiveArch:  %{ix86} %{x8664}
62 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63
64 %ifarch %{x8664}
65 %define         _outdir amd64
66 %else
67 %define         _outdir x86
68 %endif
69
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
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.
97
98 Przykładowe cechy VirtualBoksa:
99
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ą.
107
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.
112
113 %package -n kernel%{_alt_kernel}-misc-vboxdrv
114 Summary:        Linux kernel module for VirtualBox
115 Summary(pl.UTF-8):      Moduł jądra Linuksa dla VirtualBoksa
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}
121 %requires_releq_kernel
122 Requires(postun):       %releq_kernel
123 %endif
124 Provides:       kernel(vboxdrv) = %{version}-%{_rel}
125
126 %description -n kernel%{_alt_kernel}-misc-vboxdrv
127 Linux kernel module vboxdrv for VirtualBox.
128
129 %description -n kernel%{_alt_kernel}-misc-vboxdrv -l pl.UTF-8
130 Moduł jądra Linuksa vboxdrv dla VirtualBoksa.
131
132 %prep
133 %setup -q -n %{name}-%{version}_OSE
134 %patch0 -p0
135 %patch1 -p0
136 install %{SOURCE2} .
137
138 %build
139 KDIR="%{_builddir}/%{buildsubdir}/kernel"
140 mkdir -p $KDIR
141 cp -a %{_kernelsrcdir}/include $KDIR
142 %ifarch %{x8664}
143 ln -sf $KDIR/include/asm-x86_64 $KDIR/include/asm
144 %else
145 ln -sf $KDIR/include/asm-i386 $KDIR/include/asm
146 %endif
147 ln -sf $KDIR/include/linux/autoconf-dist.h $KDIR/include/linux/autoconf.h
148
149 ./configure \
150         --with-gcc="%{__cc}" \
151         --with-g++="%{__cxx}" \
152         --with-linux="$KDIR"
153 . ./env.sh
154 kmk
155
156 %if %{with kernel}
157 cd out/linux.%{_outdir}/release/bin/src
158 for cfg in %{?with_dist_kernel:dist}%{!?with_dist_kernel:nondist}; do
159         if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
160                 exit 1
161         fi
162         rm -rf o
163         install -d o/include/linux
164         ln -sf %{_kernelsrcdir}/config-$cfg o/.config
165         ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
166         ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
167 %if %{with dist_kernel}
168         %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
169 %else
170         touch o/include/config/MARKER
171         ln -sf %{_kernelsrcdir}/scripts o/scripts
172 %endif
173         ln -sf ../../include/VBox o/include/VBox
174         ln -sf ../../include/iprt o/include/iprt
175         %{__make} -C %{_kernelsrcdir} clean \
176                 SYSSRC=%{_kernelsrcdir} \
177                 SYSOUT=$PWD/o \
178                 M=$PWD O=$PWD/o \
179                 %{?with_verbose:V=1}
180         %{__make} -C %{_kernelsrcdir} modules \
181                 CC="%{__cc}" CPP="%{__cpp}" \
182                 SYSSRC=%{_kernelsrcdir} \
183                 SYSOUT=$PWD/o \
184                 M=$PWD O=$PWD/o \
185                 %{?with_verbose:V=1}
186         mv vboxdrv.ko ../../../../../vboxdrv-$cfg.ko
187 done
188 %endif
189
190 %install
191 rm -rf $RPM_BUILD_ROOT
192
193 %if %{with userspace}
194 install -d \
195         $RPM_BUILD_ROOT{%{_bindir},%{_pixmapsdir},%{_desktopdir}} \
196         $RPM_BUILD_ROOT%{_libdir}/VirtualBox \
197         $RPM_BUILD_ROOT/etc/rc.d/init.d
198
199 for f in {VBox{BFE,Manage,SDL,SVC,XPCOMIPCD},VirtualBox}; do
200         install out/linux.%{_outdir}/release/bin/$f $RPM_BUILD_ROOT%{_libdir}/VirtualBox/$f
201         install %{SOURCE4} $RPM_BUILD_ROOT%{_bindir}/$f
202 done
203
204 install out/linux.%{_outdir}/release/bin/VBox*.so \
205         $RPM_BUILD_ROOT%{_libdir}/VirtualBox
206 install out/linux.%{_outdir}/release/bin/{VBox{DD,DD2}{GC.gc,R0.r0},VMM{GC.gc,R0.r0},*.xpt} \
207         $RPM_BUILD_ROOT%{_libdir}/VirtualBox
208
209 cp -a out/linux.%{_outdir}/release/bin/components $RPM_BUILD_ROOT%{_libdir}/VirtualBox
210 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/virtualbox
211
212 install out/linux.%{_outdir}/release/bin/VBox.png $RPM_BUILD_ROOT%{_pixmapsdir}/VBox.png
213 install %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
214 %endif
215
216 %if %{with kernel}
217 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc
218 install vboxdrv-dist.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/vboxdrv.ko
219 %endif
220
221 %clean
222 rm -rf $RPM_BUILD_ROOT
223
224 %pre
225 %groupadd -g 221 -r -f vbox
226
227 %post
228 /sbin/chkconfig --add virtualbox
229 %service virtualbox restart "VBoxSVC daemon"
230 if [ "$1" = 1 ]; then
231 %banner -e %{name} <<'EOF'
232 Remember to add users which will use VirtualBox to vbox group or they won't be
233 able to write to /dev/vboxdrv.
234 EOF
235 #'
236 fi
237
238 %preun
239 if [ "$1" = "0" ]; then
240         %service virtualbox stop
241         /sbin/chkconfig --del virtualbox
242 fi
243
244 %postun
245 if [ "$1" = "0" ]; then
246         %groupremove vbox
247 fi
248
249 %post   -n kernel%{_alt_kernel}-misc-vboxdrv
250 %depmod %{_kernel_ver}
251
252 %postun -n kernel%{_alt_kernel}-misc-vboxdrv
253 %depmod %{_kernel_ver}
254
255 %if %{with userspace}
256 %files
257 %defattr(644,root,root,755)
258 %doc UserManual.pdf
259 %attr(755,root,root) %{_bindir}/VBox*
260 %attr(755,root,root) %{_bindir}/VirtualBox
261 %dir %{_libdir}/VirtualBox
262 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSVC
263 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxBFE
264 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxManage
265 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxSDL
266 %attr(755,root,root) %{_libdir}/VirtualBox/VBoxXPCOMIPCD
267 %attr(755,root,root) %{_libdir}/VirtualBox/VirtualBox
268 %{_libdir}/VirtualBox/*.gc
269 %{_libdir}/VirtualBox/*.r0
270 %attr(755,root,root) %{_libdir}/VirtualBox/VBox*.so
271 %{_libdir}/VirtualBox/*.xpt
272 %dir %{_libdir}/VirtualBox/components
273 %{_libdir}/VirtualBox/components/*
274 %attr(754,root,root) /etc/rc.d/init.d/virtualbox
275 %{_pixmapsdir}/VBox.png
276 %{_desktopdir}/%{name}.desktop
277 %endif
278
279 %if %{with kernel}
280 %files -n kernel%{_alt_kernel}-misc-vboxdrv
281 %defattr(644,root,root,755)
282 /lib/modules/%{_kernel_ver}/misc/vboxdrv.ko*
283 %endif
This page took 0.092914 seconds and 3 git commands to generate.