app-admin/mongo-tools: bump to 3.4.9
[gentoo.git] / app-admin / mongo-tools / mongo-tools-3.4.9.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
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="https://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 libressl"
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? (
30                 !libressl? ( dev-libs/openssl:0= )
31                 libressl? ( dev-libs/libressl:0= )
32         )"
33
34 S=${WORKDIR}/${MY_P}
35
36 src_prepare() {
37         # do not substitute version because it uses git
38         sed -i '/^sed/,+3d' build.sh || die
39         sed -i '/^mv/d' build.sh || die
40
41         # build pie to avoid text relocations wrt #582854
42         # skip on ppc64 wrt #610984
43         if ! use ppc64; then
44                 sed -i 's/\(go build\)/\1 -buildmode=pie/g' build.sh || die
45         fi
46
47         # ensure we use bash wrt #582906
48         sed -i 's@/bin/sh@/bin/bash@g' build.sh || die
49
50         default
51 }
52
53 src_compile() {
54         declare -a myconf
55
56         if use sasl; then
57           myconf+=(sasl)
58         fi
59
60         if use ssl; then
61           myconf+=(ssl)
62         fi
63
64         ./build.sh ${myconf[@]} || die "build failed"
65 }
66
67 src_install() {
68         dobin bin/*
69 }