aboutsummaryrefslogtreecommitdiffstats
path: root/community/php7-pecl-mailparse/APKBUILD
blob: a30ee4ff34ca802820401db787989fb3641b8f8b (plain)
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
# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=php7-pecl-mailparse
_pkgreal=mailparse
pkgver=3.0.2
pkgrel=4
pkgdesc="PHP extension for parsing and working with email messages - PECL"
url="https://pecl.php.net/package/mailparse"
arch="all"
license="PHP"
depends="php7-common php7-mbstring"
makedepends="php7-dev autoconf re2c"
source="$pkgname-$pkgver.tgz::https://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"
provides="php7-mailparse=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-mailparse" # for backward compatibility

build() {
	cd "$builddir"

	phpize7
	./configure --prefix=/usr --with-php-config=php-config7
	make
}

check() {
	cd "$builddir"
	# Tests require mbstring extension which is not bundled
	sed -i 's#PHP_TEST_SHARED_EXTENSIONS =  `#PHP_TEST_SHARED_EXTENSIONS = -d extension=/usr/lib/php7/modules/mbstring.so `#' Makefile
	# Current upstream package has no test data for following tests
	rm -f tests/011.phpt tests/bug001.phpt tests/parse_test_messages.phpt
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}

package() {
	local confdir="$pkgdir/etc/php7/conf.d"
	cd "$builddir"

	make INSTALL_ROOT="$pkgdir" install

	mkdir -p "$confdir"
	echo "extension=$_pkgreal.so" > "$confdir"/60_$_pkgreal.ini
}

sha512sums="be04e15cf3577542447186d7ead4e31159c171c99de0a255d4ee2f6f760b80ecb44be056bd9089180601f622b9a71f4331f194e1adaa702d1d964009682896f6  php7-pecl-mailparse-3.0.2.tgz"