wok view virtualbox-ose/receipt @ rev 20212
Force host arch to i486
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 24 12:51:10 2018 +0100 (2018-02-24) |
parents | 9e01bc6321ea |
children | 238f49914432 |
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 LICENSE="GPL2"
9 SOURCE="VirtualBox"
10 TARBALL="$SOURCE-$VERSION.tar.bz2"
11 WEB_SITE="https://www.virtualbox.org/"
12 WGET_URL="http://download.virtualbox.org/virtualbox/$VERSION/$TARBALL"
13 TAGS="virtualization"
14 PROVIDE="virtualbox"
16 DEPENDS="libxml2 xorg-libXcursor libIDL xorg-libXinerama libsdl \
17 xorg-libXmu curl libvncserver libpng jpeg mesa libglu-mesa vde2 \
18 python libQtCore libQtGui libQtNetwork libQtOpenGL"
19 BUILD_DEPENDS="bin86 dev86 iasl libIDL libsdl-dev mesa-dev libxslt-dev \
20 libglu-mesa-dev Qt4-dev libsdl-ttf-dev alsa-lib-dev hal-dev xorg-libXtst-dev \
21 xorg-libXrandr-dev python python-dev xalan-c curl-dev xalan-c-dev \
22 xerces-c-dev openssl-dev zlib-dev libcap-dev glib-dev libvncserver-dev \
23 pam pam-dev bzip2 linux-module-headers pkg-config tar wget vde2-dev \
24 libpng-dev gsoap-dev libdevmapper-dev makeself cdrkit flex"
26 # Rules to configure and make the package.
27 compile_rules()
28 {
29 find $src -name '*akefile*' \; | xargs sed -i 's|uname -m|echo i486|'
30 cp $stuff/LocalConfig.kmk .
31 ./configure \
32 --disable-pulse \
33 --disable-java \
34 --disable-docs \
35 --enable-webservice \
36 --enable-vde \
37 --with-linux=/usr/src/linux
38 source ./env.sh
39 kmk all 2>&1 | grep -v 'kmk: No such'
41 # build modules.
42 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
43 # build guest additions modules
44 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
45 }
47 # Rules to gen a SliTaz package suitable for Tazpkg.
48 genpkg_rules()
49 {
50 source $src/env.sh
51 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
52 mkdir -p $fs/usr/bin $fs/usr/lib/virtualbox/components \
53 $fs/usr/share/virtualbox/nls \
54 $fs/usr/lib/virtualbox/ExtensionPacks
55 install -m 0755 VBox.sh $fs/usr/bin/VBox
56 sed -i 's/ps -U/ps | grep/' $fs/usr/bin/VBox
57 ln -sf VBox $fs/usr/bin/VBoxHeadless
58 ln -sf VBox $fs/usr/bin/vboxheadless
59 ln -sf VBox $fs/usr/bin/VBoxManage
60 ln -sf VBox $fs/usr/bin/vboxmanage
61 ln -sf VBox $fs/usr/bin/VBoxSDL
62 ln -sf VBox $fs/usr/bin/vboxsdl
63 ln -sf VBox $fs/usr/bin/VirtualBox
64 ln -sf VBox $fs/usr/bin/virtualbox
65 ln -sf VBox $fs/usr/bin/vboxwebsrv
67 install -m 0755 VBoxTunctl "$fs/usr/bin"
69 # components
70 install -D -m 0755 components/* $fs/usr/lib/virtualbox/components
72 # lib
73 install -m 0755 *.so "$fs/usr/lib/virtualbox"
74 install -m 0644 *.gc *.r0 VBoxEFI*.fd "$fs/usr/lib/virtualbox"
76 #setuid root binaries
77 install -m 4755 VBoxSDL VirtualBox VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl "$fs/usr/lib/virtualbox"
79 #other binaries
80 #install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL vboxwebsrv webtest "$fs/usr/lib/virtualbox"
81 install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL "$fs/usr/lib/virtualbox"
83 #language
84 install -m 0755 nls/*.qm "$fs/usr/share/virtualbox/nls"
86 #useless scripts
87 install -m 0755 VBoxCreateUSBNode.sh VBoxSysInfo.sh "$fs/usr/share/virtualbox"
89 #icon
90 install -D -m 0644 VBox.png "$fs/usr/share/pixmaps/virtualbox.png"
92 #desktop
93 install -D -m 0644 virtualbox.desktop "$fs/usr/share/applications/virtualbox.desktop"
94 sed -i "s|VBox.png|virtualbox|" \
95 $fs/usr/share/applications/virtualbox.desktop
97 #install configuration
98 mkdir -p "$fs/etc/vbox"
99 echo 'lsmod | grep -q vboxdrv || modprobe vboxdrv' > "$fs/etc/vbox/vbox.cfg"
100 echo 'INSTALL_DIR=/usr/lib/virtualbox' >> "$fs/etc/vbox/vbox.cfg"
102 #udev
103 install -D -m 0644 "$stuff/10-vboxdrv.rules" \
104 "$fs/etc/udev/rules.d/10-vboxdrv.rules"
106 mkdir -p $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
107 cd sdk/installer
108 VBOX_INSTALL_PATH="/usr/lib/virtualbox" python vboxapisetup.py install --root "$fs"
109 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
110 cd sdk/bindings/xpcom/python
111 cp -r xpcom $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
112 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/*.py
113 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/server/*.py
114 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/client/*.py
115 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
117 # virtualbox-ose-modules
118 KERNEL_VERSION=$(grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g')
120 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
121 install -D -m644 vboxdrv.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxdrv.ko"
122 install -D -m644 vboxnetflt.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetflt.ko"
123 install -D -m644 vboxnetadp.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetadp.ko"
124 }
126 pre_remove()
127 {
128 sed -i "s/vboxdrv vboxnetadp vboxnetflt //" "$1/etc/rcS.conf"
129 chroot "$1/" delgroup vboxusers
130 }
132 post_install()
133 {
134 #chroot "$1/" udevadm control --reload
135 KERNEL_VERSION=$( chroot "$1/" uname -r)
136 chroot "$1/" depmod -a $KERNEL_VERSION
137 chroot "$1/" modprobe -a vboxdrv vboxnetadp vboxnetflt
138 grep -qs vboxdrv "$1/etc/rcS.conf" ||
139 sed -i 's/LOAD_MODULES="/&vboxdrv vboxnetadp vboxnetflt /' "$1/etc/rcS.conf"
140 grep -qs vboxuser "$1/etc/group" || chroot "$1/" addgroup -g 199 vboxusers
141 echo "add yourself to vboxusers group if you want to access"
142 echo "host usb devices: addgroup $USER vboxusers"
143 #i can't get udev to do its work
144 #echo "then logout and login again"
145 echo "then reboot"
146 }