void-packages/srcpkgs/virtualbox-ose/template

186 lines
5.9 KiB
Text

# Template file for 'virtualbox-ose'
pkgname=virtualbox-ose
_vbox_distver=4.2.12
version=${_vbox_distver}
revision=2
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=eb65ecac94f63d6292a967d39cb5e28326404c10d0e8c2c50399eedb59c17ee6
makedepends="which pkg-config openssl-devel libcurl-devel libpng-devel>=1.6
alsa-lib-devel pulseaudio-devel SDL-devel qt-devel libXcursor-devel
libXinerama-devel libXcomposite-devel libIDL-devel libglib-devel
pam-devel python-devel libxslt-devel libcap-devel xorg-server-devel
device-mapper-devel docbook-xsl acpica-utils linux-headers dev86 yasm"
if [ "$XBPS_MACHINE" = "x86_64" ]; then
makedepends+=" gcc-c++-multilib"
fi
do_build() {
local _khdrver=$($XBPS_UHELPER_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
}
virtualbox-ose-dkms_package() {
short_desc+=" - kernel module sources for dkms"
dkms_modules="virtualbox-ose ${_vbox_distver}"
depends="dkms"
noarch=yes
pkg_install() {
source ${wrksrc}/env.sh
cd ${wrksrc}/out/linux.$BUILD_PLATFORM_ARCH/release/bin/src
local _osedir=${PKGDESTDIR}/usr/src/${sourcepkg}-${version}
install -d ${_osedir}
cp -a . ${_osedir}
rm -f ${_osedir}/do_dkms
install -m644 ${FILESDIR}/${sourcepkg}-dkms.dkms ${_osedir}/dkms.conf
vinstall ${FILESDIR}/${sourcepkg}-dkms.udev 644 \
usr/lib/udev/rules.d 60-virtualbox-ose-dkms.rules
}
}
virtualbox-ose-guest_package() {
systemd_services="vboxservice.service on"
depends="virtualbox-ose-guest-dkms-${version}_${revision}"
short_desc+=" - guest utilities"
pkg_install() {
source ${wrksrc}/env.sh
cd ${wrksrc}/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions
install -d ${PKGDESTDIR}/usr/bin ${PKGDESTDIR}/usr/sbin
install -m755 VBoxClient VBoxControl VBoxService ${PKGDESTDIR}/usr/bin
install -m755 mount.vboxsf ${PKGDESTDIR}/usr/sbin
install -Dm755 ${wrksrc}/src/VBox/Additions/x11/Installer/vboxclient.desktop \
${PKGDESTDIR}/etc/xdg/autostart/vboxclient.desktop
cd ${wrksrc}/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions
install -D vboxmouse_drv_16.so \
${PKGDESTDIR}/usr/lib/xorg/modules/input/vboxmouse.so
install -D vboxvideo_drv_112.so \
${PKGDESTDIR}/usr/lib/xorg/modules/drivers/vboxvideo.so
install -d ${PKGDESTDIR}/usr/lib/xorg/modules/dri
install -m755 VBoxOGL*.so ${PKGDESTDIR}/usr/lib
ln -sf /usr/lib/VBoxOGL.so \
${PKGDESTDIR}/usr/lib/xorg/modules/dri/vboxvideo_dri.so
cd ${wrksrc}/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions
install -Dm755 pam_vbox.so ${PKGDESTDIR}/usr/lib/security/pam_vbox.so
vinstall ${FILESDIR}/virtualbox-guest.conf 644 usr/lib/modules-load.d
vinstall ${FILESDIR}/vboxservice.service 644 usr/lib/systemd/system
}
}
virtualbox-ose-guest-dkms_package() {
short_desc+=" - guest addition module source for dkms"
dkms_modules="virtualbox-ose-guest ${_vbox_distver}"
depends="dkms"
noarch=yes
pkg_install() {
source ${wrksrc}/env.sh
cd ${wrksrc}/out/linux.$BUILD_PLATFORM_ARCH/release/bin/additions/src
local _guestdir=${PKGDESTDIR}/usr/src/${sourcepkg}-guest-${version}
install -d ${_guestdir}
cp -a . ${_guestdir}
rm -f ${_guestdir}/do_dkms
install -m644 ${FILESDIR}/${sourcepkg}-guest-dkms.dkms \
${_guestdir}/dkms.conf
vinstall ${FILESDIR}/${sourcepkg}-guest-dkms.udev 644 \
usr/lib/udev/rules.d 60-virtualbox-ose-guest-dkms.rules
}
}
virtualbox-ose_package() {
depends="virtualbox-ose-dkms-${version}_${revision}
hicolor-icon-theme desktop-file-utils shadow"
system_groups="vboxusers"
pkg_install() {
vmove all
}
}