# Depends on:
name=libpcre
-version=8.01
-release=1
-source=(ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$version.tar.bz2)
+version=8.37
+release=5
+source=(ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$version.tar.bz2
+ 01-seven-security-patches.patch \
+ $name-$version-CVE-2015-5073.patch \
+ $name-$version-CVE-2015-XXXX.patch)
+
build() {
cd pcre-$version
./configure --build=$CHOST \
--host=$CTARGET \
--prefix=/usr \
- --mandir=/usr/man \
--enable-utf8 \
- --enable-unicode-properties
+ --enable-unicode-properties \
+ --enable-jit \
+ --with-sysroot=$CLFS
+
+ # get rid of host lib search dirs from Makefiles
+ for mk in $(find -name Makefile) ; do
+ sed -i 's|-L/usr/lib||' $mk
+ done
+
+ # use same type fix as done for gcc port, to prevent libtool
+ # from linking in host libraries
+ for lt_file in $(find -name 'libtool') ; do
+ sed -i 's/func_append add_dir \" /add_dir=\"/' $lt_file
+ done
+
+
make
make DESTDIR=$PKG install
- rm -r $PKG/usr/share
+ install -d $PKG/lib
+ mv $PKG/usr/lib/libpcre.so.* $PKG/lib
+ ln -sf ../../lib/$(readlink $PKG/usr/lib/libpcre.so) $PKG/usr/lib/libpcre.so
+
+ rm -r $PKG/usr/share/doc
+ rm $PKG/usr/share/man/man3/{pcre{16,32}*,pcre_utf{16,32}*}
}