summaryrefslogtreecommitdiff
path: root/community/virtualbox/PKGBUILD
blob: ca6bff6eefa81145ed4098ce24f1d91061942de1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# $Id: PKGBUILD 49114 2011-06-11 08:28:49Z ibiru $
#Maintainer: Ionut Biru <ibiru@archlinux.org>
pkgbase=virtualbox
pkgname=('virtualbox' 'virtualbox-guest-additions' 'virtualbox-guest-modules' 'virtualbox-sdk')
pkgver=4.0.8
pkgrel=4
arch=('i686' 'x86_64')
url='http://virtualbox.org'
license=('GPL' 'custom')
makedepends=('libstdc++5' 'bin86' 'dev86' 'iasl' 'libxslt' 'libxml2' 'libxcursor' 'qt' 'libidl2' 'sdl_ttf' 'alsa-lib' 'libpulse' 'libxtst'
'xalan-c' 'sdl' 'libxmu' 'curl' 'python2' 'kernel26-headers>=2.6.38' 'mesa' 'libxrandr' 'libxinerama' 'libvncserver' 'jdk' 'gsoap' 'vde2'
'xorg-server-devel' 'xf86driproto' 'libxcomposite')
[[ $CARCH == "x86_64" ]] && makedepends=("${makedepends[@]}" 'gcc-multilib' 'lib32-glibc')
source=(http://download.virtualbox.org/virtualbox/${pkgver}/VirtualBox-${pkgver}.tar.bz2
        http://download.virtualbox.org/virtualbox/${pkgver}/UserManual.pdf
        virtualbox-4-makeself-check.patch virtualbox-4-mkisofs-check.patch
        10-vboxdrv.rules 60-vboxguest.rules vboxdrv-reference.patch LocalConfig.kmk vboxdrv.sh
        18-system-xorg.patch
        change_default_driver_dir.patch)
_kernver=2.6.39-ARCH

build() {
    cd "$srcdir/VirtualBox-${pkgver}_OSE"

    patch -Np1 -i "$srcdir/virtualbox-4-makeself-check.patch"
    patch -Np1 -i "$srcdir/virtualbox-4-mkisofs-check.patch"
    patch -Np1 -i "$srcdir/vboxdrv-reference.patch"
    patch -Np1 -i "$srcdir/18-system-xorg.patch"
    patch -Np1 -i "$srcdir/change_default_driver_dir.patch"

    cp "$srcdir/LocalConfig.kmk" .

    ./configure --disable-docs \
        --enable-webservice \
        --enable-vde \
        --with-linux=/usr/src/linux-${_kernver}
    source ./env.sh
    kmk all

    export KERN_DIR=/usr/src/linux-${_kernver}
    make -C "$srcdir/VirtualBox-${pkgver}_OSE/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"
    make -C "$srcdir/VirtualBox-${pkgver}_OSE/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src/vboxvideo"
    sed -i 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' "out/linux.$BUILD_PLATFORM_ARCH/release/bin/vboxshell.py"
}

