aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mongodb-tools/APKBUILD
blob: 729ee8ed00a7411561743b0abb43178207a3eae2 (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
# Contributor: Marc Vertes <marc.vertes@ugrid.net>
# Maintainer: Marc Vertes <marc.vertes@ugrid.net>
pkgname=mongodb-tools
pkgver=r3.2.4
pkgrel=0
pkgdesc="The MongoDB tools provide import, export, and diagnostic capabilities."
url="https://github.com/mongodb/mongo-tools"
arch="all"
license="apache"
depends="libsasl"
depends_dev=""
makedepends="$depends_dev go cyrus-sasl-dev openssl-dev"
install=""
subpackages=""
source="https://github.com/mongodb/mongo-tools/archive/$pkgver/$pkgname-$pkgver.tar.gz"

_builddir="$srcdir"/mongo-tools-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	local ldflags
	cd "$_builddir"
	. ./set_gopath.sh
	mkdir -p bin
	ldflags="-X github.com/mongodb/mongo-tools/common/options.Gitspec=`git rev-parse HEAD`"
	for i in bsondump mongostat mongofiles mongoexport mongoimport mongorestore mongodump mongotop mongooplog
	do
		echo "Building $i"
		go build -ldflags "$ldflags" -o "bin/$i" -tags "ssl sasl" "$i/main/$i.go"
	done
}

package() {
	cd "$_builddir/bin"
	local bindir="$pkgdir/usr/bin"
	mkdir -p "$bindir" || return 1
	cp bsondump mongostat mongofiles mongoexport mongoimport mongorestore mongodump mongotop mongooplog "$bindir" || return 1
}

md5sums="d4ac35044dd2bf91979f25a78c69612a  mongodb-tools-r3.2.4.tar.gz"
sha256sums="9d52028fb2be6a6e0a779aa73587c52ccd5fa59b258e26e5c2c3fce167599138  mongodb-tools-r3.2.4.tar.gz"
sha512sums="d34ad87bb2a53c9df0124c26a4c200236aa889c7a5bd09a3b535acd4b18c5757018e78813fa04b48b359004eb9097853b49fd359617e71f66e41ef71da01c222  mongodb-tools-r3.2.4.tar.gz"