# Maintainer (Arch): Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor (Arch): Kaiting Chen <kaitocracy@gmail.com>
# Contributor (Arch): uvok <uvok at online dot de>
# Contributor (Arch): Urist <9362773 at gmail.com>

pkgname=bti
pkgver=034
pkgrel=3
pkgrel+=.nonprism1
pkgdesc='Console client for status.net, without Twitter support'
arch=('x86_64')
arch+=('i686')
url='http://gregkh.github.com/bti/'
license=('GPL')
depends=('pcre' 'libxml2' 'curl' 'liboauth' 'json-c')
source=(https://www.kernel.org/pub/software/web/$pkgname/$pkgname-$pkgver.tar.xz
        0001-Replace-removed-is_error-macro.patch)
source+=(nonprism.patch)
sha512sums=('2b7cd66cff617f7592863a1a8e03754b3dea314c8eeb98bf0993601d4d4db848a74b26941bbd04f57a348bf0d02aefca4e3125f00fed531a67a3f17f36e665ba'
            'e05c6b4c744338a4679e37c25e16656b029bb995cbe0efd71b986383d812c4c7b9e599d4f758dfeef94a378a2a807275ffe80fb28ff9970a5ec4b039201223f6'
            '522b76d0e5a01618580d6c187e5e2f1343c879b0be6dc86285f7c47f220e4a86064bb8a30bab3ec6581c2850ff4adcc1ea1a2174efcb5ea68e2454264196f066')

prepare() {
  cd "${srcdir}"/$pkgname-$pkgver
  patch -Np1 -i $srcdir/0001-Replace-removed-is_error-macro.patch
  patch -Np1 -i ${srcdir}/nonprism.patch
}

build() {
  cd "${srcdir}"/$pkgname-$pkgver
  ./configure --prefix=/usr

  make
}

package() {
  cd "${srcdir}"/$pkgname-$pkgver

  make DESTDIR="${pkgdir}" install
}
