# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libgsf
pkgver=1.14.52
pkgrel=0
pkgdesc="Utility library for reading and writing structured file formats"
url="https://gitlab.gnome.org/GNOME/libgsf"
arch="all"
license="LGPL-2.1-only"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
depends_dev="bzip2-dev"
makedepends="libxml2-dev glib-dev bzip2-dev intltool python3 zlib-dev
	gobject-introspection-dev"
source="https://download.gnome.org/sources/libgsf/1.14/libgsf-$pkgver.tar.xz"

# secfixes:
#   1.14.41-r0:
#     - CVE-2016-9888

build() {
	sed -i -e 's/gsf-gnome//' -e 's/thumbnailer//' Makefile.*
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--mandir=/usr/share/man \
		--disable-static \
		--without-gnome-vfs \
		--without-bonobo \
		--enable-introspection
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	rm -f "$pkgdir"/usr/share/man/man1/gsf-office-thumbnailer.1
}

sha512sums="
3a7af5eae2aa539181dd0ae0d0ce4110da4c430ed8a26cdd7f0ec84c9bcf86360cceabf81ec7c6b902f2fe8d7ea5e3c09fa911d6bab3162f0f531e6973137f4b  libgsf-1.14.52.tar.xz
"
