# $Id: PKGBUILD 11888 2008-09-06 03:23:26Z eric $
# Maintainer: Eric Belanger <eric@archlinux.org>
# Contributor: John Proctor <jproctor@prium.net>

pkgname=pcre
pkgver=7.8
pkgrel=1
pkgdesc="A library that implements Perl 5-style regular expressions"
arch=('i686' 'x86_64') 
url="http://pcre.sourceforge.net"
license=('BSD')
groups=('base')
depends=('gcc-libs')
options=('!libtool' '!makeflags')
source=(ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${pkgname}-${pkgver}.tar.bz2)
md5sums=('141132d6af14dccc7b08fa797e4fd441')
sha1sums=('552909f9d18e1954eec639f926957a4cb2de1ec3')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  [ "${CARCH}" = "x86_64" ] && export CFLAGS="${CFLAGS} -fPIC"
  ./configure --prefix=/usr --enable-utf8 --enable-unicode-properties || return 1
  make || return 1
  make DESTDIR=${pkgdir} install || return 1
  # grep uses pcre, so we need the libs in /lib
  mkdir -p ${pkgdir}/lib
  mv ${pkgdir}/usr/lib/libpcre.so.* ${pkgdir}/lib/ || return 1
  ln -sf ../../lib/libpcre.so.0 ${pkgdir}/usr/lib/libpcre.so || return 1
  install -D -m644 LICENCE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE || return 1
}