# Maintainer: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@alpinelinux.org>

pkgname=libfm
pkgver=1.2.5
pkgrel=0
pkgdesc='Library for file management'
url='http://pcmanfm.sourceforge.net/'
arch='all'
license='GPL'
makedepends='gtk+2.0-dev menu-cache-dev udisks-dev intltool dbus-glib-dev
             libexif-dev'
options='libtool'
subpackages="$pkgname-dev $pkgname-doc"
source="http://downloads.sourceforge.net/pcmanfm/$pkgname-$pkgver.tar.xz"

build() {
  cd "$srcdir/$pkgname-$pkgver"
  ./configure --prefix=/usr \
    --sysconfdir=/etc \
    --enable-udisks \
    --with-gnu-ld  || return 1
  make LDFLAGS+=' -lgobject-2.0 -lglib-2.0' || return 1
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install || return 1

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

md5sums="a1ba9ae5e920f38b647dd511edd6c807  libfm-1.2.5.tar.xz"
sha256sums="c706bb1020cf5f2d6f5a9226f692ce1985947134dcf2bde64278bd0420779b5a  libfm-1.2.5.tar.xz"
sha512sums="14630639dab9289f1a4c30eaf0f1b628ff0d492c095ce31c15e1dcacfd12d5a91551fecb67bd6d949fbc0c3f16850352b699e86dd200cda92da45539b7e87074  libfm-1.2.5.tar.xz"