From 9af72b1f31ee233b46aa59a5ba6da4f673a8efa1 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Thu, 2 Mar 2023 03:09:49 +0000 Subject: automatic import of zsh --- .gitignore | 1 + dotzshrc | 9 ++ sources | 1 + zlogin | 4 + zlogout | 5 + zprofile | 8 ++ zsh-5.9-fix-egrep-test-error.patch | 72 ++++++++++++++ zsh.spec | 196 +++++++++++++++++++++++++++++++++++++ zshenv | 7 ++ zshrc | 19 ++++ 10 files changed, 322 insertions(+) create mode 100644 dotzshrc create mode 100644 sources create mode 100644 zlogin create mode 100644 zlogout create mode 100644 zprofile create mode 100644 zsh-5.9-fix-egrep-test-error.patch create mode 100644 zsh.spec create mode 100644 zshenv create mode 100644 zshrc diff --git a/.gitignore b/.gitignore index e69de29..e66db51 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/zsh-5.9.tar.xz diff --git a/dotzshrc b/dotzshrc new file mode 100644 index 0000000..ebd96e7 --- /dev/null +++ b/dotzshrc @@ -0,0 +1,9 @@ +# +# .zshrc is sourced in interactive shells. +# It should contain commands to set up aliases, +# functions, options, key bindings, etc. +# + +# Setup new style completion system. +autoload -U compinit +compinit diff --git a/sources b/sources new file mode 100644 index 0000000..df012e7 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +182e37ca3fe3fa6a44f69ad462c5c30e zsh-5.9.tar.xz diff --git a/zlogin b/zlogin new file mode 100644 index 0000000..bafab73 --- /dev/null +++ b/zlogin @@ -0,0 +1,4 @@ +# +# '.zlogin' is sourced in login shells. It should contain +# commands that should be executed only in login shells. +# diff --git a/zlogout b/zlogout new file mode 100644 index 0000000..7501f12 --- /dev/null +++ b/zlogout @@ -0,0 +1,5 @@ +# +# '.zlogout' is sourced when login shells exit +# + +clear diff --git a/zprofile b/zprofile new file mode 100644 index 0000000..7925b57 --- /dev/null +++ b/zprofile @@ -0,0 +1,8 @@ +# +# '.zlogout' is similar to `.zlogin', except that it is sourced before `.zshrc' +# + +PATH="$PATH:$HOME/bin" +export PATH + +[ -f /etc/profile ] && . /etc/profile diff --git a/zsh-5.9-fix-egrep-test-error.patch b/zsh-5.9-fix-egrep-test-error.patch new file mode 100644 index 0000000..3d3c1d3 --- /dev/null +++ b/zsh-5.9-fix-egrep-test-error.patch @@ -0,0 +1,72 @@ +diff -Naur a/Test/D07multibyte.ztst b/Test/D07multibyte.ztst +--- a/Test/D07multibyte.ztst 2022-05-08 14:18:22.000000000 +0800 ++++ b/Test/D07multibyte.ztst 2023-01-30 16:26:37.480018635 +0800 +@@ -6,7 +6,7 @@ + unset -m LC_\* + mb_ok= + langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 +- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) ++ $(locale -a 2>/dev/null | grep -E 'utf8|UTF-8')) + for LANG in $langs; do + if [[ é = ? ]]; then + mb_ok=1 +diff -Naur a/Test/E01options.ztst b/Test/E01options.ztst +--- a/Test/E01options.ztst 2022-05-08 14:18:22.000000000 +0800 ++++ b/Test/E01options.ztst 2023-01-30 16:26:37.481018640 +0800 +@@ -651,7 +651,7 @@ + >noktarg1 + >0 1 + +- showopt() { setopt | egrep 'localoptions|ksharrays'; } ++ showopt() { setopt | grep -E 'localoptions|ksharrays'; } + f1() { setopt localoptions ksharrays; showopt } + f2() { setopt ksharrays; showopt } + setopt kshoptionprint +diff -Naur a/Test/V07pcre.ztst b/Test/V07pcre.ztst +--- a/Test/V07pcre.ztst 2022-05-08 14:18:22.000000000 +0800 ++++ b/Test/V07pcre.ztst 2023-01-30 16:26:37.488018676 +0800 +@@ -12,7 +12,7 @@ + unset -m LC_\* + mb_ok= + langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 +- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) ++ $(locale -a 2>/dev/null | grep -E 'utf8|UTF-8')) + for LANG in $langs; do + if [[ é = ? ]]; then + mb_ok=1 +diff -Naur a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst +--- a/Test/X02zlevi.ztst 2022-05-08 14:18:22.000000000 +0800 ++++ b/Test/X02zlevi.ztst 2023-01-30 16:26:37.492018696 +0800 +@@ -4,7 +4,7 @@ + unset -m LC_\* + ZSH_TEST_LANG= + langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 +- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) ++ $(locale -a 2>/dev/null | grep -E 'utf8|UTF-8')) + for LANG in $langs; do + if [[ é = ? ]]; then + ZSH_TEST_LANG=$LANG +diff -Naur a/Test/X03zlebindkey.ztst b/Test/X03zlebindkey.ztst +--- a/Test/X03zlebindkey.ztst 2022-05-08 14:18:22.000000000 +0800 ++++ b/Test/X03zlebindkey.ztst 2023-01-30 16:26:37.492018696 +0800 +@@ -6,7 +6,7 @@ + unset -m LC_\* + ZSH_TEST_LANG= + langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 +- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) ++ $(locale -a 2>/dev/null | grep -E 'utf8|UTF-8')) + for LANG in $langs; do + if [[ é = ? ]]; then + ZSH_TEST_LANG=$LANG +diff -Naur a/Test/Y01completion.ztst b/Test/Y01completion.ztst +--- a/Test/Y01completion.ztst 2022-05-08 14:18:22.000000000 +0800 ++++ b/Test/Y01completion.ztst 2023-01-30 16:26:37.493018701 +0800 +@@ -4,7 +4,7 @@ + unset -m LC_\* + ZSH_TEST_LANG= + langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 +- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) ++ $(locale -a 2>/dev/null | grep -E 'utf8|UTF-8')) + for LANG in $langs; do + if [[ é = ? ]]; then + ZSH_TEST_LANG=$LANG diff --git a/zsh.spec b/zsh.spec new file mode 100644 index 0000000..52336a6 --- /dev/null +++ b/zsh.spec @@ -0,0 +1,196 @@ +%define _bindir /bin + +Name: zsh +Version: 5.9 +Release: 3 +Summary: A shell designed for interactive use +License: MIT +URL: http://zsh.sourceforge.net +Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz + +# There are five startup files that zsh will read commands from +# http://zsh.sourceforge.net/Intro/intro_3.html +Source1: zlogin +Source2: zlogout +Source3: zprofile +Source4: zshrc +Source5: zshenv +Source6: dotzshrc +Patch0: zsh-5.9-fix-egrep-test-error.patch + +BuildRequires: autoconf coreutils gawk gdbm-devel libcap-devel make +BuildRequires: ncurses-devel pcre-devel sed texinfo hostname gcc + +Requires(post): info grep +Requires(preun): info +Requires(postun): coreutils grep + +Provides: /bin/zsh + +%description +The zsh is a shell designed for interactive use, and it is also a powerful scripting language. Many of +the useful features of bash, ksh, and tcsh were incorporated into zsh. It can match files by file extension +without running an external program, share command history with any shell, and more. + +%package help +Summary: zsh shell manual in html format +BuildArch: noarch + +Provides: zsh-html +Obsoletes: zsh-html + +%description help +This package contains the zsh manual in html format. + +%prep +%autosetup -p1 +autoreconf -fiv + +sed -e 's|^\.NOTPARALLEL|#.NOTPARALLEL|' -i 'Config/defs.mk.in' + +%build +%undefine _strict_symbol_defs_build + +export LIBLDFLAGS='-z lazy -fstack-protector-strong' + +%configure --enable-etcdir=%{_sysconfdir} --with-tcsetpgrp --enable-maildir-support --enable-pcre + +make -C Src headers +make -C Src -f Makemod zsh{path,xmod}s.h version.h +%make_build all html + +%check +make check + +%install +%make_install install.info fndir=%{_datadir}/%{name}/%{version}/functions sitefndir=%{_datadir}/%{name}/site-functions \ + scriptdir=%{_datadir}/%{name}/%{version}/scripts sitescriptdir=%{_datadir}/%{name}/scripts \ + runhelpdir=%{_datadir}/%{name}/%{version}/help + +rm -f $RPM_BUILD_ROOT%{_bindir}/zsh-%{version} +rm -f $RPM_BUILD_ROOT%{_infodir}/dir + +install -d ${RPM_BUILD_ROOT}%{_sysconfdir} +for i in %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5}; do + install -m 644 $i $RPM_BUILD_ROOT%{_sysconfdir}/"${i##*/}" +done + +install -d $RPM_BUILD_ROOT%{_sysconfdir}/skel +install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.zshrc + +for i in checkmail harden run-help zcalc zkbd test-repo-git-rebase-apply test-repo-git-rebase-merge; do + sed -i -e 's!/usr/local/bin/zsh!%{_bindir}/zsh!' $RPM_BUILD_ROOT%{_datadir}/zsh/%{version}/functions/$i + chmod +x $RPM_BUILD_ROOT%{_datadir}/zsh/%{version}/functions/$i +done + +%post +if [ "$1" = 1 ]; then + if [ ! -f %{_sysconfdir}/shells ] ; then + echo "%{_bindir}/%{name}" > %{_sysconfdir}/shells + echo "/bin/%{name}" >> %{_sysconfdir}/shells + else + grep -q "^%{_bindir}/%{name}$" %{_sysconfdir}/shells || echo "%{_bindir}/%{name}" >> %{_sysconfdir}/shells + grep -q "^/bin/%{name}$" %{_sysconfdir}/shells || echo "/bin/%{name}" >> %{_sysconfdir}/shells + fi +fi + +if [ -f %{_infodir}/zsh.info.gz ]; then +/sbin/install-info %{_infodir}/zsh.info.gz %{_infodir}/dir \ + --entry="* zsh: (zsh). An enhanced bourne shell." +fi + +%preun +if [ "$1" = 0 ] ; then + if [ -f %{_infodir}/zsh.info.gz ]; then + /sbin/install-info --delete %{_infodir}/zsh.info.gz %{_infodir}/dir \ + --entry="* zsh: (zsh). An enhanced bourne shell." + fi +fi + +%postun +if [ "$1" = 0 ] && [ -f %{_sysconfdir}/shells ] ; then + sed -i '\!^%{_bindir}/%{name}$!d' %{_sysconfdir}/shells + sed -i '\!^/bin/%{name}$!d' %{_sysconfdir}/shells +fi + +%files +%doc README LICENCE Etc/* FEATURES MACHINES NEWS +%attr(755,root,root) %{_bindir}/zsh + +%{_libdir}/zsh + +%config(noreplace) %{_sysconfdir}/skel/.z* +%config(noreplace) %{_sysconfdir}/z* +%{_datadir}/zsh + +%files help +%doc Doc/*.html +%{_mandir}/*/* +%{_infodir}/* + +%changelog +* Mon Jan 30 2023 Cao Jingbo - 5.9-3 +- Fix when use grep 3.8 build error. + +* Tue Jan 17 2023 dillon chen < dillon.chen@gmail.com> - 5.9-2 +- /usr/local/bin/zsh => /bin/zsh + +* Sun Oct 9 2022 dillon chen < dillon.chen@gmail.com> - 5.9-1 +- update to 5.9 + +* Tue Mar 1 2022 wangjie - 5.8-3 +- Type: CVE +- ID: CVE-2021-45444 +- SUG: NA +- DESC: fix CVE-2021-45444 + +* Sat Mar 20 2021 shenyangyang - 5.8-2 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:add -fstack-protector-strong for so file + +* Fri Jan 29 2021 zoulin - 5.8-1 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:update version to 5.8 + +* Wed Jun 24 2020 xuping - 5.7.1-5 +- Type:cves +- ID:CVE-2019-20044 +- SUG:NA +- DESC:fix CVE-2019-20044 + +* Thu Feb 6 2020 openEuler Buildteam - 5.7.1-4 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:add buildrequires of gcc and make + +* Mon Feb 3 2020 openEuler Buildteam - 5.7.1-3 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:fix missing files + +* Wed Jan 15 2020 openEuler Buildteam - 5.7.1-2 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:revise buildrequires + +* Wed Jan 8 2020 openEuler Buildteam - 5.7.1-1 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:update version to 5.7.1 + +* Wed Dec 18 2019 jiangchuangang - 5.6.2-3 +- Type:enhancement +- ID:NA +- SUG:restart +- DESC:Synchronize a patch + +* Wed Sep 18 2019 dongjian - 5.6.2-2 +- modify summary diff --git a/zshenv b/zshenv new file mode 100644 index 0000000..17f7564 --- /dev/null +++ b/zshenv @@ -0,0 +1,7 @@ +# +# `.zshenv' is sourced on all invocations of the shell, unless +# the -f option is set. It should contain commands to set the +# command search path, plus other important environment variables. +# `.zshenv' should not contain commands that produce output or +# assume the shell is attached to a tty. +# diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..beeed68 --- /dev/null +++ b/zshrc @@ -0,0 +1,19 @@ +# +# `.zshrc' is sourced in interactive shells. It should contain +# commands to set up aliases, functions, options, key bindings, etc. +# + +# Some nice key bindings +#bindkey '^X^Z' universal-argument ' ' magic-space +#bindkey '^X^A' vi-find-prev-char-skip +#bindkey '^Xa' _expand_alias +#bindkey '^Z' accept-and-hold +#bindkey -s '\M-/' \\\\ +#bindkey -s '\M-=' \| + +# bindkey -v # vi key bindings + +bindkey -e # emacs key bindings +bindkey ' ' magic-space # also do history expansion on space +bindkey '^I' complete-word # complete on tab, leave expansion to _expand + -- cgit v1.2.3