description="Perl Compatible Regular Expression libraries."
url="http://www.pcre.org/"

packager="spiky <spiky@nutyx.org>"
contributors="Pierre,Tnut"

name=pcre
version=8.45

makedepends=(bzip2 readline)
source=(https://ftp.pcre.org/pub/pcre/$name-$version.tar.bz2 )

build() {
cd $name-$version

[ "$PKGMK_ARCH" = "x86_64" ] && export CFLAGS="${CFLAGS} -fPIC"

./configure --prefix=/usr \
--docdir=/usr/share/doc/pcre-$version \
--enable-unicode-properties \
--enable-pcre16 \
--enable-pcre32 \
--enable-pcregrep-libz \
--enable-pcregrep-libbz2 \
--enable-pcretest-libreadline \
--disable-static
make
make DESTDIR=$PKG install

mkdir $PKG/lib
mv -v $PKG/usr/lib/libpcre.so.* $PKG/lib
ln -sfv ../../lib/$(readlink $PKG/usr/lib/libpcre.so) $PKG/usr/lib/libpcre.so

rm $PKG/usr/lib/libpcre{,16,32}.la
rm $PKG/usr/lib/libpcre{posix,cpp}.la
}
