wok-current view virtualbox-ose/receipt @ rev 9459

Add dega. A command line emulator for Sega Master System and Game Gear.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun Apr 03 08:21:15 2011 +0000 (2011-04-03)
parents c936c5bbb192
children d9ece80135d3
line source
1 # SliTaz package receipt.
3 PACKAGE="virtualbox-ose"
4 VERSION="4.0.4"
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 DEPENDS="libxml2 xorg-libXcursor libIDL xorg-libXinerama libsdl xorg-libXmu curl libvncserver libpng jpeg mesa libglu-mesa qt4 vde2"
9 BUILD_DEPENDS="bin86 dev86 iasl libxslt-dev Qt4-dev libsdl-ttf-dev alsa-lib-dev hal-dev xorg-libXtst-dev xorg-libXrandr-dev python python-dev xalan-c xalan-c-dev xerces-c-dev openssl-dev zlib-dev libcap-dev glib-dev pam pam-dev bzip2 linux-module-headers pkg-config tar wget"
10 SOURCE="VirtualBox"
11 TARBALL="$SOURCE-$VERSION.tar.bz2"
12 WEB_SITE="http://virtualbox.org/"
13 WGET_URL="http://download.virtualbox.org/virtualbox/$VERSION/$TARBALL"
14 PROVIDE="virtualbox"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 cd $src
20 patch -Np1 -i "$stuff/virtualbox-4-makeself-check.patch"
21 patch -Np1 -i "$stuff/virtualbox-4-mkisofs-check.patch"
22 cp $stuff/LocalConfig.kmk .
23 ./configure \
24 --disable-pulse \
25 --disable-java \
26 --disable-docs \
27 --enable-webservice \
28 --enable-vde \
29 --with-linux=/usr/src/linux
30 source ./env.sh
31 kmk all
33 # build modules
34 cd
35 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
36 # build guest additions modules
37 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
38 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src/vboxvideo"
39 }
41 # Rules to gen a SliTaz package suitable for Tazpkg.
42 genpkg_rules()
43 {
44 fs=$WOK/$PACKAGE/taz/$PACKAGE-$VERSION/fs
46 source $src/env.sh
47 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
48 mkdir -p $fs/usr/bin $fs/usr/lib/virtualbox/components \
49 $fs/usr/share/virtualbox/nls \
50 $fs/usr/lib/virtualbox/ExtensionPacks
51 install -m 0755 VBox.sh $fs/usr/bin/VBox
52 sed -i 's/ps -U/ps | grep/' $fs/usr/bin/VBox
53 ln -sf VBox $fs/usr/bin/VBoxHeadless
54 ln -sf VBox $fs/usr/bin/vboxheadless
55 ln -sf VBox $fs/usr/bin/VBoxManage
56 ln -sf VBox $fs/usr/bin/vboxmanage
57 ln -sf VBox $fs/usr/bin/VBoxSDL
58 ln -sf VBox $fs/usr/bin/vboxsdl
59 ln -sf VBox $fs/usr/bin/VirtualBox
60 ln -sf VBox $fs/usr/bin/virtualbox
61 ln -sf VBox $fs/usr/bin/vboxwebsrv
63 install -m 0755 VBoxTunctl "$fs/usr/bin"
65 # components
66 install -D -m 0755 components/* $fs/usr/lib/virtualbox/components
68 # lib
69 install -m 0755 *.so "$fs/usr/lib/virtualbox"
70 install -m 0644 *.gc *.r0 VBoxEFI*.fd "$fs/usr/lib/virtualbox"
72 #setuid root binaries
73 install -m 4755 VBoxSDL VirtualBox VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl "$fs/usr/lib/virtualbox"
75 #other binaries
76 #install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL vboxwebsrv webtest "$fs/usr/lib/virtualbox"
77 install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL "$fs/usr/lib/virtualbox"
79 #language
80 install -m 0755 nls/*.qm "$fs/usr/share/virtualbox/nls"
82 #useless scripts
83 install -m 0755 VBoxCreateUSBNode.sh VBoxSysInfo.sh "$fs/usr/share/virtualbox"
85 #icon
86 install -D -m 0644 VBox.png "$fs/usr/share/pixmaps/VBox.png"
88 #desktop
89 install -D -m 0644 virtualbox.desktop "$fs/usr/share/applications/virtualbox.desktop"
90 install -D -m 0644 virtualbox.xml "$fs/usr/share/mime/packages/virtualbox.xml"
92 #install configuration
93 mkdir -p "$fs/etc/vbox"
94 echo 'lsmod | grep -q vboxdrv || modprobe vboxdrv' > "$fs/etc/vbox/vbox.cfg"
95 echo 'INSTALL_DIR=/usr/lib/virtualbox' >> "$fs/etc/vbox/vbox.cfg"
97 #udev
98 install -D -m 0644 "$stuff/60-virtualbox.rules" \
99 "$fs/etc/udev/rules.d/60-virtualbox.rules"
101 mkdir -p $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
102 cd sdk/installer
103 VBOX_INSTALL_PATH="/usr/lib/virtualbox" python vboxapisetup.py install --root "$fs"
104 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
105 cd sdk/bindings/xpcom/python
106 cp -r xpcom $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
107 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/*.py
108 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/server/*.py
109 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/client/*.py
110 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
112 # virtualbox-modules
113 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
115 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
116 install -D -m644 vboxdrv.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxdrv.ko"
117 install -D -m644 vboxnetflt.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetflt.ko"
118 install -D -m644 vboxnetadp.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetadp.ko"
120 # virtualbox-ose-additions
122 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"
123 mkdir -p $fs/usr/bin
124 mkdir -p $fs/sbin
125 mkdir -p $fs/etc/X11/xorg.conf.d
127 install -m755 VBoxClient VBoxControl VBoxService "$fs/usr/bin"
128 install -m755 mount.vboxsf "$fs/sbin"
130 install -m644 $src/src/VBox/Additions/x11/Installer/50-vboxmouse.conf \
131 $fs/etc/X11/xorg.conf.d/50-vboxmouse.conf
133 install -m755 -D $src/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
134 $fs/usr/bin/VBoxClient-all
135 install -m755 -D $src/src/VBox/Additions/x11/Installer/vboxclient.desktop \
136 $fs/etc/xdg/autostart/vboxclient.desktop
138 install -D vboxmouse_drv_19.so \
139 "$fs/usr/lib/X11/modules/input/vboxmouse.so"
140 install -D vboxvideo_drv_19.so \
141 "$fs/usr/lib/X11/modules/drivers/vboxvideo.so"
142 install -d "$fs/usr/lib/dri"
143 install -m755 VBoxOGL*.so "$fs/usr/lib"
144 ln -s /usr/lib/VBoxOGL.so "$fs/usr/lib/dri/vboxvideo_dri.so"
145 install -m755 -D pam_vbox.so "$fs/lib/security/pam_vbox.so"
147 # virtualbox-ose-additions-modules
148 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
150 cd vboxguest
151 install -D -m644 vboxguest.ko \
152 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxguest.ko"
154 cd ../vboxsf
155 install -D -m644 vboxsf.ko \
156 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxsf.ko"
158 cd ../vboxvideo
159 install -D -m644 vboxvideo.ko \
160 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxvideo.ko"
162 install -D -m 0644 "$stuff/60-vboxguest.rules" \
163 "$fs/etc/udev/rules.d/60-vboxguest.rules"
164 }
166 pre_remove()
167 {
168 sed -i "s/vboxdrv vboxnetadp vboxnetflt //" $1/etc/rcS.conf
169 }
171 post_install()
172 {
173 KERNEL_VERSION=`grep ^VERSION= $1/var/lib/tazpkg/installed/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
175 chroot "$1/" depmod -a $KERNEL_VERSION-slitaz
176 grep -qs vboxdrv $1/etc/rcS.conf ||
177 sed -i 's/LOAD_MODULES="/&vboxdrv vboxnetadp vboxnetflt /' $1/etc/rcS.conf
178 }