package_virtualbox() {
    pkgdesc="Powerful x86 virtualization for enterprise as well as home use"
    depends=('libxml2' 'libxcursor' 'libidl2' 'libxinerama' 'sdl' 'libxmu' 'curl' 'libvncserver' 'libpng' 'kernel26-headers' 'gcc' 'make')
    optdepends=('libxt: for shared clipboard'
                'python2: for python support'
                'qt: for VirtualBox GUI'
                'vde2: Virtual Distributed Ethernet support'
                'virtualbox-sdk: developer kit')

    replaces=('virtualbox-ose')
    conflicts=('virtualbox-ose')
    install=virtualbox.install

    source "$srcdir/VirtualBox-${pkgver}_OSE/env.sh"

    cd "$srcdir/VirtualBox-${pkgver}_OSE/out/linux.$BUILD_PLATFORM_ARCH/release/bin"
    mkdir -p "$pkgdir"/usr/{bin,lib/virtualbox/components,lib/virtualbox/ExtensionPacks,share/virtualbox/nls}

    #doc
    install -m 0644 "$srcdir/UserManual.pdf" "$pkgdir/usr/share/virtualbox/UserManual.pdf"

    #Binaries and Wrapper with Launchers
    install -m 0755 VBox.sh "$pkgdir/usr/bin/VBox"
    ln -sf VBox "$pkgdir/usr/bin/VBoxHeadless"
    ln -sf VBox "$pkgdir/usr/bin/vboxheadless"
    ln -sf VBox "$pkgdir/usr/bin/VBoxManage"
    ln -sf VBox "$pkgdir/usr/bin/vboxmanage"
    ln -sf VBox "$pkgdir/usr/bin/VBoxSDL"
    ln -sf VBox "$pkgdir/usr/bin/vboxsdl"
    ln -sf VBox "$pkgdir/usr/bin/VirtualBox"
    ln -sf VBox "$pkgdir/usr/bin/virtualbox"
    ln -sf VBox "$pkgdir/usr/bin/vboxwebsrv"

    install -m 0755 VBoxTunctl "$pkgdir/usr/bin"

    #components
    install -m 0755 components/* -t "$pkgdir/usr/lib/virtualbox/components"

    #lib
    install -m 0755 *.so "$pkgdir/usr/lib/virtualbox"
    install -m 0644 *.gc *.r0  VBoxEFI*.fd "$pkgdir/usr/lib/virtualbox"

    #setuid root binaries
    install -m 4755 VBoxSDL VirtualBox VBoxHeadless VBoxNetDHCP VBoxNetAdpCtl -t "$pkgdir/usr/lib/virtualbox"
    #other binaries
    install -m 0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD VBoxTestOGL vboxwebsrv webtest -t "$pkgdir/usr/lib/virtualbox"

    #language
    install -m 0755 nls/*.qm -t "$pkgdir/usr/share/virtualbox/nls"

    #useless scripts
    install -m 0755 VBoxCreateUSBNode.sh VBoxSysInfo.sh -t "$pkgdir/usr/share/virtualbox"

    #icons
    install -D -m 0644 VBox.png "$pkgdir/usr/share/pixmaps/VBox.png"

    pushd icons
    for i in *; do
        install -d "$pkgdir/usr/share/icons/hicolor/$i/mimetypes"
        cp $i/* "$pkgdir/usr/share/icons/hicolor/$i/mimetypes"
    done
    popd

    #desktop
    install -D -m 0644 virtualbox.desktop "$pkgdir/usr/share/applications/virtualbox.desktop"
    install -D -m 0644 virtualbox.xml "$pkgdir/usr/share/mime/packages/virtualbox.xml"

    #install configuration
    mkdir -p "$pkgdir/etc/vbox"
    echo 'INSTALL_DIR=/usr/lib/virtualbox' > "$pkgdir/etc/vbox/vbox.cfg"

    #udev and licence
    install -D -m 0644 "$srcdir/VirtualBox-${pkgver}_OSE/COPYING" \
        "$pkgdir/usr/share/licenses/virtualbox/LICENSE"
    install -D -m 0644 "$srcdir/10-vboxdrv.rules" \
        "$pkgdir/lib/udev/rules.d/10-vboxdrv.rules"

    #sources for modules
    cp -r src ${pkgdir}/usr/lib/virtualbox
    #install compilation script
    install -D -m 755 "${srcdir}/vboxdrv.sh" "${pkgdir}/etc/rc.d/vboxdrv"
}

package_virtualbox-sdk() {
    pkgdesc=" VirtualBox Software Developer Kit (SDK)"

    mkdir -p "$pkgdir/usr/lib/virtualbox"

    source "$srcdir/VirtualBox-${pkgver}_OSE/env.sh"
    cd "$srcdir/VirtualBox-${pkgver}_OSE/out/linux.$BUILD_PLATFORM_ARCH/release/bin"

    install -D -m 0755 vboxshell.py "$pkgdir/usr/lib/virtualbox/vboxshell.py"
    #python sdk
    pushd sdk/installer
    VBOX_INSTALL_PATH="/usr/lib/virtualbox" python2 vboxapisetup.py install --root "${pkgdir}"
    popd
    rm -rf sdk/installer
    mv sdk "$pkgdir/usr/lib/virtualbox"
}
package_virtualbox-guest-additions(){
    pkgdesc="VirtualBox user-space tools for Linux guests"
    depends=("virtualbox-guest-modules=$pkgver" 'gcc-libs' 'libxmu' 'xorg-xrandr')
    replaces=('virtualbox-ose-additions')
    conflicts=('virtualbox-ose-additions')

    source "$srcdir/VirtualBox-${pkgver}_OSE/env.sh"

    cd "$srcdir/VirtualBox-${pkgver}_OSE/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions"

    install -d "$pkgdir/usr/bin"
    install -d "$pkgdir/sbin"
    install -m755 VBoxClient VBoxControl VBoxService "$pkgdir/usr/bin"
    install -m755 mount.vboxsf "$pkgdir/sbin"

    install -m644 -D "$srcdir"/VirtualBox-${pkgver}_OSE/src/VBox/Additions/x11/Installer/50-vboxmouse.conf \
        "$pkgdir"/etc/X11/xorg.conf.d/50-vboxmouse.conf
    install -m644 -D "$srcdir"/VirtualBox-${pkgver}_OSE/src/VBox/Additions/linux/installer/70-xorg-vboxmouse.rules \
        "$pkgdir"/lib/udev/rules.d/70-xorg-vboxmouse.rules
    install -m755 -D "$srcdir"/VirtualBox-${pkgver}_OSE/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
        "$pkgdir"/usr/bin/VBoxClient-all
    install -m755 -D "$srcdir"/VirtualBox-${pkgver}_OSE/src/VBox/Additions/x11/Installer/vboxclient.desktop \
        "$pkgdir"/etc/xdg/autostart/vboxclient.desktop
    install -D vboxmouse_drv.so \
        "$pkgdir/usr/lib/xorg/modules/input/vboxmouse.so"
    install -D vboxvideo_drv.so \
        "$pkgdir/usr/lib/xorg/modules/drivers/vboxvideo.so"
    install -d "$pkgdir/usr/lib/xorg/modules/dri"
    install -m755 VBoxOGL*.so "$pkgdir/usr/lib"
    ln -s /usr/lib/VBoxOGL.so "$pkgdir/usr/lib/xorg/modules/dri/vboxvideo_dri.so"
    install -m755 -D pam_vbox.so "$pkgdir/lib/security/pam_vbox.so"

}
package_virtualbox-guest-modules(){
    pkgdesc="VirtualBox kernel modules for Linux guests"
    license=('GPL')
    install=virtualbox-guest-modules.install
    depends=('kernel26>=2.6.39' 'kernel26<2.6.40')
    replaces=('virtualbox-ose-additions-modules')
    conflicts=('virtualbox-ose-additions-modules')

    source "$srcdir/VirtualBox-${pkgver}_OSE/env.sh"

    cd "$srcdir/VirtualBox-${pkgver}_OSE/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src"

    cd vboxguest
    install -D -m644 vboxguest.ko \
        "$pkgdir/lib/modules/$_kernver/misc/vboxguest.ko"

    cd ../vboxsf
    install -D -m644 vboxsf.ko \
        "$pkgdir/lib/modules/$_kernver/misc/vboxsf.ko"

    cd ../vboxvideo
    install -D -m644 vboxvideo.ko \
        "$pkgdir/lib/modules/$_kernver/misc/vboxvideo.ko"

    install -D -m 0644 "$srcdir/60-vboxguest.rules" \
        "$pkgdir/lib/udev/rules.d/60-vboxguest.rules"

    sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='${_kernver}'/" "$startdir/virtualbox-guest-modules.install"
}
md5sums=('a3e81289f2357fcf4bbe3e77805f38b6'
         '39712ccbc16b04c1cda209ae16446bf2'
         '44efb3c4be214daa453a317d527f1f30'
         '32a232b43852b9a08cb11a7bcd64b347'
         '5f85710e0b8606de967716ded7b2d351'
         'ed1341881437455d9735875ddf455fbe'
         '9bde5b7dfba5abcd49768052c5409800'
         'c1a07f044c476a190af8486fe78bee0f'
         '47da2e88de582bb2bab14580a3aa47b1'
         '8a22b33c9dfaf8fb79bb2d26304e650b'
         'ac43f7cf44b934d8dbdbc3bb6f7879ad')