1 |
commit: 36ee2193df450e0d142042dbaac9344459b1b7d7 |
2 |
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 4 06:26:19 2017 +0000 |
4 |
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 4 06:27:34 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36ee2193 |
7 |
|
8 |
app-shells/zsh: apply prefixify_ro of prefix.eclass to simplify the ebuild. |
9 |
|
10 |
zprofile-3 is created so that no pattern substitution is needed for |
11 |
non-Prefix systems. |
12 |
|
13 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
14 |
|
15 |
app-shells/zsh/files/zprofile-3 | 38 +++++++ |
16 |
app-shells/zsh/zsh-5.4.2-r1.ebuild | 211 +++++++++++++++++++++++++++++++++++++ |
17 |
2 files changed, 249 insertions(+) |
18 |
|
19 |
diff --git a/app-shells/zsh/files/zprofile-3 b/app-shells/zsh/files/zprofile-3 |
20 |
new file mode 100644 |
21 |
index 00000000000..6c223a5ef15 |
22 |
--- /dev/null |
23 |
+++ b/app-shells/zsh/files/zprofile-3 |
24 |
@@ -0,0 +1,38 @@ |
25 |
+# /etc/zsh/zprofile |
26 |
+ |
27 |
+# Load environment settings from profile.env, which is created by |
28 |
+# env-update from the files in /etc/env.d |
29 |
+if [ -e /etc/profile.env ] ; then |
30 |
+ . /etc/profile.env |
31 |
+fi |
32 |
+ |
33 |
+# You should override these in your ~/.zprofile (or equivalent) for per-user |
34 |
+# settings. For system defaults, you can add a new file in /etc/profile.d/. |
35 |
+export EDITOR=${EDITOR:-/bin/nano} |
36 |
+export PAGER=${PAGER:-/usr/bin/less} |
37 |
+ |
38 |
+# 077 would be more secure, but 022 is generally quite realistic |
39 |
+umask 022 |
40 |
+ |
41 |
+# Set up PATH depending on whether we're root or a normal user. |
42 |
+# There's no real reason to exclude sbin paths from the normal user, |
43 |
+# but it can make tab-completion easier when they aren't in the |
44 |
+# user's PATH to pollute the executable namespace. |
45 |
+# |
46 |
+# It is intentional in the following line to use || instead of -o. |
47 |
+# This way the evaluation can be short-circuited and calling whoami is |
48 |
+# avoided. |
49 |
+if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then |
50 |
+ PATH="${ROOTPATH}" |
51 |
+fi |
52 |
+export PATH |
53 |
+unset ROOTPATH |
54 |
+ |
55 |
+shopts=$- |
56 |
+setopt nullglob |
57 |
+for sh in /etc/profile.d/*.sh ; do |
58 |
+ [ -r "$sh" ] && . "$sh" |
59 |
+done |
60 |
+unsetopt nullglob |
61 |
+set -$shopts |
62 |
+unset sh shopts |
63 |
|
64 |
diff --git a/app-shells/zsh/zsh-5.4.2-r1.ebuild b/app-shells/zsh/zsh-5.4.2-r1.ebuild |
65 |
new file mode 100644 |
66 |
index 00000000000..79789092e50 |
67 |
--- /dev/null |
68 |
+++ b/app-shells/zsh/zsh-5.4.2-r1.ebuild |
69 |
@@ -0,0 +1,211 @@ |
70 |
+# Copyright 1999-2017 Gentoo Foundation |
71 |
+# Distributed under the terms of the GNU General Public License v2 |
72 |
+ |
73 |
+EAPI=6 |
74 |
+ |
75 |
+inherit flag-o-matic prefix |
76 |
+ |
77 |
+if [[ ${PV} == 9999* ]] ; then |
78 |
+ inherit git-r3 autotools |
79 |
+ EGIT_REPO_URI="git://git.code.sf.net/p/zsh/code" |
80 |
+else |
81 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
82 |
+ SRC_URI="https://www.zsh.org/pub/${P}.tar.gz |
83 |
+ doc? ( https://www.zsh.org/pub/${P}-doc.tar.xz )" |
84 |
+fi |
85 |
+ |
86 |
+DESCRIPTION="UNIX Shell similar to the Korn shell" |
87 |
+HOMEPAGE="https://www.zsh.org/" |
88 |
+ |
89 |
+LICENSE="ZSH gdbm? ( GPL-2 )" |
90 |
+SLOT="0" |
91 |
+IUSE="caps debug doc examples gdbm maildir pcre static unicode" |
92 |
+ |
93 |
+RDEPEND=" |
94 |
+ >=sys-libs/ncurses-5.1:0= |
95 |
+ static? ( >=sys-libs/ncurses-5.7-r4:0=[static-libs] ) |
96 |
+ caps? ( sys-libs/libcap ) |
97 |
+ pcre? ( |
98 |
+ >=dev-libs/libpcre-3.9 |
99 |
+ static? ( >=dev-libs/libpcre-3.9[static-libs] ) |
100 |
+ ) |
101 |
+ gdbm? ( sys-libs/gdbm ) |
102 |
+ !<sys-apps/baselayout-2.4.1 |
103 |
+" |
104 |
+DEPEND="sys-apps/groff |
105 |
+ ${RDEPEND}" |
106 |
+PDEPEND=" |
107 |
+ examples? ( app-doc/zsh-lovers ) |
108 |
+" |
109 |
+if [[ ${PV} == 9999* ]] ; then |
110 |
+ DEPEND+=" app-text/yodl |
111 |
+ doc? ( |
112 |
+ sys-apps/texinfo |
113 |
+ app-text/texi2html |
114 |
+ virtual/latex-base |
115 |
+ )" |
116 |
+fi |
117 |
+ |
118 |
+src_prepare() { |
119 |
+ if [[ ${PV} != 9999* ]]; then |
120 |
+ # fix zshall problem with soelim |
121 |
+ ln -s Doc man1 || die |
122 |
+ mv Doc/zshall.1 Doc/zshall.1.soelim || die |
123 |
+ soelim Doc/zshall.1.soelim > Doc/zshall.1 || die |
124 |
+ |
125 |
+ # add openrc specific options for init.d completion |
126 |
+ eapply "${FILESDIR}"/${PN}-5.3-init.d-gentoo.diff |
127 |
+ fi |
128 |
+ |
129 |
+ eapply_user |
130 |
+ |
131 |
+ if [[ ${PV} == 9999* ]] ; then |
132 |
+ sed -i "/^VERSION=/s/=.*/=${PV}/" Config/version.mk || die |
133 |
+ eautoreconf |
134 |
+ fi |
135 |
+} |
136 |
+ |
137 |
+src_configure() { |
138 |
+ local myconf=( |
139 |
+ --bindir="${EPREFIX}"/bin |
140 |
+ --libdir="${EPREFIX}"/usr/$(get_libdir) |
141 |
+ --enable-etcdir="${EPREFIX}"/etc/zsh |
142 |
+ --enable-runhelpdir="${EPREFIX}"/usr/share/zsh/${PV%_*}/help |
143 |
+ --enable-fndir="${EPREFIX}"/usr/share/zsh/${PV%_*}/functions |
144 |
+ --enable-site-fndir="${EPREFIX}"/usr/share/zsh/site-functions |
145 |
+ --enable-function-subdirs |
146 |
+ --with-tcsetpgrp |
147 |
+ $(use_enable maildir maildir-support) |
148 |
+ $(use_enable pcre) |
149 |
+ $(use_enable caps cap) |
150 |
+ $(use_enable unicode multibyte) |
151 |
+ $(use_enable gdbm ) |
152 |
+ ) |
153 |
+ |
154 |
+ if use static ; then |
155 |
+ myconf+=( --disable-dynamic ) |
156 |
+ append-ldflags -static |
157 |
+ fi |
158 |
+ if use debug ; then |
159 |
+ myconf+=( |
160 |
+ --enable-zsh-debug |
161 |
+ --enable-zsh-mem-debug |
162 |
+ --enable-zsh-mem-warning |
163 |
+ --enable-zsh-secure-free |
164 |
+ --enable-zsh-hash-debug |
165 |
+ ) |
166 |
+ fi |
167 |
+ |
168 |
+ if [[ ${CHOST} == *-darwin* ]]; then |
169 |
+ myconf+=( --enable-libs=-liconv ) |
170 |
+ append-ldflags -Wl,-x |
171 |
+ fi |
172 |
+ |
173 |
+ econf "${myconf[@]}" |
174 |
+ |
175 |
+ if use static ; then |
176 |
+ # compile all modules statically, see Bug #27392 |
177 |
+ # removed cap and curses because linking failes |
178 |
+ sed -e "s,link=no,link=static,g" \ |
179 |
+ -e "/^name=zsh\/cap/s,link=static,link=no," \ |
180 |
+ -e "/^name=zsh\/curses/s,link=static,link=no," \ |
181 |
+ -i "${S}"/config.modules || die |
182 |
+ if ! use gdbm ; then |
183 |
+ sed -i '/^name=zsh\/db\/gdbm/s,link=static,link=no,' \ |
184 |
+ "${S}"/config.modules || die |
185 |
+ fi |
186 |
+ fi |
187 |
+} |
188 |
+ |
189 |
+src_compile() { |
190 |
+ default |
191 |
+ |
192 |
+ if [[ ${PV} == 9999* ]] && use doc ; then |
193 |
+ emake -C Doc everything |
194 |
+ fi |
195 |
+} |
196 |
+ |
197 |
+src_test() { |
198 |
+ addpredict /dev/ptmx |
199 |
+ local i |
200 |
+ for i in C02cond.ztst V08zpty.ztst X02zlevi.ztst Y01completion.ztst Y02compmatch.ztst Y03arguments.ztst ; do |
201 |
+ rm "${S}"/Test/${i} || die |
202 |
+ done |
203 |
+ emake check |
204 |
+} |
205 |
+ |
206 |
+src_install() { |
207 |
+ emake DESTDIR="${D}" install $(usex doc "install.info" "") |
208 |
+ |
209 |
+ insinto /etc/zsh |
210 |
+ export PREFIX_QUOTE_CHAR='"' PREFIX_EXTRA_REGEX="/EUID/s,0,${EUID}," |
211 |
+ newins "$(prefixify_ro "${FILESDIR}"/zprofile-3)" zprofile |
212 |
+ |
213 |
+ keepdir /usr/share/zsh/site-functions |
214 |
+ insinto /usr/share/zsh/${PV%_*}/functions/Prompts |
215 |
+ newins "${FILESDIR}"/prompt_gentoo_setup-1 prompt_gentoo_setup |
216 |
+ |
217 |
+ local i |
218 |
+ |
219 |
+ # install miscellaneous scripts (bug #54520) |
220 |
+ sed -e "s:/usr/local/bin/perl:${EPREFIX}/usr/bin/perl:g" \ |
221 |
+ -e "s:/usr/local/bin/zsh:${EPREFIX}/bin/zsh:g" \ |
222 |
+ -i {Util,Misc}/* || die |
223 |
+ for i in Util Misc ; do |
224 |
+ insinto /usr/share/zsh/${PV%_*}/${i} |
225 |
+ doins ${i}/* |
226 |
+ done |
227 |
+ |
228 |
+ # install header files (bug #538684) |
229 |
+ insinto /usr/include/zsh |
230 |
+ doins config.h Src/*.epro |
231 |
+ for i in Src/{zsh.mdh,*.h} ; do |
232 |
+ sed -e 's@\.\./config\.h@config.h@' \ |
233 |
+ -e 's@#\(\s*\)include "\([^"]\+\)"@#\1include <zsh/\2>@' \ |
234 |
+ -i "${i}" |
235 |
+ doins "${i}" |
236 |
+ done |
237 |
+ |
238 |
+ dodoc ChangeLog* META-FAQ NEWS README config.modules |
239 |
+ |
240 |
+ if use doc ; then |
241 |
+ pushd "${WORKDIR}/${PN}-${PV%_*}" >/dev/null |
242 |
+ docinto html |
243 |
+ dodoc Doc/*.html |
244 |
+ insinto /usr/share/doc/${PF} |
245 |
+ doins Doc/zsh.{dvi,pdf} |
246 |
+ popd >/dev/null |
247 |
+ fi |
248 |
+ |
249 |
+ docinto StartupFiles |
250 |
+ dodoc StartupFiles/z* |
251 |
+} |
252 |
+ |
253 |
+pkg_postinst() { |
254 |
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then |
255 |
+ echo |
256 |
+ elog "If you want to enable Portage completions and Gentoo prompt," |
257 |
+ elog "emerge app-shells/gentoo-zsh-completions and add" |
258 |
+ elog " autoload -U compinit promptinit" |
259 |
+ elog " compinit" |
260 |
+ elog " promptinit; prompt gentoo" |
261 |
+ elog "to your ~/.zshrc" |
262 |
+ echo |
263 |
+ elog "Also, if you want to enable cache for the completions, add" |
264 |
+ elog " zstyle ':completion::complete:*' use-cache 1" |
265 |
+ elog "to your ~/.zshrc" |
266 |
+ echo |
267 |
+ elog "Note that a system zprofile startup file is installed. This will override" |
268 |
+ elog "PATH and possibly other variables that a user may set in ~/.zshenv." |
269 |
+ elog "Custom PATH settings and similar overridden variables can be moved to ~/.zprofile" |
270 |
+ elog "or other user startup files that are sourced after the system zprofile." |
271 |
+ echo |
272 |
+ elog "If PATH must be set in ~/.zshenv to affect things like non-login ssh shells," |
273 |
+ elog "one method is to use a separate path-setting file that is conditionally sourced" |
274 |
+ elog "in ~/.zshenv and also sourced from ~/.zprofile. For more information, see the" |
275 |
+ elog "zshenv example in ${EROOT}/usr/share/doc/${PF}/StartupFiles/." |
276 |
+ echo |
277 |
+ elog "See https://wiki.gentoo.org/wiki/Zsh/HOWTO for more introduction documentation." |
278 |
+ echo |
279 |
+ fi |
280 |
+} |