Gentoo Archives: gentoo-commits

From: Alexys Jacob <ultrabug@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/mongodb/
Date: Thu, 15 Feb 2018 15:02:08
Message-Id: 1518706909.1309205004f9e99a0cf1c2d30eb9688925fdb698.ultrabug@gentoo
1 commit: 1309205004f9e99a0cf1c2d30eb9688925fdb698
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Wed Feb 14 15:30:02 2018 +0000
4 Commit: Alexys Jacob <ultrabug <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 15 15:01:49 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13092050
7
8 dev-db/mongodb: improve ebuild
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11 Closes: https://github.com/gentoo/gentoo/pull/7184
12
13 dev-db/mongodb/mongodb-3.4.13.ebuild | 102 +++++++++++++----------------------
14 1 file changed, 38 insertions(+), 64 deletions(-)
15
16 diff --git a/dev-db/mongodb/mongodb-3.4.13.ebuild b/dev-db/mongodb/mongodb-3.4.13.ebuild
17 index f13cbc11f44..3869755fe9f 100644
18 --- a/dev-db/mongodb/mongodb-3.4.13.ebuild
19 +++ b/dev-db/mongodb/mongodb-3.4.13.ebuild
20 @@ -10,12 +10,12 @@ CHECKREQS_DISK_BUILD="2400M"
21 CHECKREQS_DISK_USR="512M"
22 CHECKREQS_MEMORY="1024M"
23
24 -inherit eutils flag-o-matic multilib multiprocessing pax-utils python-any-r1 scons-utils systemd toolchain-funcs user versionator check-reqs
25 +inherit check-reqs eutils flag-o-matic multilib multiprocessing pax-utils python-single-r1 scons-utils systemd toolchain-funcs user versionator
26
27 MY_P=${PN}-src-r${PV/_rc/-rc}
28
29 DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
30 -HOMEPAGE="http://www.mongodb.org"
31 +HOMEPAGE="https://www.mongodb.com"
32 SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz"
33
34 LICENSE="AGPL-3 Apache-2.0"
35 @@ -36,16 +36,15 @@ RDEPEND=">=app-arch/snappy-1.1.3
36 libressl? ( dev-libs/libressl:0= )
37 )"
38 DEPEND="${RDEPEND}
39 - =dev-lang/python-2*
40 + ${PYTHON_DEPS}
41 <dev-util/scons-3
42 - >=sys-devel/gcc-5.3.0:*
43 sys-libs/ncurses
44 sys-libs/readline
45 debug? ( dev-util/valgrind )
46 kerberos? ( dev-libs/cyrus-sasl[kerberos] )
47 test? (
48 - dev-python/pymongo
49 - dev-python/pyyaml
50 + dev-python/pymongo[${PYTHON_USEDEP}]
51 + dev-python/pyyaml[${PYTHON_USEDEP}]
52 )"
53 PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )"
54
55 @@ -58,8 +57,8 @@ PATCHES=(
56 S=${WORKDIR}/${MY_P}
57
58 pkg_pretend() {
59 - if [[ ${REPLACING_VERSIONS} < 3.0 ]]; then
60 - ewarn "To upgrade from a version earlier than the 3.0-series, you must"
61 + if [[ -n ${REPLACING_VERSIONS} ]] && [[ ${REPLACING_VERSIONS} < 3.2 ]]; then
62 + ewarn "To upgrade from a version earlier than the 3.2-series, you must"
63 ewarn "successively upgrade major releases until you have upgraded"
64 ewarn "to 3.2-series. Then upgrade to 3.4 series."
65 fi
66 @@ -69,10 +68,20 @@ pkg_setup() {
67 enewgroup mongodb
68 enewuser mongodb -1 -1 /var/lib/${PN} mongodb
69
70 - # Maintainer notes
71 - #
72 + python-single-r1_pkg_setup
73 +}
74 +
75 +src_prepare() {
76 + default
77 +
78 + # remove bundled libs
79 + rm -rv src/third_party/{boost-*,pcre-*,scons-*,snappy-*,yaml-cpp-*,zlib-*} || die
80 +}
81 +
82 +src_configure() {
83 + # https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source
84 + # --use-system-icu fails tests
85 # --use-system-tcmalloc is strongly NOT recommended:
86 - # https://www.mongodb.org/about/contributors/tutorial/build-mongodb-from-source/
87
88 scons_opts=(
89 CC="$(tc-getCC)"
90 @@ -87,38 +96,32 @@ pkg_setup() {
91 --use-system-zlib
92 )
93
94 - if use debug; then
95 - scons_opts+=( --dbg=on )
96 - fi
97 -
98 - if use prefix; then
99 - scons_opts+=(
100 - --cpppath="${EPREFIX}/usr/include"
101 - --libpath="${EPREFIX}/usr/$(get_libdir)"
102 - )
103 - fi
104 -
105 - if use kerberos; then
106 - scons_opts+=( --use-sasl-client )
107 - fi
108 + use debug && scons_opts+=( --dbg=on )
109 + use kerberos && scons_opts+=( --use-sasl-client )
110 + use ssl && scons_opts+=( --ssl )
111
112 - if use ssl; then
113 - scons_opts+=( --ssl )
114 - fi
115 -
116 - python-any-r1_pkg_setup
117 -}
118 -
119 -src_compile() {
120 # respect mongoDB upstream's basic recommendations
121 # see bug #536688 and #526114
122 if ! use debug; then
123 filter-flags '-m*'
124 filter-flags '-O?'
125 fi
126 +
127 + default
128 +}
129 +
130 +src_compile() {
131 escons "${scons_opts[@]}" core tools
132 }
133
134 +# FEATURES="test -usersandbox" emerge dev-db/mongodb
135 +src_test() {
136 + # this one test fails
137 + rm jstests/core/jsHeapLimit.js || die
138 +
139 + "${EPYTHON}" ./buildscripts/resmoke.py --dbpathPrefix=test --suites core --jobs=$(makeopts_jobs) || die "Tests failed"
140 +}
141 +
142 src_install() {
143 escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr
144
145 @@ -157,37 +160,8 @@ pkg_preinst() {
146 fi
147 }
148
149 -# FEATURES="test -usersandbox" emerge dev-db/mongodb
150 -src_test() {
151 - # this one test fails
152 - rm jstests/core/jsHeapLimit.js || die
153 -
154 - "${EPYTHON}" ./buildscripts/resmoke.py --dbpathPrefix=test --suites core --jobs=$(makeopts_jobs) || die "Tests failed"
155 -}
156 -
157 pkg_postinst() {
158 - local v
159 - for v in ${REPLACING_VERSIONS}; do
160 - if ! version_is_at_least 3.0 ${v}; then
161 - ewarn "!! IMPORTANT !!"
162 - ewarn " "
163 - ewarn "${PN} configuration files have changed !"
164 - ewarn " "
165 - ewarn "Make sure you migrate from /etc/conf.d/${PN} to the new YAML standard in /etc/${PN}.conf"
166 - ewarn " http://docs.mongodb.org/manual/reference/configuration-options/"
167 - ewarn " "
168 - ewarn "Make sure you also follow the upgrading process :"
169 - ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/"
170 - ewarn " "
171 - ewarn "MongoDB 3.0 introduces the WiredTiger storage engine."
172 - ewarn "WiredTiger is incompatible with MMAPv1 and you need to dump/reload your data if you want to use it."
173 - ewarn "Once you have your data dumped, you need to set storage.engine: wiredTiger in /etc/${PN}.conf"
174 - ewarn " http://docs.mongodb.org/master/release-notes/3.0-upgrade/#change-storage-engine-to-wiredtiger"
175 - break
176 - fi
177 - done
178 -
179 ewarn "Make sure to read the release notes and follow the upgrade process:"
180 - ewarn " https://docs.mongodb.org/manual/release-notes/3.4/"
181 - ewarn " https://docs.mongodb.com/manual/release-notes/3.4/#upgrade-procedures"
182 + ewarn " https://docs.mongodb.com/manual/release-notes/$(get_version_component_range 1-2)/"
183 + ewarn " https://docs.mongodb.com/manual/release-notes/$(get_version_component_range 1-2)/#upgrade-procedures"
184 }