wok view virtualbox-ose/receipt @ rev 14001
virtualbox-ose:try to fix + up to 4.2.6
author | ernia <monghitri@aruba.it> |
---|---|
date | Thu Feb 14 20:48:38 2013 +0000 (2013-02-14) |
parents | 8e94e4c07b9a |
children | 6efcccbffae7 |
line source
1 # SliTaz package receipt.
3 PACKAGE="virtualbox-ose"
4 VERSION="4.2.6"
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 SOURCE="VirtualBox"
9 TARBALL="$SOURCE-$VERSION.tar.bz2"
10 WEB_SITE="http://virtualbox.org/"
11 WGET_URL="http://download.virtualbox.org/virtualbox/$VERSION/$TARBALL"
12 PROVIDE="virtualbox"
14 DEPENDS="libxml2 xorg-libXcursor libIDL xorg-libXinerama libsdl \
15 xorg-libXmu curl libvncserver libpng jpeg mesa libglu-mesa qt4 vde2"
16 BUILD_DEPENDS="bin86 dev86 iasl libIDL libsdl-dev mesa-dev libxslt-dev \
17 libglu-mesa-dev Qt4-dev libsdl-ttf-dev alsa-lib-dev hal-dev xorg-libXtst-dev \
18 xorg-libXrandr-dev python python-dev xalan-c curl-dev xalan-c-dev \
19 xerces-c-dev openssl-dev zlib-dev libcap-dev glib-dev libvncserver-dev \
20 pam pam-dev bzip2 linux-module-headers pkg-config tar wget vde2-dev \
21 libpng-dev gsoap-dev libdevmapper-dev"
23 # Rules to configure and make the package.
24 compile_rules()
25 {
26 cd $src
27 patch -Np1 -i "$stuff/virtualbox-4-makeself-check.patch"
28 #patch -Np1 -i "$stuff/virtualbox-4-mkisofs-check.patch"
29 cp $stuff/LocalConfig.kmk .
30 ./configure \
31 --disable-pulse \
32 --disable-java \
33 --disable-docs \
34 --enable-webservice \
35 --enable-vde \
36 --with-linux=/usr/src/linux
37 source ./env.sh
38 kmk all
40 # build modules. NOTE: we gor ERROR even if it build and cook will exit
41 # sed ERROR to error.
42 cd
43 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
44 # build guest additions modules
45 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
46 KERN_DIR=/usr/src/linux make -C \
47 "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src/vboxvideo" \
48 2>&1 | sed s'/ERROR/error/'
49 }
51 # Rules to gen a SliTaz package suitable for Tazpkg.
52 genpkg_rules()
53 {
54 fs=$WOK/$PACKAGE/taz/$PACKAGE-$VERSION/fs
56 source $src/env.sh
57 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
58 mkdir -p $fs/usr/bin $fs/usr/lib/virtualbox/components \
59 $fs/usr/share/virtualbox/nls \
60 $fs/usr/lib/virtualbox/ExtensionPacks
61 install -m 0755 VBox.sh $fs/usr/bin/VBox
62 sed -i 's/ps -U/ps | grep/' $fs/usr/bin/VBox
63 ln -sf VBox $fs/usr/bin/VBoxHeadless
64 ln -sf VBox $fs/usr/bin/vboxheadless
65 ln -sf VBox $fs/usr/bin/VBoxManage
66 ln -sf VBox $fs/usr/bin/vboxmanage
67 ln -sf VBox $fs/usr/bin/VBoxSDL
68 ln -sf VBox $fs/usr/bin/vboxsdl
69 ln -sf VBox $fs/usr/bin/VirtualBox
70 ln -sf VBox $fs/usr/bin/virtualbox
71 ln -sf VBox $fs/usr/bin/vboxwebsrv
73 install -m 0755 VBoxTunctl "$fs/usr/bin"
75 # components
76 install -D -m 0755 components/* $fs/usr/lib/virtualbox/components
78 # lib
79 install -m 0755 *.so "$fs/usr/lib/virtualbox"
80 install -m 0644 *.gc *.r0 VBoxEFI*.fd "$fs/usr/lib/virtualbox"
82 #setuid root binaries
83 install -m 4755 VBoxSDL VirtualBox VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl "$fs/usr/lib/virtualbox"
85 #other binaries
86 #install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL vboxwebsrv webtest "$fs/usr/lib/virtualbox"
87 install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL "$fs/usr/lib/virtualbox"
89 #language
90 install -m 0755 nls/*.qm "$fs/usr/share/virtualbox/nls"
92 #useless scripts
93 install -m 0755 VBoxCreateUSBNode.sh VBoxSysInfo.sh "$fs/usr/share/virtualbox"
95 #icon
96 install -D -m 0644 VBox.png "$fs/usr/share/pixmaps/virtualbox.png"
98 #desktop
99 install -D -m 0644 virtualbox.desktop "$fs/usr/share/applications/virtualbox.desktop"
100 sed -i "s|VBox.png|virtualbox|" \
101 $fs/usr/share/applications/virtualbox.desktop
102 install -D -m 0644 virtualbox.xml "$fs/usr/share/mime/packages/virtualbox.xml"
104 #install configuration
105 mkdir -p "$fs/etc/vbox"
106 echo 'lsmod | grep -q vboxdrv || modprobe vboxdrv' > "$fs/etc/vbox/vbox.cfg"
107 echo 'INSTALL_DIR=/usr/lib/virtualbox' >> "$fs/etc/vbox/vbox.cfg"
109 #udev
110 install -D -m 0644 "$stuff/60-virtualbox.rules" \
111 "$fs/etc/udev/rules.d/60-virtualbox.rules"
113 mkdir -p $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
114 cd sdk/installer
115 VBOX_INSTALL_PATH="/usr/lib/virtualbox" python vboxapisetup.py install --root "$fs"
116 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
117 cd sdk/bindings/xpcom/python
118 cp -r xpcom $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
119 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/*.py
120 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/server/*.py
121 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/client/*.py
122 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
124 # virtualbox-modules
125 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
127 #cooking installs module in linux major version dir
128 KERNEL_VERSION=${KERNEL_VERSION:0:3}
130 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
131 install -D -m644 vboxdrv.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxdrv.ko"
132 install -D -m644 vboxnetflt.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetflt.ko"
133 install -D -m644 vboxnetadp.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetadp.ko"
135 # virtualbox-ose-additions
137 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"
138 mkdir -p $fs/usr/bin
139 mkdir -p $fs/sbin
140 mkdir -p $fs/etc/X11/xorg.conf.d
142 install -m755 VBoxClient VBoxControl VBoxService "$fs/usr/bin"
143 install -m755 mount.vboxsf "$fs/sbin"
145 [ -f $src/src/VBox/Additions/x11/Installer/50-vboxmouse.conf ] &&
146 install -m644 $src/src/VBox/Additions/x11/Installer/50-vboxmouse.conf \
147 $fs/etc/X11/xorg.conf.d/50-vboxmouse.conf
149 install -m755 -D $src/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
150 $fs/usr/bin/VBoxClient-all
151 install -m755 -D $src/src/VBox/Additions/x11/Installer/vboxclient.desktop \
152 $fs/etc/xdg/autostart/vboxclient.desktop
154 #install -D vboxmouse_drv_19.so \
155 # "$fs/usr/lib/X11/modules/input/vboxmouse.so"
156 [ -f vboxvideo_drv_19.so ] &&
157 install -D vboxvideo_drv_19.so \
158 "$fs/usr/lib/X11/modules/drivers/vboxvideo.so"
159 install -d "$fs/usr/lib/dri"
160 install -m755 VBoxOGL*.so "$fs/usr/lib"
161 ln -s /usr/lib/VBoxOGL.so "$fs/usr/lib/dri/vboxvideo_dri.so"
162 install -m755 -D pam_vbox.so "$fs/lib/security/pam_vbox.so"
164 # virtualbox-ose-additions-modules
165 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
167 cd vboxguest
168 install -D -m644 vboxguest.ko \
169 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxguest.ko"
171 cd ../vboxsf
172 install -D -m644 vboxsf.ko \
173 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxsf.ko"
175 cd ../vboxvideo
176 install -D -m644 vboxvideo.ko \
177 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxvideo.ko"
179 install -D -m 0644 "$stuff/60-vboxguest.rules" \
180 "$fs/etc/udev/rules.d/60-vboxguest.rules"
181 }
183 pre_remove()
184 {
185 sed -i "s/vboxdrv vboxnetadp vboxnetflt //" $1/etc/rcS.conf
186 }
188 post_install()
189 {
190 KERNEL_VERSION=`grep ^VERSION= $1/var/lib/tazpkg/installed/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
192 #cooking installs module in linux major version dir
193 KERNEL_VERSION=${KERNEL_VERSION:0:3}
195 chroot "$1/" depmod -a $KERNEL_VERSION-slitaz
196 grep -qs vboxdrv $1/etc/rcS.conf ||
197 sed -i 's/LOAD_MODULES="/&vboxdrv vboxnetadp vboxnetflt /' $1/etc/rcS.conf
198 }