net-ftp/pure-ftpd: Removed old.
[gentoo.git] / app-admin / mongo-tools / mongo-tools-3.6.2.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 MY_PV=${PV/_rc/-rc}
7 MY_P=${PN}-r${MY_PV}
8
9 DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
10 HOMEPAGE="https://www.mongodb.org"
11 SRC_URI="https://github.com/mongodb/mongo-tools/archive/r${MY_PV}.tar.gz -> mongo-tools-${MY_PV}.tar.gz"
12
13 LICENSE="Apache-2.0"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="sasl ssl"
17
18 RDEPEND="!<dev-db/mongodb-3.0.0"
19 DEPEND="${RDEPEND}
20         dev-lang/go:=
21         net-libs/libpcap
22         sasl? ( dev-libs/cyrus-sasl )
23         ssl? ( dev-libs/openssl:0= )"
24
25 S=${WORKDIR}/${MY_P}
26
27 src_prepare() {
28         default
29
30         # do not substitute version because it uses git
31         sed -i '/^sed/,+3d' build.sh || die
32         sed -i '/^stty/d' build.sh || die
33         sed -i '/^mv/d' build.sh || die
34
35         # build pie to avoid text relocations wrt #582854
36         # skip on ppc64 wrt #610984
37         if ! use ppc64; then
38                 sed -i 's/\(go build\)/\1 -buildmode=pie/g' build.sh || die
39         fi
40
41         # ensure we use bash wrt #582906
42         sed -i 's@/bin/sh@/bin/bash@g' build.sh || die
43 }
44
45 src_compile() {
46         local myconf=()
47
48         if use sasl; then
49           myconf+=(sasl)
50         fi
51
52         if use ssl; then
53           myconf+=(ssl)
54         fi
55
56         ./build.sh ${myconf[@]} || die "build failed"
57 }
58
59 src_install() {
60         dobin bin/*
61 }