wok-next view virtualbox-ose/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents d43bf7aae921
children 5669e8b3be70
line source
1 # SliTaz package receipt v2.
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 \
7 (Open Source Edition)"
8 MAINTAINER="devel@slitaz.org"
9 LICENSE="GPL2"
10 WEB_SITE="https://www.virtualbox.org/"
12 TARBALL="VirtualBox-$VERSION.tar.bz2"
13 WGET_URL="http://download.virtualbox.org/virtualbox/$VERSION/$TARBALL"
15 BUILD_DEPENDS="bin86 dev86 iasl libIDL libsdl-dev mesa-dev libxslt-dev \
16 glu-dev Qt4-dev libsdl-ttf-dev alsa-lib-dev hal-dev xorg-libXtst-dev \
17 xorg-libXrandr-dev python python-dev xalan-c curl-dev xalan-c-dev \
18 xerces-c-dev openssl-dev zlib-dev libcap-dev glib-dev libvncserver-dev \
19 pam pam-dev bzip2 linux-module-headers tar vde2-dev \
20 libpng16-dev gsoap-dev libdevmapper-dev makeself cdrkit flex"
21 SPLIT="$PACKAGE-guestutils"
23 compile_rules() {
24 cp $stuff/LocalConfig.kmk .
25 ./configure \
26 --disable-pulse \
27 --disable-java \
28 --disable-docs \
29 --enable-webservice \
30 --enable-vde \
31 --with-linux=/usr/src/linux
32 source ./env.sh
33 kmk all 2>&1 | grep -v 'kmk: No such'
35 # build modules.
36 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
37 # build guest additions modules
38 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
39 }
41 genpkg_rules() {
42 case $PACKAGE in
43 virtualbox-ose)
44 source $src/env.sh
45 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
46 mkdir -p $fs/usr/bin $fs/usr/lib/virtualbox/components \
47 $fs/usr/share/virtualbox/nls \
48 $fs/usr/lib/virtualbox/ExtensionPacks
49 install -m 0755 VBox.sh $fs/usr/bin/VBox
50 sed -i 's/ps -U/ps | grep/' $fs/usr/bin/VBox
51 ln -sf VBox $fs/usr/bin/VBoxHeadless
52 ln -sf VBox $fs/usr/bin/vboxheadless
53 ln -sf VBox $fs/usr/bin/VBoxManage
54 ln -sf VBox $fs/usr/bin/vboxmanage
55 ln -sf VBox $fs/usr/bin/VBoxSDL
56 ln -sf VBox $fs/usr/bin/vboxsdl
57 ln -sf VBox $fs/usr/bin/VirtualBox
58 ln -sf VBox $fs/usr/bin/virtualbox
59 ln -sf VBox $fs/usr/bin/vboxwebsrv
61 install -m 0755 VBoxTunctl "$fs/usr/bin"
63 # components
64 install -D -m 0755 components/* $fs/usr/lib/virtualbox/components
66 # lib
67 install -m 0755 *.so "$fs/usr/lib/virtualbox"
68 install -m 0644 *.gc *.r0 VBoxEFI*.fd "$fs/usr/lib/virtualbox"
70 #setuid root binaries
71 install -m 4755 VBoxSDL VirtualBox VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl "$fs/usr/lib/virtualbox"
73 #other binaries
74 #install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL vboxwebsrv webtest "$fs/usr/lib/virtualbox"
75 install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL "$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/virtualbox.png"
86 #desktop
87 install -D -m 0644 virtualbox.desktop "$fs/usr/share/applications/virtualbox.desktop"
88 sed -i "s|VBox.png|virtualbox|" \
89 $fs/usr/share/applications/virtualbox.desktop
91 #install configuration
92 mkdir -p "$fs/etc/vbox"
93 echo 'lsmod | grep -q vboxdrv || modprobe vboxdrv' > "$fs/etc/vbox/vbox.cfg"
94 echo 'INSTALL_DIR=/usr/lib/virtualbox' >> "$fs/etc/vbox/vbox.cfg"
96 #udev
97 install -D -m 0644 "$stuff/10-vboxdrv.rules" \
98 "$fs/etc/udev/rules.d/10-vboxdrv.rules"
100 mkdir -p $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
101 cd sdk/installer
102 VBOX_INSTALL_PATH="/usr/lib/virtualbox" python vboxapisetup.py install --root "$fs"
103 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
104 cd sdk/bindings/xpcom/python
105 cp -r xpcom $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
106 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/*.py
107 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/server/*.py
108 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/client/*.py
109 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
111 # virtualbox-ose-modules
112 KERNEL_VERSION=$(grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g')
114 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
115 install -D -m644 vboxdrv.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxdrv.ko"
116 install -D -m644 vboxnetflt.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetflt.ko"
117 install -D -m644 vboxnetadp.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetadp.ko"
118 DEPENDS="libxml2 xorg-libXcursor libIDL xorg-libXinerama libsdl \
119 xorg-libXmu curl libvncserver libpng16 jpeg mesa glu vde2 \
120 python libQtCore libQtGui libQtNetwork libQtOpenGL"
121 TAGS="virtualization"
122 PROVIDE="virtualbox"
123 ;;
124 virtualbox-ose-guestutils)
125 # virtualbox-ose-additions
126 source $src/env.sh
127 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"
128 mkdir -p $fs/usr/bin
129 mkdir -p $fs/sbin
130 mkdir -p $fs/etc/X11/xorg.conf.d
131 mkdir -p $fs/etc/init.d
133 install -m755 VBoxClient VBoxControl VBoxService "$fs/usr/bin"
134 install -m755 mount.vboxsf "$fs/sbin"
136 install -m755 -D $src/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
137 $fs/usr/bin/VBoxClient-all
138 install -m755 -D $src/src/VBox/Additions/x11/Installer/vboxclient.desktop \
139 $fs/etc/xdg/autostart/vboxclient.desktop
141 install -D vboxvideo_drv_112.so \
142 "$fs/usr/lib/X11/modules/drivers/vboxvideo.so"
143 install -d "$fs/usr/lib/dri"
144 install -m755 VBoxOGL*.so "$fs/usr/lib"
145 ln -s /usr/lib/VBoxOGL.so "$fs/usr/lib/dri/vboxvideo_dri.so"
146 install -m755 -D pam_vbox.so "$fs/lib/security/pam_vbox.so"
148 # virtualbox-ose-additions-modules
149 KERNEL_VERSION=$(grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g')
151 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
153 cd vboxguest
154 install -D -m644 vboxguest.ko \
155 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxguest.ko"
157 cd ../vboxsf
158 install -D -m644 vboxsf.ko \
159 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxsf.ko"
161 cd ../vboxvideo
162 install -D -m644 vboxvideo.ko \
163 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxvideo.ko"
165 install -D -m 0644 "$stuff/60-vboxguest.rules" \
166 "$fs/etc/udev/rules.d/60-vboxguest.rules"
168 install -D -m 0755 "$stuff/VBoxService" \
169 "$fs/etc/init.d/VBoxService"
170 CAT="misc|VirtualBox Guest userspace utilities, useful for running Slitaz inside a virtual machine"
171 DEPENDS="xorg-libXfixes xorg-libXmu xorg-xrandr"
172 TAGS="virtualization"
173 ;;
174 esac
175 }
177 pre_remove_virtualbox_ose() {
178 sed -i "s/vboxdrv vboxnetadp vboxnetflt //" "$1/etc/rcS.conf"
179 chroot "$1/" delgroup vboxusers
180 }
182 post_install_virtualbox_ose() {
183 #chroot "$1/" udevadm control --reload
184 KERNEL_VERSION=$( chroot "$1/" uname -r)
185 chroot "$1/" depmod -a $KERNEL_VERSION
186 chroot "$1/" modprobe -a vboxdrv vboxnetadp vboxnetflt
187 grep -qs vboxdrv "$1/etc/rcS.conf" ||
188 sed -i 's/LOAD_MODULES="/&vboxdrv vboxnetadp vboxnetflt /' "$1/etc/rcS.conf"
189 grep -qs vboxuser "$1/etc/group" || chroot "$1/" addgroup -g 199 vboxusers
190 echo "add yourself to vboxusers group if you want to access"
191 echo "host usb devices: addgroup $USER vboxusers"
192 #i can't get udev to do its work
193 #echo "then logout and login again"
194 echo "then reboot"
195 }
197 pre_remove_virtualbox_ose_guestutils() {
198 if chroot "$1/" lspci | grep -qi virtualbox; then
199 sed -i "s/vboxguest vboxsf vboxvideo //" "$1/etc/rcS.conf"
200 sed -i '/# VBoxService daemon options./{N;N;N;d}' "$1/etc/daemons.conf"
201 sed -i 's/VBoxService //' "$1/etc/rcS.conf"
202 chroot "$1/" delgroup vboxsf
203 sed -i 's/^\tDriver.*$/\tDriver "vesa"/' "$1/etc/X11/xorg.conf.d/60-Device.conf"
204 fi
205 }
207 post_install_virtualbox_ose_guestutils() {
208 if chroot "$1/" lspci | grep -qi virtualbox; then
209 #chroot "$1/" udevadm control --reload
210 grep -qs VBOXSERVICE_OPTIONS "$1/etc/daemons.conf" ||
211 cat >> "$1/etc/daemons.conf" <<"EOT"
212 # VBoxService daemon options.
213 VBOXSERVICE_OPTIONS=""
215 EOT
216 KERNEL_VERSION=$( chroot "$1/" uname -r)
217 chroot "$1/" depmod -a $KERNEL_VERSION
218 #chroot "$1/" modprobe -a vboxguest vboxsf vboxvideo
219 sed -i 's/^\tDriver.*$/\tDriver "vboxvideo"/' "$1/etc/X11/xorg.conf.d/60-Device.conf"
220 grep -qs vboxguest "$1/etc/rcS.conf" ||
221 sed -i 's/LOAD_MODULES="/&vboxguest vboxsf vboxvideo /' "$1/etc/rcS.conf"
222 grep -qs VBoxService "$1/etc/rcS.conf" ||
223 sed -i 's/RUN_DAEMONS="/&VBoxService /' "$1/etc/rcS.conf"
224 grep -qs vboxsf "$1/etc/group" ||
225 chroot "$1/" addgroup -g 109 vboxsf
226 echo "add yourself to vboxsf group if you want to access"
227 echo "host shared folder: addgroup $USER vboxsf"
228 #i can't get udev to do its work
229 #echo "then logout and login again"
230 #chroot "$1/" /etc/init.d/VBoxService start &> /dev/null
231 echo "then reboot"
232 else
233 echo "this is not a virtual machine,"
234 echo "i'm useless here and you probably"
235 echo "may want to remove me."
236 fi
237 }