aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mongo-php7-driver/APKBUILD
blob: 31c9d467714c86bba12fa6bfeed52b8f005782b5 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>

test -e ../libbson/APKBUILD && . ../libbson/APKBUILD && libbson_ver=$pkgver || return 1
test -e ../mongo-c-driver/APKBUILD && . ../mongo-c-driver/APKBUILD && mongocdrv_ver=$pkgver || return 1

_php=php7
pkgname=mongo-${_php}-driver
_realname=mongo-php-driver
pkgver=1.1.9
pkgrel=1
pkgdesc="Low-level PHP driver for MongoDB"
url="https://github.com/mongodb/mongo-php-driver"
arch="all"
license="Apache2"
makedepends="autoconf automake libressl-dev pkgconfig
	mongo-c-driver pcre-dev ${_php}-dev"
options="!check" #fails, is attended
subpackages=""
install=""
source="$pkgname-$pkgver.tar.gz::https://github.com/mongodb/$_realname/archive/$pkgver.tar.gz
	libbson-${libbson_ver}.tar.gz::https://github.com/mongodb/libbson/archive/${libbson_ver}.tar.gz
	mongo-c-driver-${mongocdrv_ver}.tar.gz::https://github.com/mongodb/mongo-c-driver/archive/${mongocdrv_ver}.tar.gz
	mongodb.ini
	"

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

unpack() {
	local u
	if [ -z "$force" ]; then
		verify || return 1
		initdcheck || return 1
	fi
	mkdir -p "$srcdir"
	for u in $source; do
		local s="$SRCDEST/$(filename_from_uri $u)"
		echo $s
		case "$s" in
			*$pkgname-$pkgver.*)
				msg "Unpacking $s..."
				tar xzf "$s" -C "$srcdir" || return 1;;
			*libbson*)
				msg "Unpacking $s..."
				tar xzf "$s" --strip 1 -C "$srcdir"/$_realname-$pkgver/src/libbson || return 1;;
			*mongo-c-driver*)
				msg "Unpacking $s..."
				tar xzf "$s" --strip 1 -C "$srcdir"/$_realname-$pkgver/src/libmongoc || return 1;;
		esac
	done
}

prepare() {
	cd "$builddir"
	phpize || return 1
}

build() {
	cd "$builddir"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

package() {
	cd "$builddir"
	make INSTALL_ROOT="$pkgdir" EXTENSION_DIR="/usr/lib/$_php/modules" \
		install
	install -D -m644 "$srcdir"/mongodb.ini \
		"$pkgdir"/etc/${_php}/conf.d/mongodb.ini
}

check() {
	cd "$builddir"
	make test
}

sha512sums="7bb82d1f89b907598328e3ade3cbbafc541b6a104531a4eaf10ad9ea1fbc56b1b222618871e1d15410708b9eeceb88464722f0c9eb719781366d785bf5d6a7ca  mongo-php7-driver-1.1.9.tar.gz
cf6fb3e95b0bc49517190ebbf8592e57934866510c4f00ac04406f013ebca4873d3f615d98b4e36437f8b676f0434209d7321e45e5d131e144d294031f06cc59  libbson-1.3.6.tar.gz
d4f04fe74ca757cbd04d68903dca80a104701e85c809d5acd21ad2b8d98368a24f1951700694b7acc853c405e66d44521aa82c933c23300e7f2c354c01d7bc24  mongo-c-driver-1.3.6.tar.gz
acc09667ce1ceb1b5854a2d80f635be6ca7539df5a59043ff80e96759150e1715e5d16f8e97612ec43b504e50d08cda71da416b91d5d4da54f8284da1eefa2f3  mongodb.ini"