# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@alpinelinux.org>

#this package is needed for bootstrap libfm -> menu-cache-> libfm-extra
pkgname=libfm-extra
pkgver=1.3.2
pkgrel=1
pkgdesc="Library for file management"
url="https://github.com/lxde/libfm"
arch="all"
license="GPL-2.0-or-later"
makedepends="
	dbus-glib-dev
	intltool
	"
subpackages="$pkgname-dev"
source="https://downloads.sourceforge.net/pcmanfm/libfm-$pkgver.tar.xz"
builddir="$srcdir"/libfm-$pkgver

prepare() {
 	default_prepare
	update_config_guess
}

build() {
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--disable-static \
		--with-gtk=3 \
		--with-extra-only \
		--with-gnu-ld
	sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	rm -rf "$pkgdir"/usr/include/libfm
	mv "$pkgdir"/usr/include/libfm-1.0/ "$pkgdir"/usr/include/libfm
}

sha512sums="
eaa3358cd1d8f611f8f4ac882e01a716b4dc32729b641417e1100aa039db3c57ae57ccc45df7dcac4f0570cd88684beba7752a5586c1d0598b1bc7502e99f4be  libfm-1.3.2.tar.xz
"
