# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=php7-mailparse
_pkgreal=mailparse
pkgver=3.0.2
pkgrel=1
_phpver=${pkgname#php}
_phpver=${_phpver%%-*}
pkgdesc="PHP$_phpver extension for parsing and working with email messages"
url="http://pecl.php.net/package/mailparse"
arch="all"
license="PHP"
depends="php$_phpver-common php$_phpver-mbstring"
makedepends="php$_phpver-dev autoconf"
source="$pkgname-$pkgver.tgz::http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
options="!check"  # tests fail b/c of not loaded mbstring module
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	cd "$builddir"

	phpize$_phpver
	./configure --prefix=/usr --with-php-config=php-config$_phpver
	make
}

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

	make INSTALL_ROOT="$pkgdir" install

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

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