# $Id: PKGBUILD 116199 2014-07-23 21:21:03Z bpiotrowski $
# Maintainer:  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Kaiting Chen <kaitocracy@gmail.com>
# Contributor: Abhishek Dasgupta <abhidg@gmail.com>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: Jan Fader <jan.fader@web.de>

pkgname=fish
pkgver=2.1.0
pkgrel=4
pkgdesc='Smart and user friendly shell intended mostly for interactive use'
arch=('i686' 'x86_64')
url='http://fishshell.com/'
license=('GPL2')
depends=('bc' 'gcc-libs' 'inetutils' 'ncurses' 'which')
optdepends=('python: for manual page completion parser and web configuration tool')
install=fish.install
source=(http://fishshell.com/files/$pkgver/fish-$pkgver.tar.gz
        CVE-2014-2905.patch
        CVE-2014-2906.patch)
md5sums=('3a29aebde522b8f52d9975d7423db99e'
         '1e194b61bb7ec49e2e005383724037b7'
         'cf0c216f528c9d9adac2aa5f8e9b716b')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 -i ../CVE-2014-2905.patch
  patch -p1 -i ../CVE-2014-2906.patch
  autoconf -f
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr \
    --sysconfdir=/etc
  make
}

package() {
  make -C $pkgname-$pkgver DESTDIR="$pkgdir" install
}
