app-admin/mongo-tools: bump to 3.4.9
[gentoo.git] / app-admin / mongo-tools / mongo-tools-3.2.13.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit eutils
7
8 MY_PV=${PV/_rc/-rc}
9 MY_P=${PN}-r${MY_PV}
10
11 DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
12 HOMEPAGE="http://www.mongodb.org"
13 SRC_URI="https://github.com/mongodb/mongo-tools/archive/r${MY_PV}.tar.gz -> mongo-tools-${MY_PV}.tar.gz"
14
15 LICENSE="Apache-2.0"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="sasl ssl"
19
20 # Maintainer note:
21 # openssl DEPEND constraint, see:
22 # https://github.com/mongodb/mongo-tools/issues/11
23
24 RDEPEND="!<dev-db/mongodb-3.0.0"
25 DEPEND="${RDEPEND}
26         dev-lang/go:=
27         net-libs/libpcap
28         sasl? ( dev-libs/cyrus-sasl )
29         ssl? ( dev-libs/openssl )"
30
31 S=${WORKDIR}/${MY_P}
32
33 src_prepare() {
34         sed -e 's|go build .*|go build -o "bin/$i" -tags "$tags" "$i/main/$i.go"|g' -i build.sh || die
35
36         # ensure we use bash wrt #582906
37         sed -e 's@/bin/sh@/bin/bash@g' -i build.sh || die
38
39         epatch "${FILESDIR}/${PN}-3.2.10-pie.patch"
40 }
41
42 src_compile() {
43         local myconf
44
45         if use sasl; then
46           myconf="${myconf} sasl"
47         fi
48
49         if use ssl; then
50           myconf="${myconf} ssl"
51         fi
52
53         ./build.sh ${myconf} || die "build failed"
54 }
55
56 src_install() {
57         dobin bin/*
58 }