wok-6.x view virtualbox-ose/receipt @ rev 9912
slitaz-icon: sed only if file exist
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue May 17 18:16:21 2011 +0200 (2011-05-17) |
parents | 4c56a51375d9 |
children | 389d9bbce69f |
line source
1 # SliTaz package receipt.
3 PACKAGE="virtualbox-ose"
4 VERSION="4.0.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 SOURCE="VirtualBox"
9 TARBALL="$SOURCE-$VERSION.tar.bz2"
10 WEB_SITE="http://virtualbox.org/"
11 WGET_URL="http://download.virtualbox.org/virtualbox/$VERSION/$TARBALL"
12 PROVIDE="virtualbox"
14 DEPENDS="libxml2 xorg-libXcursor libIDL xorg-libXinerama libsdl \
15 xorg-libXmu curl libvncserver libpng jpeg mesa libglu-mesa qt4 vde2"
16 BUILD_DEPENDS="bin86 dev86 iasl libxslt-dev Qt4-dev libsdl-ttf-dev \
17 alsa-lib-dev hal-dev xorg-libXtst-dev xorg-libXrandr-dev python \
18 python-dev xalan-c curl-dev xalan-c-dev xerces-c-dev openssl-dev zlib-dev \
19 libcap-dev glib-dev pam pam-dev bzip2 linux-module-headers \
20 pkg-config tar wget"
22 # Rules to configure and make the package.
23 compile_rules()
24 {
25 cd $src
26 patch -Np1 -i "$stuff/virtualbox-4-makeself-check.patch"
27 patch -Np1 -i "$stuff/virtualbox-4-mkisofs-check.patch"
28 cp $stuff/LocalConfig.kmk .
29 ./configure \
30 --disable-pulse \
31 --disable-java \
32 --disable-docs \
33 --enable-webservice \
34 --enable-vde \
35 --with-linux=/usr/src/linux
36 source ./env.sh
37 kmk all
39 # build modules
40 cd
41 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
42 # build guest additions modules
43 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
44 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src/vboxvideo"
45 }
47 # Rules to gen a SliTaz package suitable for Tazpkg.
48 genpkg_rules()
49 {
50 fs=$WOK/$PACKAGE/taz/$PACKAGE-$VERSION/fs
52 source $src/env.sh
53 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
54 mkdir -p $fs/usr/bin $fs/usr/lib/virtualbox/components \
55 $fs/usr/share/virtualbox/nls \
56 $fs/usr/lib/virtualbox/ExtensionPacks
57 install -m 0755 VBox.sh $fs/usr/bin/VBox
58 sed -i 's/ps -U/ps | grep/' $fs/usr/bin/VBox
59 ln -sf VBox $fs/usr/bin/VBoxHeadless
60 ln -sf VBox $fs/usr/bin/vboxheadless
61 ln -sf VBox $fs/usr/bin/VBoxManage
62 ln -sf VBox $fs/usr/bin/vboxmanage
63 ln -sf VBox $fs/usr/bin/VBoxSDL
64 ln -sf VBox $fs/usr/bin/vboxsdl
65 ln -sf VBox $fs/usr/bin/VirtualBox
66 ln -sf VBox $fs/usr/bin/virtualbox
67 ln -sf VBox $fs/usr/bin/vboxwebsrv
69 install -m 0755 VBoxTunctl "$fs/usr/bin"
71 # components
72 install -D -m 0755 components/* $fs/usr/lib/virtualbox/components
74 # lib
75 install -m 0755 *.so "$fs/usr/lib/virtualbox"
76 install -m 0644 *.gc *.r0 VBoxEFI*.fd "$fs/usr/lib/virtualbox"
78 #setuid root binaries
79 install -m 4755 VBoxSDL VirtualBox VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl "$fs/usr/lib/virtualbox"
81 #other binaries
82 #install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL vboxwebsrv webtest "$fs/usr/lib/virtualbox"
83 install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL "$fs/usr/lib/virtualbox"
85 #language
86 install -m 0755 nls/*.qm "$fs/usr/share/virtualbox/nls"
88 #useless scripts
89 install -m 0755 VBoxCreateUSBNode.sh VBoxSysInfo.sh "$fs/usr/share/virtualbox"
91 #icon
92 install -D -m 0644 VBox.png "$fs/usr/share/pixmaps/VBox.png"
94 #desktop
95 install -D -m 0644 virtualbox.desktop "$fs/usr/share/applications/virtualbox.desktop"
96 install -D -m 0644 virtualbox.xml "$fs/usr/share/mime/packages/virtualbox.xml"
98 #install configuration
99 mkdir -p "$fs/etc/vbox"
100 echo 'lsmod | grep -q vboxdrv || modprobe vboxdrv' > "$fs/etc/vbox/vbox.cfg"
101 echo 'INSTALL_DIR=/usr/lib/virtualbox' >> "$fs/etc/vbox/vbox.cfg"
103 #udev
104 install -D -m 0644 "$stuff/60-virtualbox.rules" \
105 "$fs/etc/udev/rules.d/60-virtualbox.rules"
107 mkdir -p $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
108 cd sdk/installer
109 VBOX_INSTALL_PATH="/usr/lib/virtualbox" python vboxapisetup.py install --root "$fs"
110 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
111 cd sdk/bindings/xpcom/python
112 cp -r xpcom $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
113 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/*.py
114 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/server/*.py
115 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/client/*.py
116 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
118 # virtualbox-modules
119 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
121 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
122 install -D -m644 vboxdrv.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxdrv.ko"
123 install -D -m644 vboxnetflt.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetflt.ko"
124 install -D -m644 vboxnetadp.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetadp.ko"
126 # virtualbox-ose-additions
128 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"
129 mkdir -p $fs/usr/bin
130 mkdir -p $fs/sbin
131 mkdir -p $fs/etc/X11/xorg.conf.d
133 install -m755 VBoxClient VBoxControl VBoxService "$fs/usr/bin"
134 install -m755 mount.vboxsf "$fs/sbin"
136 install -m644 $src/src/VBox/Additions/x11/Installer/50-vboxmouse.conf \
137 $fs/etc/X11/xorg.conf.d/50-vboxmouse.conf
139 install -m755 -D $src/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
140 $fs/usr/bin/VBoxClient-all
141 install -m755 -D $src/src/VBox/Additions/x11/Installer/vboxclient.desktop \
142 $fs/etc/xdg/autostart/vboxclient.desktop
144 install -D vboxmouse_drv_19.so \
145 "$fs/usr/lib/X11/modules/input/vboxmouse.so"
146 install -D vboxvideo_drv_19.so \
147 "$fs/usr/lib/X11/modules/drivers/vboxvideo.so"
148 install -d "$fs/usr/lib/dri"
149 install -m755 VBoxOGL*.so "$fs/usr/lib"
150 ln -s /usr/lib/VBoxOGL.so "$fs/usr/lib/dri/vboxvideo_dri.so"
151 install -m755 -D pam_vbox.so "$fs/lib/security/pam_vbox.so"
153 # virtualbox-ose-additions-modules
154 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
156 cd vboxguest
157 install -D -m644 vboxguest.ko \
158 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxguest.ko"
160 cd ../vboxsf
161 install -D -m644 vboxsf.ko \
162 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxsf.ko"
164 cd ../vboxvideo
165 install -D -m644 vboxvideo.ko \
166 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxvideo.ko"
168 install -D -m 0644 "$stuff/60-vboxguest.rules" \
169 "$fs/etc/udev/rules.d/60-vboxguest.rules"
170 }
172 pre_remove()
173 {
174 sed -i "s/vboxdrv vboxnetadp vboxnetflt //" $1/etc/rcS.conf
175 }
177 post_install()
178 {
179 KERNEL_VERSION=`grep ^VERSION= $1/var/lib/tazpkg/installed/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
181 chroot "$1/" depmod -a $KERNEL_VERSION-slitaz
182 grep -qs vboxdrv $1/etc/rcS.conf ||
183 sed -i 's/LOAD_MODULES="/&vboxdrv vboxnetadp vboxnetflt /' $1/etc/rcS.conf
184 }