# Template file for 'libmtp'
pkgname=libmtp
version=1.1.22
revision=1
build_style=gnu-configure
configure_args="--disable-static --with-udev=/usr/lib/udev
 --with-udev-group=plugdev"
hostmakedepends="pkg-config"
makedepends="libgcrypt-devel libusb-devel"
short_desc="Library for Microsoft's Media Transfer Protocol (MTP)"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="LGPL-2.1-or-later"
homepage="https://libmtp.sourceforge.net"
changelog="https://sourceforge.net/projects/libmtp/files/libmtp/${version}/README"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.gz"
checksum=c3fcf411aea9cb9643590cbc9df99fa5fe30adcac695024442973d76fa5f87bc

if [ "$CROSS_BUILD" ]; then
	# use mtp-hotplug from host, needed to create udev rules and hwdb
	configure_args+=" --enable-crossbuilddir"
	# ... so, install mtp-hotplug in host
	hostmakedepends+=" libmtp"
fi

libmtp-devel_package() {
	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}
