aboutsummaryrefslogtreecommitdiffstats
path: root/testing/php-couchbase/APKBUILD
blob: f616eb91369c130f54853f72ec7ff9d80b46081b (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Contributor: Nathan Johnson <nathan@nathanjohnson.info>
# Maintainer: Nathan Johnson <nathan@nathanjohnson.info>
pkgname=php-couchbase
_pkgname=couchbase
pkgver=2.2.3
pkgrel=1
pkgdesc="PHP extension couchbase"
url="http://pecl.php.net/package/$_pkgname"
arch="all"
license="ASL-2.0"
depends=""
makedepends="autoconf libcouchbase-dev zlib-dev"
subpackages=""
source="http://pecl.php.net/get/$_pkgname-$pkgver.tgz"
builddir="$srcdir/$_pkgname-$pkgver"

_phpversions="5 7"
for _v in $_phpversions; do
	makedepends="$makedepends php$_v-dev"
	subpackages="$subpackages php$_v-${pkgname#php-}:_subpackage"
done

prepare() {
	default_prepare || return 1

	local ver; for ver in $_phpversions; do
		cp -ar "$builddir" "$builddir-$ver"
	done
}

build() {
	local ver; for ver in $_phpversions; do
		cd "$builddir-$ver"

		phpize$ver || return 1
		./configure --prefix=/usr \
			--with-php-config=/usr/bin/php-config$ver || return 1
		make || return 1
		make test || return 1
	done
}

package() {
	mkdir -p "$pkgdir"
}

_subpackage() {
	local ver="${subpkgname:3:1}"
	pkgdesc="$pkgdesc (for PHP $ver)"
	depends="$depends php$ver"
	install_if="$pkgname=$pkgver-r$pkgrel php$ver"
	[ "$ver" = 5 ] && replaces="$pkgname"

	make -C "$builddir-$ver" INSTALL_ROOT="$subpkgdir" install || return 1

	install -d "$subpkgdir"/etc/php$ver/conf.d || return 1
	echo "extension=$_pkgname.so" > "$subpkgdir"/etc/php$ver/conf.d/$_pkgname.ini
}

md5sums="f58ee1596ade978832f033f2e1662579  couchbase-2.2.3.tgz"
sha256sums="5c998e9c98e51a783a5d74ec36aa6ac740a4a958dd8c206ed9e9d1580234907f  couchbase-2.2.3.tgz"
sha512sums="d1feeb33a8ce450919731d17f84b170eaa68da104cedfe8ffa56f4e2e6062e250077d00babaca4872cc5bf271509daee2ca83e35cfb4b8ceef4b402cc20c1bf3  couchbase-2.2.3.tgz"