Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-shells/zsh/, app-shells/zsh/files/
Date: Mon, 02 Jul 2018 07:48:35
Message-Id: 1530517701.e544d4c60f846622daf1fffde0fede19dee03a7e.polynomial-c@gentoo
1 commit: e544d4c60f846622daf1fffde0fede19dee03a7e
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 2 07:47:58 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 2 07:48:21 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e544d4c6
7
8 app-shells/zsh: Security cleanup.
9
10 Bug: https://bugs.gentoo.org/651860
11 Package-Manager: Portage-2.3.41, Repoman-2.3.9
12
13 app-shells/zsh/Manifest | 4 -
14 app-shells/zsh/files/zprofile-1 | 42 -------
15 app-shells/zsh/files/zprofile-2 | 41 -------
16 app-shells/zsh/zsh-5.3.1.ebuild | 217 -------------------------------------
17 app-shells/zsh/zsh-5.4.2-r1.ebuild | 211 ------------------------------------
18 5 files changed, 515 deletions(-)
19
20 diff --git a/app-shells/zsh/Manifest b/app-shells/zsh/Manifest
21 index 5e51ca0f300..194f7e89c16 100644
22 --- a/app-shells/zsh/Manifest
23 +++ b/app-shells/zsh/Manifest
24 @@ -1,7 +1,3 @@
25 -DIST zsh-5.3.1-doc.tar.xz 3161408 BLAKE2B dc14f7b6136b73d5cfe8462fe67e20b92ee04741ad8f8a0f8d40bd1f8658261569722b156a075d7b723f2d38d41fc725e227c995eefebde433ea172399b90210 SHA512 27f9d50094c21a77b36fe3309a9ab81a2ccf6570139b11038bbebe9fff2d0701f0bccf9163f5bf47d51ce7b978df621a4cb9089c33e9179a61636fcc94a9fb9c
26 -DIST zsh-5.3.1.tar.xz 2928832 BLAKE2B b561629f8641dac70a5b35e12333fb3b214c83ebd90d432c302e8b8e6fb1baa288ec4d32fdb7f917c2f1a845b96a6c676ab4e15a014a8b9474792cb77e2afea0 SHA512 25f723c76d2779c3cb53de2e0dbb1163ec289f76282bec49757880d0ce32bf64a001a6b40c54c290d342aa09f92319af5c597bff99de8dbd1fc895c11836f304
27 -DIST zsh-5.4.2-doc.tar.xz 3198880 BLAKE2B 9ef3c6690251025b669a1cb46d3903d26a7407bc9fc0463c6d3678db57180b690f11302b202346a67afde16f6177fc8a597edca53bf55aaa835a5208e205b75e SHA512 5dcf561380ec46358754a0a03224152cb0db197d8a1558c6457342a6fd0ec6ea43bc3c1c1a79390a2a6034e09e0e668466962462ab14e90807170436a36f82b7
28 -DIST zsh-5.4.2.tar.gz 4482413 BLAKE2B c3b9eb2b1458d88d8849898fa468a5e8575ac06f7859c809e741410b672a61c877027d4d5057b8c2295e6f15ce1f2fed9c0ca3eacf4024b8478b9e1d287c0378 SHA512 5eaa2ff3dc8052dfb50d2be19bfeed1856b00f7c2dc698129c95c2373a516ee61dba5b42ded390ac20b171abe352b1875f177a4dda8fdc15a4f2a05bb7a024e2
29 DIST zsh-5.5-doc.tar.xz 3216400 BLAKE2B 3d07b336222b08d7deff0ded6f603a47bcdcec978e6ad9c244b25f5249e07c22768ba30e67f02c8ebf4a0a8104997d0aa8959de7e3c39a428dca0b013c56e9b1 SHA512 0bde166bc4a4b8ea7512bd9d3ede53478959cb76ded65488b9a8993734cf2a8ffedcd38254fbf6ff73a5841289cb65715579744b10748afb038c9d93a01f987b
30 DIST zsh-5.5.1-doc.tar.xz 3216632 BLAKE2B ef1274799604d74eb9cec3c29927703c98bb63bde3aa5ce4880eda45420fe1eb79c54a693fe529c9e79161f924a76bc2a650253216c7b1e565af65f1ac3c0d91 SHA512 e240f6c6aa2efb941c2baaaf749c66c9e304ba54ce2be90586671ba47e380aac89315516e5dce41fa0ae1d8fccfc36f61ed1400b6aab3382927e2715a77d62e6
31 DIST zsh-5.5.1.tar.gz 4578700 BLAKE2B b58fc763bc64e8ed6de0db2e0fd454aef995fcc86b18c2ffd4b39e037ce1cdeb04e6e2a44b2495ca89218af41ad1dd7d29e429d21fbab39377d95e62d249732e SHA512 c4f7327a3f5480bd9a169fb07e34812e0106fa9de3b5f7d38bb0db85a3e4d01b9a4a8f35553da03a15d7d819108305cfaa2811c945273e2cac84512219e69ebb
32
33 diff --git a/app-shells/zsh/files/zprofile-1 b/app-shells/zsh/files/zprofile-1
34 deleted file mode 100644
35 index e78ec265bf5..00000000000
36 --- a/app-shells/zsh/files/zprofile-1
37 +++ /dev/null
38 @@ -1,42 +0,0 @@
39 -# @GENTOO_PORTAGE_EPREFIX@/etc/zsh/zprofile
40 -
41 -# Load environment settings from profile.env, which is created by
42 -# env-update from the files in /etc/env.d
43 -if [ -e "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env ] ; then
44 - . "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env
45 -fi
46 -
47 -# You should override these in your ~/.zprofile (or equivalent) for per-user
48 -# settings. For system defaults, you can add a new file in /etc/profile.d/.
49 -export EDITOR=${EDITOR:-/bin/nano}
50 -export PAGER=${PAGER:-/usr/bin/less}
51 -
52 -# 077 would be more secure, but 022 is generally quite realistic
53 -umask 022
54 -
55 -# Set up PATH depending on whether we're root or a normal user.
56 -# There's no real reason to exclude sbin paths from the normal user,
57 -# but it can make tab-completion easier when they aren't in the
58 -# user's PATH to pollute the executable namespace.
59 -#
60 -# It is intentional in the following line to use || instead of -o.
61 -# This way the evaluation can be short-circuited and calling whoami is
62 -# avoided.
63 -if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
64 - @ZSH_NOPREFIX@PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
65 - @ZSH_PREFIX@PATH="@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/bin:${ROOTPATH}:/usr/sbin:/usr/bin:/sbin:/bin"
66 -else
67 - @ZSH_NOPREFIX@PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
68 - @ZSH_PREFIX@PATH="@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin:${PATH}:/usr/bin:/bin"
69 -fi
70 -export PATH
71 -unset ROOTPATH
72 -
73 -shopts=$-
74 -setopt nullglob
75 -for sh in "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.d/*.sh ; do
76 - [ -r "$sh" ] && . "$sh"
77 -done
78 -unsetopt nullglob
79 -set -$shopts
80 -unset sh shopts
81
82 diff --git a/app-shells/zsh/files/zprofile-2 b/app-shells/zsh/files/zprofile-2
83 deleted file mode 100644
84 index 9c4313c4494..00000000000
85 --- a/app-shells/zsh/files/zprofile-2
86 +++ /dev/null
87 @@ -1,41 +0,0 @@
88 -# @GENTOO_PORTAGE_EPREFIX@/etc/zsh/zprofile
89 -
90 -# Load environment settings from profile.env, which is created by
91 -# env-update from the files in /etc/env.d
92 -if [ -e "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env ] ; then
93 - . "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env
94 -fi
95 -
96 -# You should override these in your ~/.zprofile (or equivalent) for per-user
97 -# settings. For system defaults, you can add a new file in /etc/profile.d/.
98 -export EDITOR=${EDITOR:-/bin/nano}
99 -export PAGER=${PAGER:-/usr/bin/less}
100 -
101 -# 077 would be more secure, but 022 is generally quite realistic
102 -umask 022
103 -
104 -# Set up PATH depending on whether we're root or a normal user.
105 -# There's no real reason to exclude sbin paths from the normal user,
106 -# but it can make tab-completion easier when they aren't in the
107 -# user's PATH to pollute the executable namespace.
108 -#
109 -# It is intentional in the following line to use || instead of -o.
110 -# This way the evaluation can be short-circuited and calling whoami is
111 -# avoided.
112 -if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
113 - @ZSH_NOPREFIX@PATH="${ROOTPATH}"
114 - @ZSH_PREFIX@PATH="@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/bin:${ROOTPATH}:/usr/sbin:/usr/bin:/sbin:/bin"
115 -@ZSH_PREFIX@else
116 - @ZSH_PREFIX@PATH="@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin:${PATH}:/usr/bin:/bin"
117 -fi
118 -export PATH
119 -unset ROOTPATH
120 -
121 -shopts=$-
122 -setopt nullglob
123 -for sh in "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.d/*.sh ; do
124 - [ -r "$sh" ] && . "$sh"
125 -done
126 -unsetopt nullglob
127 -set -$shopts
128 -unset sh shopts
129
130 diff --git a/app-shells/zsh/zsh-5.3.1.ebuild b/app-shells/zsh/zsh-5.3.1.ebuild
131 deleted file mode 100644
132 index d84680e8533..00000000000
133 --- a/app-shells/zsh/zsh-5.3.1.ebuild
134 +++ /dev/null
135 @@ -1,217 +0,0 @@
136 -# Copyright 1999-2018 Gentoo Foundation
137 -# Distributed under the terms of the GNU General Public License v2
138 -
139 -EAPI=6
140 -
141 -inherit flag-o-matic prefix
142 -
143 -if [[ ${PV} == 9999* ]] ; then
144 - inherit git-r3 autotools
145 - EGIT_REPO_URI="git://git.code.sf.net/p/zsh/code"
146 -else
147 - KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
148 - SRC_URI="http://www.zsh.org/pub/${P}.tar.xz
149 - doc? ( http://www.zsh.org/pub/${P}-doc.tar.xz )"
150 -fi
151 -
152 -DESCRIPTION="UNIX Shell similar to the Korn shell"
153 -HOMEPAGE="http://www.zsh.org/"
154 -
155 -LICENSE="ZSH gdbm? ( GPL-2 )"
156 -SLOT="0"
157 -IUSE="caps debug doc examples gdbm maildir pcre static unicode"
158 -
159 -RDEPEND="
160 - >=sys-libs/ncurses-5.1:0=
161 - static? ( >=sys-libs/ncurses-5.7-r4:0=[static-libs] )
162 - caps? ( sys-libs/libcap )
163 - pcre? (
164 - >=dev-libs/libpcre-3.9
165 - static? ( >=dev-libs/libpcre-3.9[static-libs] )
166 - )
167 - gdbm? ( sys-libs/gdbm:= )
168 -"
169 -DEPEND="sys-apps/groff
170 - ${RDEPEND}"
171 -PDEPEND="
172 - examples? ( app-doc/zsh-lovers )
173 -"
174 -if [[ ${PV} == 9999* ]] ; then
175 - DEPEND+=" app-text/yodl
176 - doc? (
177 - sys-apps/texinfo
178 - app-text/texi2html
179 - virtual/latex-base
180 - )"
181 -fi
182 -
183 -src_prepare() {
184 - if [[ ${PV} != 9999* ]]; then
185 - # fix zshall problem with soelim
186 - ln -s Doc man1 || die
187 - mv Doc/zshall.1 Doc/zshall.1.soelim || die
188 - soelim Doc/zshall.1.soelim > Doc/zshall.1 || die
189 -
190 - # add openrc specific options for init.d completion
191 - eapply "${FILESDIR}"/${PN}-5.3-init.d-gentoo.diff
192 - fi
193 -
194 - cp "${FILESDIR}"/zprofile-1 "${T}"/zprofile || die
195 - eprefixify "${T}"/zprofile || die
196 - if use prefix ; then
197 - sed -i -e 's|@ZSH_PREFIX@||' -e '/@ZSH_NOPREFIX@/d' "${T}"/zprofile || die
198 - else
199 - sed -i -e 's|@ZSH_NOPREFIX@||' -e '/@ZSH_PREFIX@/d' -e 's|""||' "${T}"/zprofile || die
200 - fi
201 -
202 - eapply_user
203 -
204 - if [[ ${PV} == 9999* ]] ; then
205 - sed -i "/^VERSION=/s/=.*/=${PV}/" Config/version.mk || die
206 - eautoreconf
207 - fi
208 -}
209 -
210 -src_configure() {
211 - local myconf=()
212 -
213 - if use static ; then
214 - myconf+=( --disable-dynamic )
215 - append-ldflags -static
216 - fi
217 - if use debug ; then
218 - myconf+=(
219 - --enable-zsh-debug
220 - --enable-zsh-mem-debug
221 - --enable-zsh-mem-warning
222 - --enable-zsh-secure-free
223 - --enable-zsh-hash-debug
224 - )
225 - fi
226 -
227 - if [[ ${CHOST} == *-darwin* ]]; then
228 - myconf+=( --enable-libs=-liconv )
229 - append-ldflags -Wl,-x
230 - fi
231 -
232 - econf \
233 - --bindir="${EPREFIX}"/bin \
234 - --libdir="${EPREFIX}"/usr/$(get_libdir) \
235 - --enable-etcdir="${EPREFIX}"/etc/zsh \
236 - --enable-runhelpdir="${EPREFIX}"/usr/share/zsh/${PV%_*}/help \
237 - --enable-fndir="${EPREFIX}"/usr/share/zsh/${PV%_*}/functions \
238 - --enable-site-fndir="${EPREFIX}"/usr/share/zsh/site-functions \
239 - --enable-function-subdirs \
240 - --with-tcsetpgrp \
241 - $(use_enable maildir maildir-support) \
242 - $(use_enable pcre) \
243 - $(use_enable caps cap) \
244 - $(use_enable unicode multibyte) \
245 - $(use_enable gdbm ) \
246 - "${myconf[@]}"
247 -
248 - if use static ; then
249 - # compile all modules statically, see Bug #27392
250 - # removed cap and curses because linking failes
251 - sed -e "s,link=no,link=static,g" \
252 - -e "/^name=zsh\/cap/s,link=static,link=no," \
253 - -e "/^name=zsh\/curses/s,link=static,link=no," \
254 - -i "${S}"/config.modules || die
255 - if ! use gdbm ; then
256 - sed -i '/^name=zsh\/db\/gdbm/s,link=static,link=no,' \
257 - "${S}"/config.modules || die
258 - fi
259 - fi
260 -}
261 -
262 -src_compile() {
263 - default
264 -
265 - if [[ ${PV} == 9999* ]] && use doc ; then
266 - emake -C Doc everything
267 - fi
268 -}
269 -
270 -src_test() {
271 - addpredict /dev/ptmx
272 - local i
273 - for i in C02cond.ztst V08zpty.ztst X02zlevi.ztst Y01completion.ztst Y02compmatch.ztst Y03arguments.ztst ; do
274 - rm "${S}"/Test/${i} || die
275 - done
276 - emake check
277 -}
278 -
279 -src_install() {
280 - emake DESTDIR="${D}" install $(usex doc "install.info" "")
281 -
282 - insinto /etc/zsh
283 - doins "${T}"/zprofile
284 -
285 - keepdir /usr/share/zsh/site-functions
286 - insinto /usr/share/zsh/${PV%_*}/functions/Prompts
287 - newins "${FILESDIR}"/prompt_gentoo_setup-1 prompt_gentoo_setup
288 -
289 - local i
290 -
291 - # install miscellaneous scripts (bug #54520)
292 - sed -e "s:/usr/local/bin/perl:${EPREFIX}/usr/bin/perl:g" \
293 - -e "s:/usr/local/bin/zsh:${EPREFIX}/bin/zsh:g" \
294 - -i {Util,Misc}/* || die
295 - for i in Util Misc ; do
296 - insinto /usr/share/zsh/${PV%_*}/${i}
297 - doins ${i}/*
298 - done
299 -
300 - # install header files (bug #538684)
301 - insinto /usr/include/zsh
302 - doins config.h Src/*.epro
303 - for i in Src/{zsh.mdh,*.h} ; do
304 - sed -e 's@\.\./config\.h@config.h@' \
305 - -e 's@#\(\s*\)include "\([^"]\+\)"@#\1include <zsh/\2>@' \
306 - -i "${i}"
307 - doins "${i}"
308 - done
309 -
310 - dodoc ChangeLog* META-FAQ NEWS README config.modules
311 -
312 - if use doc ; then
313 - pushd "${WORKDIR}/${PN}-${PV%_*}" >/dev/null
314 - docinto html
315 - dodoc Doc/*.html
316 - insinto /usr/share/doc/${PF}
317 - doins Doc/zsh.{dvi,pdf}
318 - popd >/dev/null
319 - fi
320 -
321 - docinto StartupFiles
322 - dodoc StartupFiles/z*
323 -}
324 -
325 -pkg_postinst() {
326 - if [[ -z ${REPLACING_VERSIONS} ]] ; then
327 - echo
328 - elog "If you want to enable Portage completions and Gentoo prompt,"
329 - elog "emerge app-shells/gentoo-zsh-completions and add"
330 - elog " autoload -U compinit promptinit"
331 - elog " compinit"
332 - elog " promptinit; prompt gentoo"
333 - elog "to your ~/.zshrc"
334 - echo
335 - elog "Also, if you want to enable cache for the completions, add"
336 - elog " zstyle ':completion::complete:*' use-cache 1"
337 - elog "to your ~/.zshrc"
338 - echo
339 - elog "Note that a system zprofile startup file is installed. This will override"
340 - elog "PATH and possibly other variables that a user may set in ~/.zshenv."
341 - elog "Custom PATH settings and similar overridden variables can be moved to ~/.zprofile"
342 - elog "or other user startup files that are sourced after the system zprofile."
343 - echo
344 - elog "If PATH must be set in ~/.zshenv to affect things like non-login ssh shells,"
345 - elog "one method is to use a separate path-setting file that is conditionally sourced"
346 - elog "in ~/.zshenv and also sourced from ~/.zprofile. For more information, see the"
347 - elog "zshenv example in ${EROOT}/usr/share/doc/${PF}/StartupFiles/."
348 - echo
349 - elog "See https://wiki.gentoo.org/wiki/Zsh/HOWTO for more introduction documentation."
350 - echo
351 - fi
352 -}
353
354 diff --git a/app-shells/zsh/zsh-5.4.2-r1.ebuild b/app-shells/zsh/zsh-5.4.2-r1.ebuild
355 deleted file mode 100644
356 index 4c17da09db4..00000000000
357 --- a/app-shells/zsh/zsh-5.4.2-r1.ebuild
358 +++ /dev/null
359 @@ -1,211 +0,0 @@
360 -# Copyright 1999-2018 Gentoo Foundation
361 -# Distributed under the terms of the GNU General Public License v2
362 -
363 -EAPI=6
364 -
365 -inherit flag-o-matic prefix
366 -
367 -if [[ ${PV} == 9999* ]] ; then
368 - inherit git-r3 autotools
369 - EGIT_REPO_URI="git://git.code.sf.net/p/zsh/code"
370 -else
371 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
372 - SRC_URI="https://www.zsh.org/pub/${P}.tar.gz
373 - doc? ( https://www.zsh.org/pub/${P}-doc.tar.xz )"
374 -fi
375 -
376 -DESCRIPTION="UNIX Shell similar to the Korn shell"
377 -HOMEPAGE="https://www.zsh.org/"
378 -
379 -LICENSE="ZSH gdbm? ( GPL-2 )"
380 -SLOT="0"
381 -IUSE="caps debug doc examples gdbm maildir pcre static unicode"
382 -
383 -RDEPEND="
384 - >=sys-libs/ncurses-5.1:0=
385 - static? ( >=sys-libs/ncurses-5.7-r4:0=[static-libs] )
386 - caps? ( sys-libs/libcap )
387 - pcre? (
388 - >=dev-libs/libpcre-3.9
389 - static? ( >=dev-libs/libpcre-3.9[static-libs] )
390 - )
391 - gdbm? ( sys-libs/gdbm:= )
392 - !<sys-apps/baselayout-2.4.1
393 -"
394 -DEPEND="sys-apps/groff
395 - ${RDEPEND}"
396 -PDEPEND="
397 - examples? ( app-doc/zsh-lovers )
398 -"
399 -if [[ ${PV} == 9999* ]] ; then
400 - DEPEND+=" app-text/yodl
401 - doc? (
402 - sys-apps/texinfo
403 - app-text/texi2html
404 - virtual/latex-base
405 - )"
406 -fi
407 -
408 -src_prepare() {
409 - if [[ ${PV} != 9999* ]]; then
410 - # fix zshall problem with soelim
411 - ln -s Doc man1 || die
412 - mv Doc/zshall.1 Doc/zshall.1.soelim || die
413 - soelim Doc/zshall.1.soelim > Doc/zshall.1 || die
414 -
415 - # add openrc specific options for init.d completion
416 - eapply "${FILESDIR}"/${PN}-5.3-init.d-gentoo.diff
417 - fi
418 -
419 - eapply_user
420 -
421 - if [[ ${PV} == 9999* ]] ; then
422 - sed -i "/^VERSION=/s/=.*/=${PV}/" Config/version.mk || die
423 - eautoreconf
424 - fi
425 -}
426 -
427 -src_configure() {
428 - local myconf=(
429 - --bindir="${EPREFIX}"/bin
430 - --libdir="${EPREFIX}"/usr/$(get_libdir)
431 - --enable-etcdir="${EPREFIX}"/etc/zsh
432 - --enable-runhelpdir="${EPREFIX}"/usr/share/zsh/${PV%_*}/help
433 - --enable-fndir="${EPREFIX}"/usr/share/zsh/${PV%_*}/functions
434 - --enable-site-fndir="${EPREFIX}"/usr/share/zsh/site-functions
435 - --enable-function-subdirs
436 - --with-tcsetpgrp
437 - $(use_enable maildir maildir-support)
438 - $(use_enable pcre)
439 - $(use_enable caps cap)
440 - $(use_enable unicode multibyte)
441 - $(use_enable gdbm )
442 - )
443 -
444 - if use static ; then
445 - myconf+=( --disable-dynamic )
446 - append-ldflags -static
447 - fi
448 - if use debug ; then
449 - myconf+=(
450 - --enable-zsh-debug
451 - --enable-zsh-mem-debug
452 - --enable-zsh-mem-warning
453 - --enable-zsh-secure-free
454 - --enable-zsh-hash-debug
455 - )
456 - fi
457 -
458 - if [[ ${CHOST} == *-darwin* ]]; then
459 - myconf+=( --enable-libs=-liconv )
460 - append-ldflags -Wl,-x
461 - fi
462 -
463 - econf "${myconf[@]}"
464 -
465 - if use static ; then
466 - # compile all modules statically, see Bug #27392
467 - # removed cap and curses because linking failes
468 - sed -e "s,link=no,link=static,g" \
469 - -e "/^name=zsh\/cap/s,link=static,link=no," \
470 - -e "/^name=zsh\/curses/s,link=static,link=no," \
471 - -i "${S}"/config.modules || die
472 - if ! use gdbm ; then
473 - sed -i '/^name=zsh\/db\/gdbm/s,link=static,link=no,' \
474 - "${S}"/config.modules || die
475 - fi
476 - fi
477 -}
478 -
479 -src_compile() {
480 - default
481 -
482 - if [[ ${PV} == 9999* ]] && use doc ; then
483 - emake -C Doc everything
484 - fi
485 -}
486 -
487 -src_test() {
488 - addpredict /dev/ptmx
489 - local i
490 - for i in C02cond.ztst V08zpty.ztst X02zlevi.ztst Y01completion.ztst Y02compmatch.ztst Y03arguments.ztst ; do
491 - rm "${S}"/Test/${i} || die
492 - done
493 - emake check
494 -}
495 -
496 -src_install() {
497 - emake DESTDIR="${D}" install $(usex doc "install.info" "")
498 -
499 - insinto /etc/zsh
500 - export PREFIX_QUOTE_CHAR='"' PREFIX_EXTRA_REGEX="/EUID/s,0,${EUID},"
501 - newins "$(prefixify_ro "${FILESDIR}"/zprofile-3)" zprofile
502 -
503 - keepdir /usr/share/zsh/site-functions
504 - insinto /usr/share/zsh/${PV%_*}/functions/Prompts
505 - newins "${FILESDIR}"/prompt_gentoo_setup-1 prompt_gentoo_setup
506 -
507 - local i
508 -
509 - # install miscellaneous scripts (bug #54520)
510 - sed -e "s:/usr/local/bin/perl:${EPREFIX}/usr/bin/perl:g" \
511 - -e "s:/usr/local/bin/zsh:${EPREFIX}/bin/zsh:g" \
512 - -i {Util,Misc}/* || die
513 - for i in Util Misc ; do
514 - insinto /usr/share/zsh/${PV%_*}/${i}
515 - doins ${i}/*
516 - done
517 -
518 - # install header files (bug #538684)
519 - insinto /usr/include/zsh
520 - doins config.h Src/*.epro
521 - for i in Src/{zsh.mdh,*.h} ; do
522 - sed -e 's@\.\./config\.h@config.h@' \
523 - -e 's@#\(\s*\)include "\([^"]\+\)"@#\1include <zsh/\2>@' \
524 - -i "${i}"
525 - doins "${i}"
526 - done
527 -
528 - dodoc ChangeLog* META-FAQ NEWS README config.modules
529 -
530 - if use doc ; then
531 - pushd "${WORKDIR}/${PN}-${PV%_*}" >/dev/null
532 - docinto html
533 - dodoc Doc/*.html
534 - insinto /usr/share/doc/${PF}
535 - doins Doc/zsh.{dvi,pdf}
536 - popd >/dev/null
537 - fi
538 -
539 - docinto StartupFiles
540 - dodoc StartupFiles/z*
541 -}
542 -
543 -pkg_postinst() {
544 - if [[ -z ${REPLACING_VERSIONS} ]] ; then
545 - echo
546 - elog "If you want to enable Portage completions and Gentoo prompt,"
547 - elog "emerge app-shells/gentoo-zsh-completions and add"
548 - elog " autoload -U compinit promptinit"
549 - elog " compinit"
550 - elog " promptinit; prompt gentoo"
551 - elog "to your ~/.zshrc"
552 - echo
553 - elog "Also, if you want to enable cache for the completions, add"
554 - elog " zstyle ':completion::complete:*' use-cache 1"
555 - elog "to your ~/.zshrc"
556 - echo
557 - elog "Note that a system zprofile startup file is installed. This will override"
558 - elog "PATH and possibly other variables that a user may set in ~/.zshenv."
559 - elog "Custom PATH settings and similar overridden variables can be moved to ~/.zprofile"
560 - elog "or other user startup files that are sourced after the system zprofile."
561 - echo
562 - elog "If PATH must be set in ~/.zshenv to affect things like non-login ssh shells,"
563 - elog "one method is to use a separate path-setting file that is conditionally sourced"
564 - elog "in ~/.zshenv and also sourced from ~/.zprofile. For more information, see the"
565 - elog "zshenv example in ${EROOT}/usr/share/doc/${PF}/StartupFiles/."
566 - echo
567 - elog "See https://wiki.gentoo.org/wiki/Zsh/HOWTO for more introduction documentation."
568 - echo
569 - fi
570 -}