# $Id: PKGBUILD 118138 2014-09-01 15:26:00Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Alexander Fehr <pizzapunk gmail com>

pkgname=catfish
pkgver=1.2.1
pkgrel=1
pkgdesc='Versatile file searching tool'
arch=('any')
url='https://launchpad.net/catfish-search'
license=('GPL')
install="$pkgname.install"
depends=('gtk3' 'python2-gobject' 'python2-xdg' 'xdg-utils' 'python2-pexpect')
makedepends=('intltool')
optdepends=('zeitgeist: integration with zeitgeist'
            'findutils: filename search'
            'mlocate: filename search'
            'tracker: fulltext search'
            'strigi: fulltext search'
            'pinot: fulltext search')
source=("https://launchpad.net/catfish-search/${pkgver%.*}/$pkgver/+download/$pkgname-$pkgver.tar.bz2")
sha256sums=('07e30223d5fed47e78768fad7860e2b56ec35661ec98dfa8323c5f83753cca16')

prepare() {
  cd "$pkgname-$pkgver"

  sed -i '1s/python/python2/' {bin,catfish,catfish_lib}/*.py build.py
  sed -i 's|ln -sf $(PREFIX)/share|ln -sf ..|' Makefile.in.in
}

build() {
  cd "$pkgname-$pkgver"

  ./configure --prefix=/usr --python=python2
  make
}

package () {
  make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
  install -d "$pkgdir"/usr/share/pixmaps
  ln -s "/usr/share/icons/hicolor/scalable/apps/$pkgname.svg" \
    "$pkgdir/usr/share/pixmaps/$pkgname.svg"
}

# vim:set ts=2 sw=2 et:
