void-packages/srcpkgs/virtualbox-ose/template

111 lines
3.5 KiB
Plaintext

# Template file for 'virtualbox-ose'
pkgname=virtualbox-ose
_vbox_distver=4.2.10
version=${_vbox_distver}
revision=1
wrksrc="VirtualBox-${version}"
patch_args="-Np1"
short_desc="General-purpose full virtualizer for x86 hardware"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://virtualbox.org"
license="GPL-2, MPL-1.1, CDDL"
distfiles="http://download.virtualbox.org/virtualbox/$version/VirtualBox-$version.tar.bz2"
checksum=a9246b65e28f0e6e1ab3fd0180294c9dac78fdad3d61b642f9bc5a84b6a4d2b9
disable_debug=yes
depends="virtualbox-ose-dkms-${version}_${revision}
hicolor-icon-theme desktop-file-utils"
makedepends="which openssl-devel libcurl-devel libpng-devel>=1.5.10 SDL-devel
qt-devel libXcursor-devel libXinerama-devel libXrandr-devel
libXcomposite-devel libIDL-devel glib-devel pam-devel python-devel
pulseaudio-devel libxslt-devel libcap-devel xorg-server-devel
alsa-lib-devel device-mapper-devel docbook-xsl acpica-utils
kernel-headers dev86 yasm"
if [ "${XBPS_MACHINE}" = "x86_64" ]; then
makedepends="${makedepends} gcc-c++-multilib"
fi
subpackages="${pkgname}-dkms ${pkgname}-guest ${pkgname}-guest-dkms"
system_groups="vboxusers"
do_build() {
local _khdrver=$($XBPS_PKGDB_CMD version kernel-headers)
cp ${FILESDIR}/LocalConfig.kmk .
ln -s /bin/echo makeself
./configure --disable-docs --disable-java --enable-vde \
--disable-python --disable-kmods \
--nofatal --with-linux=/usr/src/kernel-headers-${_khdrver}
source ./env.sh
kmk ${makejobs} all
}
do_install() {
local f _osedir _guestdir
source ./env.sh
#
# virtualbox-ose.
#
cd ${wrksrc}/out/linux.$BUILD_PLATFORM_ARCH/release/bin
mkdir -p ${DESTDIR}/usr/{bin,lib/virtualbox/components,share/virtualbox/nls}
install -m0755 VBox.sh ${DESTDIR}/usr/bin/VBox
for f in VirtualBox VBoxManage VBoxSDL VBoxHeadless \
VBoxBalloonCtrl; do
ln -sf VBox ${DESTDIR}/usr/bin/${f}
done
# comoonents
install -m0755 components/* -t ${DESTDIR}/usr/lib/virtualbox/components
# libs
install -m0755 *.so ${DESTDIR}/usr/lib/virtualbox
install -m0644 *.gc *.r0 *.fd ${DESTDIR}/usr/lib/virtualbox
# setuid
install -m4755 VBoxHeadless VBoxSDL VBoxNetDHCP VBoxNetAdpCtl \
VirtualBox VBoxBFE -t ${DESTDIR}/usr/lib/virtualbox
install -m0755 VBoxManage VBoxSVC VBoxExtPackHelperApp VBoxXPCOMIPCD \
VBoxTestOGL VBoxBalloonCtrl \
-t ${DESTDIR}/usr/lib/virtualbox
# locales
install -m0755 nls/*.qm -t ${DESTDIR}/usr/share/virtualbox/nls
# scripts
install -m0755 VBoxCreateUSBNode.sh VBoxSysInfo.sh \
-t ${DESTDIR}/usr/share/virtualbox
# icons and desktop
install -D -m0644 VBox.png ${DESTDIR}/usr/share/pixmaps/VBox.png
install -D -m0644 virtualbox.desktop \
${DESTDIR}/usr/share/applications/virtualbox.desktop
sed -i -e "s|Icon=VBox|Icon=VBox.png|" \
${DESTDIR}/usr/share/applications/virtualbox.desktop
install -Dm644 virtualbox.xml \
${DESTDIR}/usr/share/mime/packages/virtualbox.xml
install -d ${DESTDIR}/usr/share/icons/hicolor
for i in icons/*; do
ldir=$(basename ${i})
install -d ${DESTDIR}/usr/share/icons/hicolor/${ldir}/mimetypes
cp -a ${i}/* ${DESTDIR}/usr/share/icons/hicolor/${ldir}/mimetypes
done
# configuration file
mkdir -p ${DESTDIR}/etc/vbox
echo 'INSTALL_DIR=/usr/lib/virtualbox' > ${DESTDIR}/etc/vbox/vbox.cfg
cd ${wrksrc}/out/linux.$BUILD_PLATFORM_ARCH/release/bin
install -d ${DESTDIR}/usr/share/licenses/${pkgname}
install -m0644 ${wrksrc}/COPYING* \
${DESTDIR}/usr/share/licenses/${pkgname}
# Install modules-load.d file.
vinstall ${FILESDIR}/virtualbox.conf 644 usr/lib/modules-load.d
}