summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2016-11-15 16:42:33 +0000
committerTony Vroon <chainsaw@gentoo.org>2016-11-15 16:42:33 +0000
commit5654ae0877a025b09fe1e642eb48da392e9b9db6 (patch)
treebf41ff0d1ce58e67ae74faf37e09bc93c4db3c23 /app-admin/mongo-tools
parentsci-electronics/qucs: Avoid automagic dep on mpi (diff)
downloadgentoo-5654ae0877a025b09fe1e642eb48da392e9b9db6.tar.gz
gentoo-5654ae0877a025b09fe1e642eb48da392e9b9db6.tar.bz2
gentoo-5654ae0877a025b09fe1e642eb48da392e9b9db6.zip
app-admin/mongo-tools: Build PIE (Position Independent Executables) to avoid text relocations. Patch by "runtarod" closes bug #582854.
Package-Manager: portage-2.3.0
Diffstat (limited to 'app-admin/mongo-tools')
-rw-r--r--app-admin/mongo-tools/files/mongo-tools-3.2.10-pie.patch12
-rw-r--r--app-admin/mongo-tools/mongo-tools-3.2.10-r1.ebuild58
2 files changed, 70 insertions, 0 deletions
diff --git a/app-admin/mongo-tools/files/mongo-tools-3.2.10-pie.patch b/app-admin/mongo-tools/files/mongo-tools-3.2.10-pie.patch
new file mode 100644
index 000000000000..6a80d75b2cb9
--- /dev/null
+++ b/app-admin/mongo-tools/files/mongo-tools-3.2.10-pie.patch
@@ -0,0 +1,12 @@
+diff -uNr mongo-tools-r3.2.10.ORIG/build.sh mongo-tools-r3.2.10/build.sh
+--- mongo-tools-r3.2.10.ORIG/build.sh 2016-11-15 16:15:09.487441283 +0000
++++ mongo-tools-r3.2.10/build.sh 2016-11-15 16:15:23.127235064 +0000
+@@ -22,7 +22,7 @@
+
+ for i in bsondump mongostat mongofiles mongoexport mongoimport mongorestore mongodump mongotop mongooplog; do
+ echo "Building ${i}..."
+- go build -o "bin/$i" -tags "$tags" "$i/main/$i.go"
++ go build -buildmode=pie -o "bin/$i" -tags "$tags" "$i/main/$i.go"
+ ./bin/$i --version
+ done
+
diff --git a/app-admin/mongo-tools/mongo-tools-3.2.10-r1.ebuild b/app-admin/mongo-tools/mongo-tools-3.2.10-r1.ebuild
new file mode 100644
index 000000000000..0e5c5ccf2c02
--- /dev/null
+++ b/app-admin/mongo-tools/mongo-tools-3.2.10-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+MY_PV=${PV/_rc/-rc}
+MY_P=${PN}-r${MY_PV}
+
+DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
+HOMEPAGE="http://www.mongodb.org"
+SRC_URI="https://github.com/mongodb/mongo-tools/archive/r${MY_PV}.tar.gz -> mongo-tools-${MY_PV}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="sasl ssl"
+
+# Maintainer note:
+# openssl DEPEND constraint, see:
+# https://github.com/mongodb/mongo-tools/issues/11
+
+RDEPEND="!<dev-db/mongodb-3.0.0"
+DEPEND="${RDEPEND}
+ dev-lang/go:=
+ sasl? ( dev-libs/cyrus-sasl )
+ ssl? ( dev-libs/openssl )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ sed -e 's|go build .*|go build -o "bin/$i" -tags "$tags" "$i/main/$i.go"|g' -i build.sh || die
+
+ # ensure we use bash wrt #582906
+ sed -e 's@/bin/sh@/bin/bash@g' -i build.sh || die
+
+ epatch "${FILESDIR}/${P}-pie.patch"
+}
+
+src_compile() {
+ local myconf
+
+ if use sasl; then
+ myconf="${myconf} sasl"
+ fi
+
+ if use ssl; then
+ myconf="${myconf} ssl"
+ fi
+
+ ./build.sh ${myconf} || die "build failed"
+}
+
+src_install() {
+ dobin bin/*
+}