summaryrefslogtreecommitdiff
path: root/system/pcre/APKBUILD
blob: 3bfe4dff34267f387eb0c24db52116fefcf5c6b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=pcre
pkgver=8.44
pkgrel=0
pkgdesc="Perl-compatible regular expression library"
url="https://pcre.org"
arch="all"
license="BSD-3-Clause"
depends=""
makedepends=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools
	libpcrecpp libpcre16 libpcre32"
source="https://ftp.pcre.org/pub/pcre/$pkgname-$pkgver.tar.bz2
	stack-frame-size-detection.patch
	"

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

build() {
	_enable_jit="--enable-jit"
	[ "$CARCH" = "s390x" ] && _enable_jit=""
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--libdir=/lib \
		$_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() {
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir"/usr/lib
	mv "$pkgdir"/lib/pkgconfig "$pkgdir"/usr/lib/
}

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

	make check
}

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

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

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

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

sha512sums="f26d850aab5228799e58ac8c2306fb313889332c39e29b118ef1de57677c5c90f970d68d3f475cabc64f8b982a77f04eca990ff1057f3ccf5e19bd137997c4ac  pcre-8.44.tar.bz2
a088304318f7a04f90263efbab20b423e67fb6e3d829e7bc080fd44c29e98bc29cab992b73ed1b992af89cdf4606667af20572558a3a96549b7bd9479d0e6d88  stack-frame-size-detection.patch"