wok-6.x view virtualbox-ose/receipt @ rev 11904
cyrus-imapd: fix compile_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Feb 29 20:32:37 2012 +0100 (2012-02-29) |
parents | 1b8727ba482a |
children | 46fad48f8fc2 |
line source
1 # SliTaz package receipt.
3 PACKAGE="virtualbox-ose"
4 VERSION="4.1.8"
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 libIDL libsdl-dev mesa-dev libxslt-dev \
17 Qt4-dev libsdl-ttf-dev alsa-lib-dev hal-dev xorg-libXtst-dev \
18 xorg-libXrandr-dev python python-dev xalan-c curl-dev xalan-c-dev \
19 xerces-c-dev openssl-dev zlib-dev libcap-dev glib-dev libvncserver-dev \
20 pam pam-dev bzip2 linux-module-headers pkg-config tar wget vde2-dev"
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. NOTE: we gor ERROR even if it build and cook will exit
40 # sed ERROR to error.
41 cd
42 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
43 # build guest additions modules
44 KERN_DIR=/usr/src/linux make -C "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
45 KERN_DIR=/usr/src/linux make -C \
46 "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src/vboxvideo" \
47 2>&1 | sed s'/ERROR/error/'
48 }
50 # Rules to gen a SliTaz package suitable for Tazpkg.
51 genpkg_rules()
52 {
53 fs=$WOK/$PACKAGE/taz/$PACKAGE-$VERSION/fs
55 source $src/env.sh
56 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
57 mkdir -p $fs/usr/bin $fs/usr/lib/virtualbox/components \
58 $fs/usr/share/virtualbox/nls \
59 $fs/usr/lib/virtualbox/ExtensionPacks
60 install -m 0755 VBox.sh $fs/usr/bin/VBox
61 sed -i 's/ps -U/ps | grep/' $fs/usr/bin/VBox
62 ln -sf VBox $fs/usr/bin/VBoxHeadless
63 ln -sf VBox $fs/usr/bin/vboxheadless
64 ln -sf VBox $fs/usr/bin/VBoxManage
65 ln -sf VBox $fs/usr/bin/vboxmanage
66 ln -sf VBox $fs/usr/bin/VBoxSDL
67 ln -sf VBox $fs/usr/bin/vboxsdl
68 ln -sf VBox $fs/usr/bin/VirtualBox
69 ln -sf VBox $fs/usr/bin/virtualbox
70 ln -sf VBox $fs/usr/bin/vboxwebsrv
72 install -m 0755 VBoxTunctl "$fs/usr/bin"
74 # components
75 install -D -m 0755 components/* $fs/usr/lib/virtualbox/components
77 # lib
78 install -m 0755 *.so "$fs/usr/lib/virtualbox"
79 install -m 0644 *.gc *.r0 VBoxEFI*.fd "$fs/usr/lib/virtualbox"
81 #setuid root binaries
82 install -m 4755 VBoxSDL VirtualBox VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl "$fs/usr/lib/virtualbox"
84 #other binaries
85 #install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL vboxwebsrv webtest "$fs/usr/lib/virtualbox"
86 install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL "$fs/usr/lib/virtualbox"
88 #language
89 install -m 0755 nls/*.qm "$fs/usr/share/virtualbox/nls"
91 #useless scripts
92 install -m 0755 VBoxCreateUSBNode.sh VBoxSysInfo.sh "$fs/usr/share/virtualbox"
94 #icon
95 install -D -m 0644 VBox.png "$fs/usr/share/pixmaps/virtualbox.png"
97 #desktop
98 install -D -m 0644 virtualbox.desktop "$fs/usr/share/applications/virtualbox.desktop"
99 sed -i "s|VBox.png|virtualbox|" \
100 $fs/usr/share/applications/virtualbox.desktop
101 install -D -m 0644 virtualbox.xml "$fs/usr/share/mime/packages/virtualbox.xml"
103 #install configuration
104 mkdir -p "$fs/etc/vbox"
105 echo 'lsmod | grep -q vboxdrv || modprobe vboxdrv' > "$fs/etc/vbox/vbox.cfg"
106 echo 'INSTALL_DIR=/usr/lib/virtualbox' >> "$fs/etc/vbox/vbox.cfg"
108 #udev
109 install -D -m 0644 "$stuff/60-virtualbox.rules" \
110 "$fs/etc/udev/rules.d/60-virtualbox.rules"
112 mkdir -p $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
113 cd sdk/installer
114 VBOX_INSTALL_PATH="/usr/lib/virtualbox" python vboxapisetup.py install --root "$fs"
115 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
116 cd sdk/bindings/xpcom/python
117 cp -r xpcom $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/
118 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/*.py
119 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/server/*.py
120 chmod 644 $fs/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/client/*.py
121 cd $src/out/linux.$BUILD_PLATFORM_ARCH/release/bin
123 # virtualbox-modules
124 KERNEL_VERSION=`grep ^VERSION= $WOK/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
126 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src"
127 install -D -m644 vboxdrv.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxdrv.ko"
128 install -D -m644 vboxnetflt.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetflt.ko"
129 install -D -m644 vboxnetadp.ko "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxnetadp.ko"
131 # virtualbox-ose-additions
133 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"
134 mkdir -p $fs/usr/bin
135 mkdir -p $fs/sbin
136 mkdir -p $fs/etc/X11/xorg.conf.d
138 install -m755 VBoxClient VBoxControl VBoxService "$fs/usr/bin"
139 install -m755 mount.vboxsf "$fs/sbin"
141 install -m644 $src/src/VBox/Additions/x11/Installer/50-vboxmouse.conf \
142 $fs/etc/X11/xorg.conf.d/50-vboxmouse.conf
144 install -m755 -D $src/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
145 $fs/usr/bin/VBoxClient-all
146 install -m755 -D $src/src/VBox/Additions/x11/Installer/vboxclient.desktop \
147 $fs/etc/xdg/autostart/vboxclient.desktop
149 install -D vboxmouse_drv_19.so \
150 "$fs/usr/lib/X11/modules/input/vboxmouse.so"
151 install -D vboxvideo_drv_19.so \
152 "$fs/usr/lib/X11/modules/drivers/vboxvideo.so"
153 install -d "$fs/usr/lib/dri"
154 install -m755 VBoxOGL*.so "$fs/usr/lib"
155 ln -s /usr/lib/VBoxOGL.so "$fs/usr/lib/dri/vboxvideo_dri.so"
156 install -m755 -D pam_vbox.so "$fs/lib/security/pam_vbox.so"
158 # virtualbox-ose-additions-modules
159 cd "$src/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
161 cd vboxguest
162 install -D -m644 vboxguest.ko \
163 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxguest.ko"
165 cd ../vboxsf
166 install -D -m644 vboxsf.ko \
167 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxsf.ko"
169 cd ../vboxvideo
170 install -D -m644 vboxvideo.ko \
171 "$fs/lib/modules/$KERNEL_VERSION-slitaz/misc/vboxvideo.ko"
173 install -D -m 0644 "$stuff/60-vboxguest.rules" \
174 "$fs/etc/udev/rules.d/60-vboxguest.rules"
175 }
177 pre_remove()
178 {
179 sed -i "s/vboxdrv vboxnetadp vboxnetflt //" $1/etc/rcS.conf
180 }
182 post_install()
183 {
184 KERNEL_VERSION=`grep ^VERSION= $1/var/lib/tazpkg/installed/linux/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
186 chroot "$1/" depmod -a $KERNEL_VERSION-slitaz
187 grep -qs vboxdrv $1/etc/rcS.conf ||
188 sed -i 's/LOAD_MODULES="/&vboxdrv vboxnetadp vboxnetflt /' $1/etc/rcS.conf
189 }