# Template file for 'gvfs'
pkgname=gvfs
version=1.56.1
revision=3
build_style=meson
configure_args="-Dsystemduserunitdir=no -Dtmpfilesdir=no -Dlogind=false
 -Dman=true -Dgoogle=false"
hostmakedepends="docbook-xsl glib-devel gettext libxslt openssh pkg-config
 polkit-devel"
makedepends="avahi-glib-libs-devel dbus-glib-devel fuse3-devel gcr4-devel
 libarchive-devel libbluetooth-devel libbluray-devel libcap-devel
 libcdio-paranoia-devel libgcrypt-devel libglib-devel
 libgphoto2-devel libgudev-devel libimobiledevice-devel libmtp-devel
 libnfs-devel libsecret-devel libsoup3-devel libxml2-devel polkit-devel
 samba-devel udisks2-devel gsettings-desktop-schemas-devel
 gnome-online-accounts-devel msgraph-devel"
short_desc="Userspace virtual filesystem"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://wiki.gnome.org/Projects/gvfs"
changelog="https://gitlab.gnome.org/GNOME/gvfs/-/raw/master/NEWS"
distfiles="${GNOME_SITE}/gvfs/${version%.*}/gvfs-${version}.tar.xz"
checksum=86731ccec679648f8734e237b1de190ebdee6e4c8c0f56f454c31588e509aa10

# Manually declare shlibs used by the subpkgs.
shlib_provides="libgvfscommon.so libgvfsdaemon.so"
subpackages="gvfs-afc gvfs-afp gvfs-cdda gvfs-gphoto2 gvfs-mtp gvfs-smb gvfs-goa gvfs-devel"

gvfs-devel_package() {
	short_desc+=" - development files (transitional dummy package)"
	metapackage=yes
}

gvfs-afc_package() {
	short_desc+=" - Apple mobile device backend"
	depends="${sourcepkg}-${version}_${revision}"
	pkg_install() {
		vmove usr/libexec/gvfsd-afc
		vmove usr/libexec/gvfs-afc-volume-monitor
		vmove usr/share/dbus-1/services/org.gtk.vfs.AfcVolumeMonitor.service
		vmove usr/share/gvfs/remote-volume-monitors/afc.monitor
	}
}

gvfs-afp_package() {
	short_desc+=" - Apple Filing Protocol (AFP) backend"
	depends="${sourcepkg}-${version}_${revision}"
	pkg_install() {
		vmove "usr/libexec/gvfsd-afp*"
		vmove "usr/share/gvfs/mounts/afp*"
	}
}

gvfs-cdda_package() {
	short_desc+=" - CD-ROM backend"
	depends="${sourcepkg}-${version}_${revision}"
	pkg_install() {
		vmove "usr/libexec/gvfsd-cd*"
		vmove "usr/share/gvfs/mounts/cd*"
	}
}

gvfs-goa_package() {
	short_desc+=" - Gnome Online Accounts (webservices) backend"
	depends="${sourcepkg}-${version}_${revision}"
	pkg_install() {
		vmove usr/libexec/gvfs-goa-volume-monitor
		vmove usr/libexec/gvfsd-onedrive
		vmove usr/share/gvfs/mounts/onedrive.mount
		vmove usr/share/dbus-1/services/org.gtk.vfs.GoaVolumeMonitor.service
		vmove usr/share/gvfs/remote-volume-monitors/goa.monitor
	}
}

gvfs-gphoto2_package() {
	short_desc+=" - gphoto2 (PTP camera/MTP media player) backend"
	depends="${sourcepkg}-${version}_${revision}"
	pkg_install() {
		vmove usr/libexec/gvfs-gphoto2-volume-monitor
		vmove usr/libexec/gvfsd-gphoto2
		vmove usr/share/dbus-1/services/org.gtk.vfs.GPhoto2VolumeMonitor.service
		vmove usr/share/gvfs/remote-volume-monitors/gphoto2.monitor
	}
}

gvfs-mtp_package() {
	short_desc+=" - MTP backend"
	depends="${sourcepkg}-${version}_${revision}"
	pkg_install() {
		vmove usr/libexec/gvfs-mtp-volume-monitor
		vmove usr/libexec/gvfsd-mtp
		vmove usr/share/dbus-1/services/org.gtk.vfs.MTPVolumeMonitor.service
		vmove usr/share/gvfs/remote-volume-monitors/mtp.monitor
		vmove usr/share/gvfs/mounts/mtp.mount
	}
}

gvfs-smb_package() {
	short_desc+=" - SMB/CIFS (Windows client) backend"
	depends="${sourcepkg}-${version}_${revision}"
	pkg_install() {
		vmove usr/libexec/gvfsd-smb
		vmove usr/libexec/gvfsd-smb-browse
		vmove usr/share/GConf/gsettings/gvfs-smb.convert
		vmove usr/share/glib-2.0/schemas/org.gnome.system.smb.gschema.xml
		vmove usr/share/gvfs/mounts/smb-browse.mount
		vmove usr/share/gvfs/mounts/smb.mount
	}
}
