wok-next annotate virtualbox-ose/receipt @ rev 21149

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