void-packages/srcpkgs/libgphoto2/template
2018-11-01 21:28:13 -03:00

73 lines
2.2 KiB
Bash

# Template file for 'libgphoto2'
pkgname=libgphoto2
version=2.5.20
revision=1
build_style=gnu-configure
configure_args="--disable-static --disable-rpath udevscriptdir=/usr/lib/udev"
hostmakedepends="automake gettext-devel libtool pkg-config"
makedepends="gd-devel libexif-devel libltdl-devel libusb-compat-devel
libxml2-devel"
depends="libgphoto2-udev-rules"
short_desc="Digital camera access library"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="GPL-2.0-or-later"
homepage="http://www.gphoto.org"
changelog="https://raw.githubusercontent.com/gphoto/libgphoto2/master/NEWS"
distfiles="${SOURCEFORGE_SITE}/gphoto/${pkgname}-${version}.tar.bz2"
checksum=e10ff0140e2e5dddaf6c6d9d933ab6f8c0bc66fdf7445b1ef2ca9f4d96e68b0f
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" libgphoto2"
fi
pre_configure() {
autoreconf -fi
}
post_install() {
# Remove unused udev helper
rm -rf ${DESTDIR}/usr/lib/udev
# Remove recursive symlink
rm -f ${DESTDIR}/usr/include/gphoto2/gphoto2
vmkdir usr/lib/udev/hwdb.d
vmkdir usr/lib/udev/rules.d
if [ -z "$CROSS_BUILD" ]; then
LD_LIBRARY_PATH="${DESTDIR}/usr/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" \
CAMLIBS="${DESTDIR}/usr/lib/libgphoto2/${version}" \
${DESTDIR}/usr/lib/libgphoto2/print-camera-list udev-rules version 201 > \
${DESTDIR}/usr/lib/udev/rules.d/40-gphoto.rules
LD_LIBRARY_PATH="${DESTDIR}/usr/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" \
CAMLIBS="${DESTDIR}/usr/lib/libgphoto2/${version}" \
${DESTDIR}/usr/lib/libgphoto2/print-camera-list hwdb > \
${DESTDIR}/usr/lib/udev/hwdb.d/20-gphoto.hwdb
else
/usr/lib/libgphoto2/print-camera-list udev-rules version 201 > \
${DESTDIR}/usr/lib/udev/rules.d/40-gphoto.rules
/usr/lib/libgphoto2/print-camera-list hwdb > \
${DESTDIR}/usr/lib/udev/hwdb.d/20-gphoto.hwdb
fi
}
libgphoto2-udev-rules_package() {
short_desc+=" - udev rules"
noarch=yes
pkg_install() {
vmove usr/lib/udev/hwdb.d
vmove usr/lib/udev/rules.d
}
}
libgphoto2-devel_package() {
depends="libexif-devel libusb-compat-devel ${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/bin
vmove usr/include
vmove "usr/lib/*.so"
vmove usr/lib/pkgconfig
vmove usr/share/doc
vmove usr/share/man/man3
}
}