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
This commit is contained in:
Ismail Dönmez 2016-05-25 12:25:38 +00:00 committed by Git OBS Bridge
parent e183d8a26e
commit 58a6914cef
3 changed files with 69 additions and 21 deletions

View File

@ -5,7 +5,18 @@
PATH="$PATH:$HOME/bin" PATH="$PATH:$HOME/bin"
export PATH export PATH
_src_etc_profile()
{
# Make /etc/profile happier, and have possible ~/.zshenv options like
# NOMATCH ignored.
#
emulate -L ksh
# source profile # source profile
if [ -f /etc/profile ]; then if [ -f /etc/profile ]; then
source /etc/profile source /etc/profile
fi fi
}
_src_etc_profile
unset -f _src_etc_profile

View File

@ -1,7 +1,7 @@
# #
# spec file for package zsh # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -18,7 +18,7 @@
Name: zsh Name: zsh
Version: 5.2 Version: 5.2
Release: 0 Release: 0%{?dist}
Summary: Shell with comprehensive completion Summary: Shell with comprehensive completion
License: MIT License: MIT
Group: System/Shells 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 # PATCH-FIX-OPENSUSE zsh-osc-completion.patch -- Fix openSUSE versions in osc completion
Patch2: zsh-osc-completion.patch Patch2: zsh-osc-completion.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: groff
%if 0%{?suse_version} %if 0%{?suse_version}
Requires(pre): %{install_info_prereq} Requires(pre): %{install_info_prereq}
%if 0%{?suse_version} >= 1110 %if 0%{?suse_version} >= 1110
@ -49,7 +50,6 @@ BuildRequires: fdupes
BuildRequires: yodl BuildRequires: yodl
%endif %endif
%if 0%{?suse_version} >= 1210 %if 0%{?suse_version} >= 1210
BuildRequires: groff
BuildRequires: makeinfo BuildRequires: makeinfo
BuildRequires: texi2html BuildRequires: texi2html
%endif %endif
@ -63,8 +63,10 @@ BuildRequires: libcap-devel
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: pcre-devel BuildRequires: pcre-devel
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version} %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: libtermcap-devel
BuildRequires: tetex
BuildRequires: texi2html BuildRequires: texi2html
BuildRequires: texinfo BuildRequires: texinfo
%endif %endif
@ -117,6 +119,11 @@ perl -p -i -e 's|/usr/local/bin|%{_bindir}|' \
%build %build
%configure \ %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-fndir=%{_datadir}/%{name}/${version}/functions \
--enable-site-fndir=%{_datadir}/%{name}/site-functions \ --enable-site-fndir=%{_datadir}/%{name}/site-functions \
--enable-function-subdirs \ --enable-function-subdirs \
@ -124,13 +131,12 @@ perl -p -i -e 's|/usr/local/bin|%{_bindir}|' \
--with-tcsetpgrp \ --with-tcsetpgrp \
--enable-cap \ --enable-cap \
--enable-multibyte \ --enable-multibyte \
--enable-pcre \ --enable-pcre
--with-term-lib="ncursesw" \
--enable-cflags="%{optflags} -fPIE -fstack-protector %(ncursesw6-config --cflags)" \
--enable-ldflags="%(ncursesw6-config --libs) -pie -Wl,-z,relro"
# Copy _rpm completion from Redhat (bnc#900424) # Copy _rpm completion from Redhat (bnc#900424)
%if 0%{?suse_version}
cp Completion/Redhat/Command/_rpm Completion/openSUSE/Command/_rpm cp Completion/Redhat/Command/_rpm Completion/openSUSE/Command/_rpm
%endif
make all info html 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/ install -m 0644 Doc/help/* %{buildroot}%{_datadir}/%{name}/%{version}/help/
# link zsh binary # link zsh binary
%if 0%{?suse_version} || 0%{?rhel} <= 6
ln -sf %{_bindir}/zsh %{buildroot}/bin/zsh ln -sf %{_bindir}/zsh %{buildroot}/bin/zsh
%endif
# Remove versioned zsh binary # Remove versioned zsh binary
rm -f %{buildroot}%{_bindir}/zsh-* 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 %if 0%{?suse_version} >= 1110
%fdupes %{buildroot} %fdupes %{buildroot}
@ -262,7 +273,9 @@ fi
%endif %endif
%{_bindir}/zsh %{_bindir}/zsh
%if 0%{?suse_version} || 0%{?rhel} <= 6
/bin/zsh /bin/zsh
%endif
%{_libdir}/zsh/ %{_libdir}/zsh/
%{_datadir}/zsh/ %{_datadir}/zsh/
%{_infodir}/zsh.info*.gz %{_infodir}/zsh.info*.gz

View File

@ -15,8 +15,27 @@ PROMPT='[%n@%m]%~%# ' # default prompt
# bindkey -e # emacs key bindings # bindkey -e # emacs key bindings
bindkey ' ' magic-space # also do history expansion on space bindkey ' ' magic-space # also do history expansion on space
# from bashrc # Provide pathmunge for /etc/profile.d scripts
if [ "x$SHLVL" != "x1" ]; then # We're not a login shell 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 for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then if [ -r "$i" ]; then
. $i . $i
@ -24,3 +43,8 @@ if [ "x$SHLVL" != "x1" ]; then # We're not a login shell
done done
unset i unset i
fi fi
}
_src_etc_profile_d
unset -f pathmunge _src_etc_profile_d