Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ruby/
Date: Sun, 23 Jul 2017 08:49:22
Message-Id: 1500799731.0073ad68aa2f375dfd8ad1ee012a45250099fa7e.graaff@gentoo
1 commit: 0073ad68aa2f375dfd8ad1ee012a45250099fa7e
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 23 08:48:51 2017 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 23 08:48:51 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0073ad68
7
8 dev-lang/ruby: fix security bugs
9
10 Fix SMTP command injection, bug 621878
11 Fix weak DH group, bug 571194
12
13 Package-Manager: Portage-2.3.6, Repoman-2.3.2
14
15 dev-lang/ruby/Manifest | 1 +
16 dev-lang/ruby/ruby-2.3.4-r3.ebuild | 242 +++++++++++++++++++++++++++++++++++++
17 2 files changed, 243 insertions(+)
18
19 diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest
20 index 28dedaabd35..69b34e9440d 100644
21 --- a/dev-lang/ruby/Manifest
22 +++ b/dev-lang/ruby/Manifest
23 @@ -13,6 +13,7 @@ DIST ruby-patches-2.2.7-r3.tar.bz2 5757 SHA256 3470915805a6264ad74a9c7cb7280c4be
24 DIST ruby-patches-2.3.3-r1.tar.bz2 2223 SHA256 f0a803173564368e5cf31162e1dba901c46640f9e861255f6cbe14256d18f3eb SHA512 bb47000e516017c1fedf7c5313b0628fa734030e69bd0fed1c06a38dd115b8c50837e3dd917f272e24abf5609c4c12793ae4570bfd7d6210290785bf2f8287bd WHIRLPOOL 0b0d4dcf7df4ff3ff11610bfe7a7b29ed621b45b412cb7618a6572f98a568ac67419bd852b193cfc3aa0968382cf9400a578511e9e8fb8b2125bc876e733bd64
25 DIST ruby-patches-2.3.4-r1.tar.bz2 2255 SHA256 32bb888f3ea9e81e4fdff5e852493aafc8f12bfcf9997981f7b7588d6e8ec9c1 SHA512 af7ad3255cf8450859e3c5564393ca106893fd1e40178ad153fb8e66871d30e326f63d48c1904fac5c353408f71e767c72d49fdbf47198c041a628b41c51c868 WHIRLPOOL dc412a788ec77dc9dad4fd631fc8aa5c909b9d21bf6b0b538c4ba398c1670cb01fbf1e4d92a38fa869b96f786707a9c45c7fe5ca7e04f75ff428b20d9fb34c53
26 DIST ruby-patches-2.3.4-r2.tar.bz2 3423 SHA256 5bea5f60033bfaf711c62004dfb4ed3d677b3a96d98de30ffe18ccd40c8533c3 SHA512 502bceb711e4ae1add64dde1ca94cfbb09c8a69010b8e640bb41d8278c0bb8073d3b6c3350217b9775a76746d3bdbc46f0b51342f4812e36341f0671c574d28e WHIRLPOOL cae21a87e76e3da40ee8d2a73c028bc658c6e6b6860b9f4e656fb769830734396a1ccf47453f355636e252fe3f8d3fc44d427d08249c08f37a6fdbffcdc25c8e
27 +DIST ruby-patches-2.3.4-r3.tar.bz2 4698 SHA256 196bbafe0c43718b4e2120e2e4d681befe9ccba1d2607fb9459d670c74d5bd38 SHA512 f2867c3460e3a276849b09bd367949024aa8c0e4631fef6bd46e1ef44d56dfe2a7baa88ea640b8953252e566d7927178da50195b6382d8fd8e1b9ef7d9ceb2fc WHIRLPOOL 9ba584dcc0055f4401f4345da7b161d08b4a4651ea669b7a26c7504d3aeb650051080d089652c2ae39e0163609cbef1f480a46555a4f3af8297180215929d472
28 DIST ruby-patches-2.3.4.tar.bz2 2255 SHA256 32bb888f3ea9e81e4fdff5e852493aafc8f12bfcf9997981f7b7588d6e8ec9c1 SHA512 af7ad3255cf8450859e3c5564393ca106893fd1e40178ad153fb8e66871d30e326f63d48c1904fac5c353408f71e767c72d49fdbf47198c041a628b41c51c868 WHIRLPOOL dc412a788ec77dc9dad4fd631fc8aa5c909b9d21bf6b0b538c4ba398c1670cb01fbf1e4d92a38fa869b96f786707a9c45c7fe5ca7e04f75ff428b20d9fb34c53
29 DIST ruby-patches-2.4.1-r1.tar.bz2 2047 SHA256 9560b8e8dc4a5517814df07aa635c9269f5e7cff5a15827a25a9f0811194e450 SHA512 b35db875a7e4a226e75eb6f7bc68b4bc97cc699bdc5f6930015e55cdc324b67b9883a2aa574c9c9a8b5dc5345c4df8a5ca8ace5b794b3e4de6517f3eefd25745 WHIRLPOOL fc5d226f46fe4ee1c86f6fff51ec9184b8c0ec08a1793eab365437d4ce2fd573cfc8857386cd10932f7dde05254bc975eff5b7986aea429730c606147fae2a5c
30 DIST ruby-patches-2.4.1-r2.tar.bz2 4030 SHA256 f1beac832d3bd94b8a0be137da845ce96edd574be61f25945150e9a351e4ee73 SHA512 e3f141710a23e4716696fdd5fd898386b32ce6e9d729738591bde8a74f9af8353e0a3f5f9c48403443c6c1ee074b5c2f3b5e9503d96b57de5c6c484ccb337b40 WHIRLPOOL 327404741b8448f7d49ad3ca3cfe915b60881348fc98e18027276f26d4381237f67b7f8d849df765e76184c2f4a92861b585ddf9b25dcb485e4ac5e2b4ad43cd
31
32 diff --git a/dev-lang/ruby/ruby-2.3.4-r3.ebuild b/dev-lang/ruby/ruby-2.3.4-r3.ebuild
33 new file mode 100644
34 index 00000000000..c3c8f0b9277
35 --- /dev/null
36 +++ b/dev-lang/ruby/ruby-2.3.4-r3.ebuild
37 @@ -0,0 +1,242 @@
38 +# Copyright 1999-2017 Gentoo Foundation
39 +# Distributed under the terms of the GNU General Public License v2
40 +
41 +EAPI=5
42 +
43 +#PATCHSET=1
44 +
45 +inherit autotools eutils flag-o-matic multilib versionator
46 +
47 +MY_P="${PN}-$(get_version_component_range 1-3)"
48 +S=${WORKDIR}/${MY_P}
49 +
50 +SLOT=$(get_version_component_range 1-2)
51 +MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
52 +RUBYVERSION=2.3.0
53 +
54 +if [[ -n ${PATCHSET} ]]; then
55 + if [[ ${PVR} == ${PV} ]]; then
56 + PATCHSET="${PV}-r0.${PATCHSET}"
57 + else
58 + PATCHSET="${PVR}.${PATCHSET}"
59 + fi
60 +else
61 + PATCHSET="${PVR}"
62 +fi
63 +
64 +DESCRIPTION="An object-oriented scripting language"
65 +HOMEPAGE="http://www.ruby-lang.org/"
66 +SRC_URI="mirror://ruby/${SLOT}/${MY_P}.tar.xz
67 + https://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
68 +
69 +LICENSE="|| ( Ruby-BSD BSD-2 )"
70 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
71 +IUSE="berkdb debug doc examples gdbm ipv6 jemalloc libressl +rdoc rubytests socks5 ssl tk xemacs ncurses +readline"
72 +
73 +RDEPEND="
74 + berkdb? ( sys-libs/db:= )
75 + gdbm? ( sys-libs/gdbm )
76 + jemalloc? ( dev-libs/jemalloc )
77 + ssl? (
78 + !libressl? ( dev-libs/openssl:0= )
79 + libressl? ( dev-libs/libressl )
80 + )
81 + socks5? ( >=net-proxy/dante-1.1.13 )
82 + tk? (
83 + dev-lang/tcl:0=[threads]
84 + dev-lang/tk:0=[threads]
85 + )
86 + ncurses? ( sys-libs/ncurses:0= )
87 + readline? ( sys-libs/readline:0= )
88 + dev-libs/libyaml
89 + virtual/libffi
90 + sys-libs/zlib
91 + >=app-eselect/eselect-ruby-20151229
92 + !<dev-ruby/rdoc-3.9.4
93 + !<dev-ruby/rubygems-1.8.10-r1"
94 +
95 +DEPEND="${RDEPEND}"
96 +
97 +BUNDLED_GEMS="
98 + >=dev-ruby/did_you_mean-1.0.0:1[ruby_targets_ruby23]
99 + >=dev-ruby/minitest-5.8.3[ruby_targets_ruby23]
100 + >=dev-ruby/net-telnet-0.1.1[ruby_targets_ruby23]
101 + >=dev-ruby/power_assert-0.2.6[ruby_targets_ruby23]
102 + >=dev-ruby/rake-10.4.2[ruby_targets_ruby23]
103 + >=dev-ruby/test-unit-3.1.5[ruby_targets_ruby23]
104 +"
105 +
106 +PDEPEND="
107 + ${BUNDLED_GEMS}
108 + virtual/rubygems[ruby_targets_ruby23]
109 + >=dev-ruby/json-1.8.3[ruby_targets_ruby23]
110 + rdoc? ( >=dev-ruby/rdoc-4.2.1[ruby_targets_ruby23] )
111 + xemacs? ( app-xemacs/ruby-modes )"
112 +
113 +src_prepare() {
114 + EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
115 + epatch "${WORKDIR}/patches"
116 +
117 + einfo "Unbundling gems..."
118 + cd "$S"
119 + # Remove bundled gems that we will install via PDEPEND, bug
120 + # 539700. Use explicit version numbers to ensure rm fails when they
121 + # change so we can update dependencies accordingly.
122 + rm -f gems/{did_you_mean-1.0.0,minitest-5.8.3,net-telnet-0.1.1,power_assert-0.2.6,rake-10.4.2,test-unit-3.1.5}.gem || die
123 +
124 + # Fix a hardcoded lib path in configure script
125 + sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
126 + configure.in || die "sed failed"
127 +
128 + eautoreconf
129 +}
130 +
131 +src_configure() {
132 + local modules= myconf=
133 +
134 + # -fomit-frame-pointer makes ruby segfault, see bug #150413.
135 + filter-flags -fomit-frame-pointer
136 + # In many places aliasing rules are broken; play it safe
137 + # as it's risky with newer compilers to leave it as it is.
138 + append-flags -fno-strict-aliasing
139 + # SuperH needs this
140 + use sh && append-flags -mieee
141 +
142 + # Socks support via dante
143 + if use socks5 ; then
144 + # Socks support can't be disabled as long as SOCKS_SERVER is
145 + # set and socks library is present, so need to unset
146 + # SOCKS_SERVER in that case.
147 + unset SOCKS_SERVER
148 + fi
149 +
150 + # Increase GC_MALLOC_LIMIT if set (default is 8000000)
151 + if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
152 + append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
153 + fi
154 +
155 + # ipv6 hack, bug 168939. Needs --enable-ipv6.
156 + use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
157 +
158 + # Determine which modules *not* to build depending in the USE flags.
159 + if ! use readline ; then
160 + modules="${modules},readline"
161 + fi
162 + if ! use berkdb ; then
163 + modules="${modules},dbm"
164 + fi
165 + if ! use gdbm ; then
166 + modules="${modules},gdbm"
167 + fi
168 + if ! use ssl ; then
169 + modules="${modules},openssl"
170 + fi
171 + if ! use ncurses ; then
172 + modules="${modules},curses"
173 + fi
174 + if ! use tk ; then
175 + modules="${modules},tk"
176 + fi
177 +
178 + # Provide an empty LIBPATHENV because we disable rpath but we do not
179 + # need LD_LIBRARY_PATH by default since that breaks USE=multitarget
180 + # #564272
181 + INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \
182 + --program-suffix=${MY_SUFFIX} \
183 + --with-soname=ruby${MY_SUFFIX} \
184 + --docdir=${EPREFIX}/usr/share/doc/${P} \
185 + --enable-shared \
186 + --enable-pthread \
187 + --disable-rpath \
188 + --with-out-ext="${modules}" \
189 + $(use_with jemalloc jemalloc) \
190 + $(use_enable socks5 socks) \
191 + $(use_enable doc install-doc) \
192 + --enable-ipv6 \
193 + $(use_enable debug) \
194 + ${myconf} \
195 + --enable-option-checking=no \
196 + || die "econf failed"
197 +}
198 +
199 +src_compile() {
200 + emake V=1 EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
201 +}
202 +
203 +src_test() {
204 + emake -j1 V=1 test || die "make test failed"
205 +
206 + elog "Ruby's make test has been run. Ruby also ships with a make check"
207 + elog "that cannot be run until after ruby has been installed."
208 + elog
209 + if use rubytests; then
210 + elog "You have enabled rubytests, so they will be installed to"
211 + elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
212 + elog "than root, and you must place them into a writeable directory."
213 + elog "Then call: "
214 + elog
215 + elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
216 + else
217 + elog "Enable the rubytests USE flag to install the make check tests"
218 + fi
219 +}
220 +
221 +src_install() {
222 + # Remove the remaining bundled gems. We do this late in the process
223 + # since they are used during the build to e.g. create the
224 + # documentation.
225 + rm -rf ext/json || die
226 +
227 + # Ruby is involved in the install process, we don't want interference here.
228 + unset RUBYOPT
229 +
230 + local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
231 +
232 + LD_LIBRARY_PATH="${S}:${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
233 + RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
234 + for d in $(find "${S}/ext" -type d) ; do
235 + RUBYLIB="${RUBYLIB}:$d"
236 + done
237 + export LD_LIBRARY_PATH RUBYLIB
238 +
239 + emake V=1 DESTDIR="${D}" install || die "make install failed"
240 +
241 + # Remove installed rubygems and rdoc copy
242 + rm -rf "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
243 + rm -rf "${D}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
244 + rm -rf "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
245 + rm -rf "${D}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
246 +
247 + if use doc; then
248 + make DESTDIR="${D}" install-doc || die "make install-doc failed"
249 + fi
250 +
251 + if use examples; then
252 + insinto /usr/share/doc/${PF}
253 + doins -r sample
254 + fi
255 +
256 + dodoc ChangeLog NEWS doc/NEWS* README* || die
257 +
258 + if use rubytests; then
259 + pushd test
260 + insinto /usr/share/${PN}-${SLOT}/test
261 + doins -r .
262 + popd
263 + fi
264 +}
265 +
266 +pkg_postinst() {
267 + if [[ ! -n $(readlink "${ROOT}"usr/bin/ruby) ]] ; then
268 + eselect ruby set ruby${MY_SUFFIX}
269 + fi
270 +
271 + elog
272 + elog "To switch between available Ruby profiles, execute as root:"
273 + elog "\teselect ruby set ruby(19|20|...)"
274 + elog
275 +}
276 +
277 +pkg_postrm() {
278 + eselect ruby cleanup
279 +}