# $Id: PKGBUILD 117521 2014-08-18 14:01:40Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: Caleb Maclennan <caleb@alerque.com>
# Contributor: Shanto <shanto@hotmail.com>
# Contributor: Athurg <athurg@gooth.cn>
# Contributor: TDY <tdy@gmx.com>

pkgname=shutter
pkgver=0.93
pkgrel=1
pkgdesc="a featureful screenshot tool (formerly gscrot)"
arch=('any')
url="http://shutter-project.org/"
license=('GPL3')
install=$pkgname.install
depends=(xdg-utils imagemagick bc procps librsvg gnome-perl desktop-file-utils
         perl-{gnome2-wnck,gtk2-{imageview,unique},x11-protocol,image-exiftool}
         perl-{proc-{simple,processtable},net-{dbus,dropbox-api},goo-canvas}
         perl-{sort-naturally,json,json-xs,xml-simple,www-mechanize,locale-gettext}
         perl-{file-{which,basedir,copy-recursive},path-class,xml-simple})
optdepends=('nautilus-sendto: "Send To" functionality in right-click and main menu'
            'gnome-web-photo: Support for capturing websites')
           #'perl-gtk2-appindicator: AppIndicator support')
source=("http://shutter-project.org/wp-content/uploads/releases/tars/$pkgname-$pkgver.tar.gz")
md5sums=('13e913ae1e4a9c8e9416e0386eb97bb8')

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

  # Fix tray icon under many icon themes, from Gentoo
  sed -e "/\$tray->set_from_icon_name/s:set_from_icon_name:set_from_file:" \
      -e "s:shutter-panel:/usr/share/icons/hicolor/scalable/apps/&.svg:" \
      -i bin/shutter
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  install -Dm755 bin/$pkgname "$pkgdir/usr/bin/$pkgname"
  cp -a share "$pkgdir/usr/"
}

