From 58a6914cef0caa1f37c33d106661bd8e45ed7d3ea24a3c66fcdcd4031daf5b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 25 May 2016 12:25:38 +0000 Subject: [PATCH 1/2] Accepting request 397822 from home:llua:branches:shells Add CentOS [67] support OBS-URL: https://build.opensuse.org/request/show/397822 OBS-URL: https://build.opensuse.org/package/show/shells/zsh?expand=0&rev=170 --- zprofile.rhs | 19 +++++++++++++++---- zsh.spec | 29 +++++++++++++++++++++-------- zshrc.rhs | 42 +++++++++++++++++++++++++++++++++--------- 3 files changed, 69 insertions(+), 21 deletions(-) diff --git a/zprofile.rhs b/zprofile.rhs index f694eea..7201b55 100644 --- a/zprofile.rhs +++ b/zprofile.rhs @@ -5,7 +5,18 @@ PATH="$PATH:$HOME/bin" export PATH -# source profile -if [ -f /etc/profile ]; then - source /etc/profile -fi +_src_etc_profile() +{ + # Make /etc/profile happier, and have possible ~/.zshenv options like + # NOMATCH ignored. + # + emulate -L ksh + + # source profile + if [ -f /etc/profile ]; then + source /etc/profile + fi +} +_src_etc_profile + +unset -f _src_etc_profile diff --git a/zsh.spec b/zsh.spec index 34c00fc..585d4c2 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ # # spec file for package zsh # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ Name: zsh Version: 5.2 -Release: 0 +Release: 0%{?dist} Summary: Shell with comprehensive completion License: MIT Group: System/Shells @@ -42,6 +42,7 @@ Patch1: trim-unneeded-completions.patch # PATCH-FIX-OPENSUSE zsh-osc-completion.patch -- Fix openSUSE versions in osc completion Patch2: zsh-osc-completion.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: groff %if 0%{?suse_version} Requires(pre): %{install_info_prereq} %if 0%{?suse_version} >= 1110 @@ -49,7 +50,6 @@ BuildRequires: fdupes BuildRequires: yodl %endif %if 0%{?suse_version} >= 1210 -BuildRequires: groff BuildRequires: makeinfo BuildRequires: texi2html %endif @@ -63,8 +63,10 @@ BuildRequires: libcap-devel BuildRequires: ncurses-devel BuildRequires: pcre-devel %if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version} +%if 0%{?rhel_version} >= 700 || 0%{?centos_version} >= 700 +%global __requires_exclude ^/bin/zsh$ +%endif BuildRequires: libtermcap-devel -BuildRequires: tetex BuildRequires: texi2html BuildRequires: texinfo %endif @@ -117,6 +119,11 @@ perl -p -i -e 's|/usr/local/bin|%{_bindir}|' \ %build %configure \ +%if 0%{?suse_version} + --with-term-lib="ncursesw" \ + --enable-cflags="%{optflags} -fPIE -fstack-protector %(ncursesw6-config --cflags)" \ + --enable-ldflags="%(ncursesw6-config --libs) -pie -Wl,-z,relro" \ +%endif --enable-fndir=%{_datadir}/%{name}/${version}/functions \ --enable-site-fndir=%{_datadir}/%{name}/site-functions \ --enable-function-subdirs \ @@ -124,13 +131,12 @@ perl -p -i -e 's|/usr/local/bin|%{_bindir}|' \ --with-tcsetpgrp \ --enable-cap \ --enable-multibyte \ - --enable-pcre \ - --with-term-lib="ncursesw" \ - --enable-cflags="%{optflags} -fPIE -fstack-protector %(ncursesw6-config --cflags)" \ - --enable-ldflags="%(ncursesw6-config --libs) -pie -Wl,-z,relro" + --enable-pcre # Copy _rpm completion from Redhat (bnc#900424) +%if 0%{?suse_version} cp Completion/Redhat/Command/_rpm Completion/openSUSE/Command/_rpm +%endif make all info html @@ -178,10 +184,15 @@ install -m 0755 -Dd %{buildroot}%{_datadir}/%{name}/%{version}/help install -m 0644 Doc/help/* %{buildroot}%{_datadir}/%{name}/%{version}/help/ # link zsh binary +%if 0%{?suse_version} || 0%{?rhel} <= 6 ln -sf %{_bindir}/zsh %{buildroot}/bin/zsh +%endif # Remove versioned zsh binary rm -f %{buildroot}%{_bindir}/zsh-* +%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version} +rm -f %{buildroot}/%{_datadir}/info/dir +%endif %if 0%{?suse_version} >= 1110 %fdupes %{buildroot} @@ -262,7 +273,9 @@ fi %endif %{_bindir}/zsh +%if 0%{?suse_version} || 0%{?rhel} <= 6 /bin/zsh +%endif %{_libdir}/zsh/ %{_datadir}/zsh/ %{_infodir}/zsh.info*.gz diff --git a/zshrc.rhs b/zshrc.rhs index 07a762c..64b6a3d 100644 --- a/zshrc.rhs +++ b/zshrc.rhs @@ -15,12 +15,36 @@ PROMPT='[%n@%m]%~%# ' # default prompt # bindkey -e # emacs key bindings bindkey ' ' magic-space # also do history expansion on space -# from bashrc -if [ "x$SHLVL" != "x1" ]; then # We're not a login shell - for i in /etc/profile.d/*.sh; do - if [ -r "$i" ]; then - . $i - fi - done - unset i -fi +# Provide pathmunge for /etc/profile.d scripts +pathmunge() +{ + if ! echo $PATH | /bin/grep -qE "(^|:)$1($|:)" ; then + if [ "$2" = "after" ] ; then + PATH=$PATH:$1 + else + PATH=$1:$PATH + fi + fi +} + +_src_etc_profile_d() +{ + # Make the *.sh things happier, and have possible ~/.zshenv options like + # NOMATCH ignored. + emulate -L ksh + + + # from bashrc, with zsh fixes + if [[ ! -o login ]]; then # We're not a login shell + for i in /etc/profile.d/*.sh; do + if [ -r "$i" ]; then + . $i + fi + done + unset i + fi +} +_src_etc_profile_d + +unset -f pathmunge _src_etc_profile_d + From e010b216af1ec37d0686cbd66f8b39034dd8c2074a9dd24926ae3bd48542f18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 25 May 2016 12:30:55 +0000 Subject: [PATCH 2/2] - Add CentOS [67] support OBS-URL: https://build.opensuse.org/package/show/shells/zsh?expand=0&rev=171 --- zsh.changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zsh.changes b/zsh.changes index d8aed7e..06183ba 100644 --- a/zsh.changes +++ b/zsh.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 25 12:30:17 UTC 2016 - llua@gmx.com + +- Add CentOS [67] support + ------------------------------------------------------------------- Thu Dec 10 09:55:27 UTC 2015 - mpluskal@suse.com