wok-next view virtualbox-ose/receipt @ rev 8922
Fix gob2: add bdep flex
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Tue Mar 01 02:33:54 2011 +0100 (2011-03-01) |
parents | 478180754a3a |
children | c936c5bbb192 |
line source
1 # SliTaz package receipt.
3 PACKAGE="virtualbox-ose"
4 VERSION="4.0.4"
5 CATEGORY="misc"
6 SHORT_DESC="Powerful x86 virtualization for enterprise as well as home use (Open Source Edition)"
7 MAINTAINER="slaxemulator@gmail.com"
8 DEPENDS="libxml2 xorg-libXcursor libIDL xorg-libXinerama libsdl xorg-libXmu curl libvncserver libpng jpeg mesa libglu-mesa qt4 vde2"
9 BUILD_DEPENDS="bin86 dev86 iasl libxslt-dev Qt4-dev libsdl-ttf-dev alsa-lib-dev hal-dev xorg-libXtst-dev xorg-libXrandr-dev python python-dev xalan-c xalan-c-dev xerces-c-dev openssl-dev zlib-dev libcap-dev glib-dev pam pam-dev bzip2 linux-module-headers pkg-config tar wget"
10 SOURCE="VirtualBox"
11 TARBALL="$SOURCE-$VERSION.tar.bz2"
12 WEB_SITE="http://virtualbox.org/"
13 WGET_URL="http://download.virtualbox.org/virtualbox/$VERSION/$TARBALL"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 cd $src
19 patch -Np1 -i "$stuff/virtualbox-4-makeself-check.patch"
20 patch -Np1 -i "$stuff/virtualbox-4-mkisofs-check.patch"
21 cp $stuff/LocalConfig.kmk .
22 ./configure \
23 --disable-pulse \
24 --disable-java \
25 --disable-docs \
26 --enable-webservice \
27 --enable-vde \
28 --with-linux=/usr/src/linux
29 source ./env.sh
30 kmk all
32 # build modules
33 cd
34 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
35 # build guest additions modules
36 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
37 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src/vboxvideo"
38 }
40 # Rules to gen a SliTaz package suitable for Tazpkg.
41 genpkg_rules()
42 {
43 fs=$WOK/$PACKAGE/taz/$PACKAGE-$VERSION/fs
45 source $src/env.sh
46 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
47 mkdir -p $fs/usr/bin $fs/usr/lib/virtualbox/components \
48 $fs/usr/share/virtualbox/nls \
49 $fs/usr/lib/virtualbox/ExtensionPacks
50 install -m 0755 VBox.sh $fs/usr/bin/VBox
51 sed -i 's/ps -U/ps | grep/' $fs/usr/bin/VBox
52 ln -sf VBox $fs/usr/bin/VBoxHeadless
53 ln -sf VBox $fs/usr/bin/vboxheadless
54 ln -sf VBox $fs/usr/bin/VBoxManage
55 ln -sf VBox $fs/usr/bin/vboxmanage
56 ln -sf VBox $fs/usr/bin/VBoxSDL
57 ln -sf VBox $fs/usr/bin/vboxsdl
58 ln -sf VBox $fs/usr/bin/VirtualBox
59 ln -sf VBox $fs/usr/bin/virtualbox
60 ln -sf VBox $fs/usr/bin/vboxwebsrv
62 install -m 0755 VBoxTunctl "$fs/usr/bin"
64 # components
65 install -D -m 0755 components/* $fs/usr/lib/virtualbox/components
67 # lib
68 install -m 0755 *.so "$fs/usr/lib/virtualbox"
69 install -m 0644 *.gc *.r0 VBoxEFI*.fd "$fs/usr/lib/virtualbox"
71 #setuid root binaries
72 install -m 4755 VBoxSDL VirtualBox VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl "$fs/usr/lib/virtualbox"
74 #other binaries
75 install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL vboxwebsrv webtest "$fs/usr/lib/virtualbox"
77 #language
78 install -m 0755 nls/*.qm "$fs/usr/share/virtualbox/nls"
80 #useless scripts
81 install -m 0755 VBoxCreateUSBNode.sh VBoxSysInfo.sh "$fs/usr/share/virtualbox"
83 #icon
84 install -D -m 0644 VBox.png "$fs/usr/share/pixmaps/VBox.png"
86 #desktop
87 install -D -m 0644 virtualbox.desktop "$fs/usr/share/applications/virtualbox.desktop"
88 install -D -m 0644 virtualbox.xml "$fs/usr/share/mime/packages/virtualbox.xml"
90 #install configuration
91 mkdir -p "$fs/etc/vbox"
92 echo 'lsmod | grep -q vboxdrv || modprobe vboxdrv' > "$fs/etc/vbox/vbox.cfg"
93 echo 'INSTALL_DIR=/usr/lib/virtualbox' >> "$fs/etc/vbox/vbox.cfg"
95 #udev
96 install -D -m 0644 "$stuff/60-virtualbox.rules" \
97 "$fs/etc/udev/rules.d/60-virtualbox.rules"
99 mkdir -p $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
100 cd sdk/installer
101 VBOX_INSTALL_PATH="/usr/lib/virtualbox" python vboxapisetup.py install --root "$fs"
102 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
103 cd sdk/bindings/xpcom/python
104 cp -r xpcom $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
105 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/*.py
106 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/server/*.py
107 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/client/*.py
108 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
110 # virtualbox-modules
111 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
113 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
114 install -D -m644 vboxdrv.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxdrv.ko"
115 install -D -m644 vboxnetflt.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetflt.ko"
116 install -D -m644 vboxnetadp.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetadp.ko"
118 # virtualbox-ose-additions
120 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"
121 mkdir -p $fs/usr/bin
122 mkdir -p $fs/sbin
123 mkdir -p $fs/etc/X11/xorg.conf.d
125 install -m755 VBoxClient VBoxControl VBoxService "$fs/usr/bin"
126 install -m755 mount.vboxsf "$fs/sbin"
128 install -m644 $src/src/VBox/Additions/x11/Installer/50-vboxmouse.conf \
129 $fs/etc/X11/xorg.conf.d/50-vboxmouse.conf
131 install -m755 -D $src/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
132 $fs/usr/bin/VBoxClient-all
133 install -m755 -D $src/src/VBox/Additions/x11/Installer/vboxclient.desktop \
134 $fs/etc/xdg/autostart/vboxclient.desktop
136 install -D vboxmouse_drv_19.so \
137 "$fs/usr/lib/X11/modules/input/vboxmouse.so"
138 install -D vboxvideo_drv_19.so \
139 "$fs/usr/lib/X11/modules/drivers/vboxvideo.so"
140 install -d "$fs/usr/lib/dri"
141 install -m755 VBoxOGL*.so "$fs/usr/lib"
142 ln -s /usr/lib/VBoxOGL.so "$fs/usr/lib/dri/vboxvideo_dri.so"
143 install -m755 -D pam_vbox.so "$fs/lib/security/pam_vbox.so"
145 # virtualbox-ose-additions-modules
146 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
148 cd vboxguest
149 install -D -m644 vboxguest.ko \
150 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxguest.ko"
152 cd ../vboxsf
153 install -D -m644 vboxsf.ko \
154 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxsf.ko"
156 cd ../vboxvideo
157 install -D -m644 vboxvideo.ko \
158 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxvideo.ko"
160 install -D -m 0644 "$stuff/60-vboxguest.rules" \
161 "$fs/etc/udev/rules.d/60-vboxguest.rules"
162 }
164 pre_remove()
165 {
166 sed -i "s/vboxdrv vboxnetadp vboxnetflt //" $1/etc/rcS.conf
167 }
169 post_install()
170 {
171 KERNEL_VERSION=`grep ^VERSION= $1/var/lib/tazpkg/installed/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
173 chroot "$1/" depmod -a $KERNEL_VERSION-slitaz
174 grep -qs vboxdrv $1/etc/rcS.conf ||
175 sed -i 's/LOAD_MODULES="/&vboxdrv vboxnetadp vboxnetflt /' $1/etc/rcS.conf
176 }