#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2018 Alexander Pyhalov
# Copyright 2019 Tim Mooney
# Copyright 2020 Michal Nowak
#

set name=pkg.fmri value=pkg:/system/virtualbox/virtualbox-additions@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.human-version value=$(HUMAN_VERSION)
set name=pkg.summary value="VirtualBox Guest Additions - provide host/guest integration"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
set name=variant.opensolaris.zone value=global value=nonglobal

license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'

<transform file path=usr/kernel/.+ -> default pkg.depend.bypass-generate .* >
<transform file path=usr/kernel/.+ -> default variant.opensolaris.zone "global" >

group gid=59 groupname=vboxsf

# We can reconsider later and deliver vboxvideo_drv.so from VirtualBox sources
depend type=require fmri=x11/server/xorg/driver/xorg-video-vboxvideo

file path=etc/fs/vboxfs/mount owner=root group=bin mode=0555
file path=etc/xdg/autostart/vboxclient.desktop
file path=lib/opengl/ogl_select/vbox_vendor_select mode=0555
file path=usr/bin/VBoxClient
file path=usr/bin/VBoxClient-all
file path=usr/bin/VBoxControl
file path=usr/bin/VBoxService
file path=usr/kernel/drv/$(MACH64)/vboxguest mode=0555
file path=usr/kernel/drv/$(MACH64)/vboxms mode=0555
# We do not ship this module, as it requires old drm and is not used
# by xorg-video-vboxvideo driver
#file path=usr/kernel/drv/$(MACH64)/vboxvideo mode=0555
file path=usr/kernel/drv/vboxguest.conf
file path=usr/kernel/drv/vboxms.conf
file path=usr/kernel/fs/$(MACH64)/vboxfs mode=0555
#file path=usr/lib/xorg/modules/drivers/$(MACH64)/vboxvideo_drv.so
file path=usr/sbin/vboxmslnk
file path=var/svc/manifest/application/virtualbox/vboxmslnk.xml
file path=var/svc/manifest/application/virtualbox/vboxservice.xml

driver devlink=type=ddi_pseudo;name=vboxguest\t\D alias=pci80ee,cafe name=vboxguest  perms="* 0666 root sys" variant.opensolaris.zone=global
driver name=vboxms perms="* 0666 root sys" variant.opensolaris.zone=global
#driver name=vboxvideo variant.opensolaris.zone=global

# postinstall script delivered this as links:
link path=dev/vboxguest target=../devices/pci@0,0/pci80ee,cafe@4:vboxguest variant.opensolaris.zone=global pkg.linted.userland.action002.0=true
link path=dev/vboxms target=../devices/pseudo/vboxms@0:vboxms variant.opensolaris.zone=global pkg.linted.userland.action002.0=true