# $Id: PKGBUILD 118780 2014-09-11 00:22:09Z dwallace $
# Maintainer: Daniel Wallace <danielwallace at gtmanfred dot com>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>

pkgname=scrot
pkgver=0.8.13
pkgrel=1
pkgdesc="A simple command-line screenshot utility for X"
arch=('i686' 'x86_64')
url="http://scrot.sourcearchive.com/"
license=('MIT')
depends=('giblib')
source=("http://scrot.sourcearchive.com/downloads/${pkgver%.*}-${pkgver##*.}/${pkgname}_${pkgver%.*}.orig.tar.gz"
        "http://scrot.sourcearchive.com/downloads/${pkgver%.*}-${pkgver##*.}/${pkgname}_${pkgver%.*}-${pkgver##*.}.debian.tar.gz")
md5sums=('ccae904d225609571bdd3b03445c1e88'
         '8b725c26660abc1ffd613903f2d7b0c2')

prepare(){
    for patch in $(<$srcdir/debian/patches/series); do
        patch -Np1 -d $srcdir/$pkgname-${pkgver%.*} -i $srcdir/debian/patches/$patch
    done
}
build() {
  cd $srcdir/$pkgname-${pkgver%.*}
  ./configure --prefix=/usr \
              --mandir=/usr/share/man
  make
}

package() {
  cd $srcdir/$pkgname-${pkgver%.*}

  make DESTDIR=$pkgdir docsdir=/usr/share/doc/scrot install
  install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
