summaryrefslogblamecommitdiff
path: root/system/pcre/APKBUILD
blob: f58826716dead6cb70fdaebf12a32033bf28fcfc (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                    
                                                 
            

           


                                                    
                      















































































                                                                                                          
                                                                                                                                                                
# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=pcre
pkgver=8.42
pkgrel=0
pkgdesc="Perl-compatible regular expression library"
url="http://pcre.sourceforge.net"
arch="all"
license="BSD-3-Clause"
depends=
makedepends=""
checkdepends="paxmark"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools
	libpcrecpp libpcre16 libpcre32"
source="ftp://ftp.csx.cam.ac.uk/pub/software/programming/$pkgname/$pkgname-$pkgver.tar.bz2
	"

# secfixes:
#   8.40-r2:
#   - CVE-2017-7186
#   7.8-r0:
#   - CVE-2017-11164

builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	([ "$CARCH" = "s390x" ] || [ "$CARCH" = "ppc64" ]) && _enable_jit="" || _enable_jit="--enable-jit"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		$_enable_jit \
		--enable-utf8 \
		--enable-unicode-properties \
		--enable-pcre8 \
		--enable-pcre16 \
		--enable-pcre32 \
		--with-match-limit-recursion=8192 \
		--htmldir=/usr/share/doc/$pkgname-$pkgver/html \
		--docdir=/usr/share/doc/$pkgname-$pkgver

	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

check() {
	cd "$builddir"

	# paxmark tests requiring JIT
	for fn in pcre_jit_test pcretest; do
		./$fn &>/dev/null < /dev/null || true
		[ -x .libs/lt-$fn ] && paxmark -m .libs/lt-$fn
	done

	# skip locale specific tests
	sed -i -e 's/do3=yes//g' RunTest

	make check
}

libpcrecpp() {
	pkgdesc="C++ bindings for PCRE"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libpcrecpp.so* "$subpkgdir"/usr/lib/
}

libpcre16() {
	pkgdesc="PCRE with 16 bit character support"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libpcre16.so* "$subpkgdir"/usr/lib/
}

libpcre32() {
	pkgdesc="PCRE with 32 bit character support"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libpcre32.so* "$subpkgdir"/usr/lib/
}

tools() {
	pkgdesc="Auxiliary utilities for PCRE"
	mkdir -p "$subpkgdir"/usr/
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="b47b923108f6ee0c31409b79d0888314271b482a22590e164d02f21d2112fba22dd0342c24f9ba0f5fcc5b8c65550bad08c476e30a2fc79b34ecf4601ed82f3d  pcre-8.42.tar.bz2"