wok-4.x view virtualbox-ose/receipt @ rev 8531

Merge
author Christopher Rogers <slaxemulator@gmail.com>
date Sun Feb 13 02:27:18 2011 +0000 (2011-02-13)
parents 705acc834ef5
children 478180754a3a
line source
1 # SliTaz package receipt.
3 PACKAGE="virtualbox-ose"
4 VERSION="4.0.2"
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"
9 BUILD_DEPENDS="bin86 dev86 iasl libxslt-dev libxml2-dev xorg-libXcursor-dev Qt4-dev libIDL libsdl-ttf-dev libsdl-dev alsa-lib-dev hal-dev xorg-libXtst-dev xorg-libXinerama-dev xorg-libXrandr-dev xorg-libXmu-dev curl-dev python python-dev mesa-dev libglu-mesa xalan-c xalan-c-dev xerces-c-dev openssl-dev libpng-dev jpeg-dev zlib-dev libvncserver-dev libcap-dev glib-dev pam pam-dev bzip2 linux-module-headers pkg-config"
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 stuff=$WOK/$PACKAGE/stuff
19 cd $src
20 patch -Np1 -i "$stuff/virtualbox-4-makeself-check.patch"
21 patch -Np1 -i "$stuff/virtualbox-4-mkisofs-check.patch"
22 [ -L /bin/tar ] && tazpkg get-install tar --forced
23 cp ../stuff/LocalConfig.kmk .
24 ./configure \
25 --disable-pulse \
26 --disable-java \
27 --disable-docs \
28 --enable-webservice \
29 --with-linux=/usr/src/linux
30 source ./env.sh
31 kmk all
33 # build modules
34 cd
35 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
36 # build guest additions modules
37 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
38 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src/vboxvideo"
39 }
41 # Rules to gen a SliTaz package suitable for Tazpkg.
42 genpkg_rules()
43 {
44 fs=$WOK/$PACKAGE/taz/$PACKAGE-$VERSION/fs
45 stuff=$WOK/$PACKAGE/stuff
47 source $src/env.sh
48 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
49 mkdir -p $fs/usr/bin $fs/usr/lib/virtualbox/components \
50 $fs/usr/share/virtualbox/nls
51 cp -a VBox.sh $fs/usr/bin/VBox
52 sed -i 's/ps -U/ps | grep/' $fs/usr/bin/VBox
53 ln -sf VBox $fs/usr/bin/VBoxHeadless
54 ln -sf VBox $fs/usr/bin/VBoxManage
55 ln -sf VBox $fs/usr/bin/VBoxSDL
56 ln -sf VBox $fs/usr/bin/VirtualBox
58 install -m 0755 VBoxTunctl "$fs/usr/bin"
60 # components
61 cp -a components/* $fs/usr/lib/virtualbox/components
63 # lib
64 install -m 0755 *.so "$fs/usr/lib/virtualbox"
65 install -m 0644 *.gc *.r0 VBoxEFI*.fd "$fs/usr/lib/virtualbox"
67 #setuid root binaries
68 install -m 4755 VBoxHeadless VBoxSDL VBoxNetDHCP VBoxNetAdpCtl VirtualBox VBoxBFE "$fs/usr/lib/virtualbox"
70 #other binaries
71 install -m 0755 VBoxManage VBoxSVC VBoxXPCOMIPCD VBoxSysInfo.sh xpidl \
72 VBoxTestOGL EfiThunk "$fs/usr/lib/virtualbox"
74 #language
75 install -m 0755 nls/*.qm "$fs/usr/share/virtualbox/nls"
77 #icon
78 install -D -m 0644 VBox.png "$fs/usr/share/pixmaps/VBox.png"
80 #desktop
81 install -D -m 0644 virtualbox.desktop "$fs/usr/share/applications/virtualbox.desktop"
83 #install configuration
84 mkdir -p "$fs/etc/vbox"
85 echo 'lsmod | grep -q vboxdrv || modprobe vboxdrv' > "$fs/etc/vbox/vbox.cfg"
86 echo 'INSTALL_DIR=/usr/lib/virtualbox' >> "$fs/etc/vbox/vbox.cfg"
88 #udev
89 install -D -m 0644 "$stuff/60-virtualbox.rules" \
90 "$fs/etc/udev/rules.d/60-virtualbox.rules"
92 mkdir -p $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
93 cd sdk/installer
94 VBOX_INSTALL_PATH="/usr/lib/virtualbox" python vboxapisetup.py install --root "$fs"
95 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
96 cd sdk/bindings/xpcom/python
97 cp -r xpcom $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
98 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/*.py
99 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/server/*.py
100 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/client/*.py
101 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
103 # virtualbox-modules
104 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
106 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
107 install -D -m644 vboxdrv.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxdrv.ko"
108 install -D -m644 vboxnetflt.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetflt.ko"
109 install -D -m644 vboxnetadp.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetadp.ko"
111 # virtualbox-ose-additions
113 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"
114 mkdir -p $fs/usr/bin
115 mkdir -p $fs/sbin
116 mkdir -p $fs/etc/X11/xorg.conf.d
118 install -m755 VBoxClient VBoxControl VBoxService "$fs/usr/bin"
119 install -m755 mount.vboxsf "$fs/sbin"
121 install -m644 $src/src/VBox/Additions/x11/Installer/50-vboxmouse.conf \
122 $fs/etc/X11/xorg.conf.d/50-vboxmouse.conf
124 install -m755 -D $src/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
125 $fs/usr/bin/VBoxClient-all
126 install -m755 -D $src/src/VBox/Additions/x11/Installer/vboxclient.desktop \
127 $fs/etc/xdg/autostart/vboxclient.desktop
129 install -D vboxmouse_drv_19.so \
130 "$fs/usr/lib/X11/modules/input/vboxmouse.so"
131 install -D vboxvideo_drv_19.so \
132 "$fs/usr/lib/X11/modules/drivers/vboxvideo.so"
133 install -d "$fs/usr/lib/dri"
134 install -m755 VBoxOGL*.so "$fs/usr/lib"
135 ln -s /usr/lib/VBoxOGL.so "$fs/usr/lib/dri/vboxvideo_dri.so"
136 install -m755 -D pam_vbox.so "$fs/lib/security/pam_vbox.so"
138 # virtualbox-ose-additions-modules
139 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
141 cd vboxguest
142 install -D -m644 vboxguest.ko \
143 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxguest.ko"
145 cd ../vboxsf
146 install -D -m644 vboxsf.ko \
147 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxsf.ko"
149 cd ../vboxvideo
150 install -D -m644 vboxvideo.ko \
151 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxvideo.ko"
153 install -D -m 0644 "$stuff/60-vboxguest.rules" \
154 "$fs/etc/udev/rules.d/60-vboxguest.rules"
155 }
157 pre_remove()
158 {
159 sed -i "s/vboxdrv vboxnetadp vboxnetflt //" $1/etc/rcS.conf
160 }
162 post_install()
163 {
164 KERNEL_VERSION=`grep ^VERSION= $1/var/lib/tazpkg/installed/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
166 chroot "$1/" depmod -a $KERNEL_VERSION-slitaz
167 grep -qs vboxdrv $1/etc/rcS.conf ||
168 sed -i 's/LOAD_MODULES="/&vboxdrv vboxnetadp vboxnetflt /' $1/etc/rcS.conf
169 }