wok-6.x view virtualbox-ose-guestutils/receipt @ rev 16678

Add virtual packages Qt4, libcairo-compmgr, libpurple
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri May 16 09:47:35 2014 +0000 (2014-05-16)
parents 7896f0694ef6
children 38ec9a00ec36
line source
1 # SliTaz package receipt.
3 PACKAGE="virtualbox-ose-guestutils"
4 VERSION="4.2.6"
5 CATEGORY="misc"
6 SHORT_DESC="VirtualBox Guest userspace utilities, useful for running Slitaz inside a virtual machine"
7 MAINTAINER="slaxemulator@gmail.com"
8 LICENSE="GPL2"
9 WANTED="virtualbox-ose"
10 WEB_SITE="https://www.virtualbox.org/"
11 TAGS="virtualization"
13 DEPENDS="xorg-libXfixes xorg-libXmu xorg-xrandr"
14 BUILD_DEPENDS=""
16 # Rules to gen a SliTaz package suitable for Tazpkg.
17 genpkg_rules()
18 {
19 # virtualbox-ose-additions
20 source $src/env.sh
21 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"
22 mkdir -p $fs/usr/bin
23 mkdir -p $fs/sbin
24 mkdir -p $fs/etc/X11/xorg.conf.d
25 mkdir -p $fs/etc/init.d
27 install -m755 VBoxClient VBoxControl VBoxService "$fs/usr/bin"
28 install -m755 mount.vboxsf "$fs/sbin"
30 install -m755 -D $src/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
31 $fs/usr/bin/VBoxClient-all
32 install -m755 -D $src/src/VBox/Additions/x11/Installer/vboxclient.desktop \
33 $fs/etc/xdg/autostart/vboxclient.desktop
35 install -D vboxvideo_drv_112.so \
36 "$fs/usr/lib/X11/modules/drivers/vboxvideo.so"
37 install -d "$fs/usr/lib/dri"
38 install -m755 VBoxOGL*.so "$fs/usr/lib"
39 ln -s /usr/lib/VBoxOGL.so "$fs/usr/lib/dri/vboxvideo_dri.so"
40 install -m755 -D pam_vbox.so "$fs/lib/security/pam_vbox.so"
42 # virtualbox-ose-additions-modules
43 KERNEL_VERSION=$(grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g')
44 #cooking installs modules in linux major version dir
45 KBASEVER="${KERNEL_VERSION:0:3}"
47 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
49 cd vboxguest
50 install -D -m644 vboxguest.ko \
51 "$fs/lib/modules/$KBASEVER-slitaz/misc/vboxguest.ko"
53 cd ../vboxsf
54 install -D -m644 vboxsf.ko \
55 "$fs/lib/modules/$KBASEVER-slitaz/misc/vboxsf.ko"
57 cd ../vboxvideo
58 install -D -m644 vboxvideo.ko \
59 "$fs/lib/modules/$KBASEVER-slitaz/misc/vboxvideo.ko"
61 install -D -m 0644 "$stuff/60-vboxguest.rules" \
62 "$fs/etc/udev/rules.d/60-vboxguest.rules"
64 install -D -m 0755 "$stuff/VBoxService" \
65 "$fs/etc/init.d/VBoxService"
66 }
68 pre_remove()
69 {
70 if chroot $1/ lspci | grep -qi virtualbox; then
71 sed -i "s/vboxguest vboxsf vboxvideo //" $1/etc/rcS.conf
72 sed -i '/# VBoxService daemon options./{N;N;N;d}' $1/etc/daemons.conf
73 sed -i 's/VBoxService //' $1/etc/rcS.conf
74 chroot $1/ delgroup vboxsf
75 sed -i 's/^\tDriver.*$/\tDriver "vesa"/' $1/etc/X11/xorg.conf.d/60-Device.conf
76 fi
77 }
79 post_install()
80 {
81 if chroot $1/ lspci | grep -qi virtualbox; then
82 #chroot $1/ udevadm control --reload
83 grep -qs VBOXSERVICE_OPTIONS $1/etc/daemons.conf ||
84 cat >> $1/etc/daemons.conf << "EOT"
85 # VBoxService daemon options.
86 VBOXSERVICE_OPTIONS=""
88 EOT
89 KERNEL_VERSION=$( chroot $1/ uname -r)
90 chroot $1/ depmod -a $KERNEL_VERSION
91 #chroot $1/ modprobe -a vboxguest vboxsf vboxvideo
92 sed -i 's/^\tDriver.*$/\tDriver "vboxvideo"/' $1/etc/X11/xorg.conf.d/60-Device.conf
93 grep -qs vboxguest $1/etc/rcS.conf ||
94 sed -i 's/LOAD_MODULES="/&vboxguest vboxsf vboxvideo /' $1/etc/rcS.conf
95 grep -qs VBoxService $1/etc/rcS.conf ||
96 sed -i 's/RUN_DAEMONS="/&VBoxService /' $1/etc/rcS.conf
97 grep -qs vboxsf $1/etc/group || chroot $1/ addgroup -g 109 vboxsf
98 echo "add yourself to vboxsf group if you want to access"
99 echo "host shared folder: addgroup $USER vboxsf"
100 #i can't get udev to do its work
101 #echo "then logout and login again"
102 #chroot $1/ /etc/init.d/VBoxService start &> /dev/null
103 echo "then reboot"
104 else
105 echo "this is not a virtual machine,"
106 echo "i'm useless here and you probably"
107 echo "may want to remove me."
108 fi
109 }