Blob Blame History Raw
# this file is encoded in UTF-8  -*- coding: utf-8 -*-

Summary: Powerful interactive shell
Name: zsh
Version: 5.2
Release: 2%{?dist}
License: MIT
URL: http://zsh.sourceforge.net/
Group: System Environment/Shells
Source0: http://www.zsh.org/pub/%{name}-%{version}.tar.xz
Source1: zlogin.rhs
Source2: zlogout.rhs
Source3: zprofile.rhs
Source4: zshrc.rhs
Source5: zshenv.rhs
Source6: dotzshrc
Source7: zshprompt.pl

# legacy downstream patches, TODO: either get them upstream or drop them
Patch0: zsh-serial.patch
Patch1: zsh-4.3.6-8bit-prompts.patch
Patch2: zsh-test-C02-dev_fd-mock.patch

# update zsh completion script for dnf to the latest upstream version
Patch3: zsh-5.2-comp-dnf.patch

BuildRequires: coreutils sed ncurses-devel libcap-devel
BuildRequires: texinfo texi2html gawk hostname
Requires(post): info grep
Requires(preun): info
Requires(postun): coreutils grep

Provides: /bin/zsh

%description
The zsh shell is a command interpreter usable as an interactive login
shell and as a shell script command processor.  Zsh resembles the ksh
shell (the Korn shell), but includes many enhancements.  Zsh supports
command line editing, built-in spelling correction, programmable
command completion, shell functions (with autoloading), a history
mechanism, and more.

%package html
Summary: Zsh shell manual in html format
Group: System Environment/Shells

%description html
The zsh shell is a command interpreter usable as an interactive login
shell and as a shell script command processor.  Zsh resembles the ksh
shell (the Korn shell), but includes many enhancements.  Zsh supports
command line editing, built-in spelling correction, programmable
command completion, shell functions (with autoloading), a history
mechanism, and more.

This package contains the Zsh manual in html format.

%prep

%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

cp -p %SOURCE7 .

%build
# make loading of module's dependencies work again (#1277996)
export LIBLDFLAGS='-z lazy'

%configure --enable-etcdir=%{_sysconfdir} --with-tcsetpgrp --enable-maildir-support

make all html

%check
# Run the testsuite
make check

%install
rm -rf $RPM_BUILD_ROOT

%makeinstall install.info \
  fndir=$RPM_BUILD_ROOT%{_datadir}/%{name}/%{version}/functions \
  sitefndir=$RPM_BUILD_ROOT%{_datadir}/%{name}/site-functions \
  scriptdir=$RPM_BUILD_ROOT%{_datadir}/%{name}/%{version}/scripts \
  sitescriptdir=$RPM_BUILD_ROOT%{_datadir}/%{name}/scripts \
  runhelpdir=$RPM_BUILD_ROOT%{_datadir}/%{name}/%{version}/help

rm -f ${RPM_BUILD_ROOT}%{_bindir}/zsh-%{version}
rm -f $RPM_BUILD_ROOT%{_infodir}/dir

mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}
for i in %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5}; do
    install -m 644 $i $RPM_BUILD_ROOT%{_sysconfdir}/"$(basename $i .rhs)"
done

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/skel
install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.zshrc

# This is just here to shut up rpmlint, and is very annoying.
# Note that we can't chmod everything as then rpmlint will complain about
# those without a she-bang line.
for i in checkmail harden run-help zcalc zkbd; 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

sed -i "s!$RPM_BUILD_ROOT%{_datadir}/%{name}/%{version}/help!%{_datadir}/%{name}/%{version}/help!" \
    $RPM_BUILD_ROOT%{_datadir}/zsh/%{version}/functions/{run-help,_run-help}


%clean
rm -rf $RPM_BUILD_ROOT

%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
# This is needed so that --excludedocs works.
/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
    # This is needed so that --excludedocs works.
    /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
%defattr(-,root,root)
%doc README LICENCE Etc/BUGS Etc/CONTRIBUTORS Etc/FAQ FEATURES MACHINES
%doc NEWS Etc/zsh-development-guide Etc/completion-style-guide zshprompt.pl
%attr(755,root,root) %{_bindir}/zsh
%{_mandir}/*/*
%{_infodir}/*
%{_datadir}/zsh
%{_libdir}/zsh
%config(noreplace) %{_sysconfdir}/skel/.z*
%config(noreplace) %{_sysconfdir}/z*

%files html
%defattr(-,root,root)
%doc Doc/*.html

%changelog
* Fri Dec 25 2015 Adrien Vergé <adrienverge@gmail.com> - 5.2-2
- update zsh completion script for dnf to the latest upstream version

* Thu Dec 03 2015 Kamil Dudka <kdudka@redhat.com> - 5.2-1
- Update to latest upstream release: Zsh 5.2

* Thu Nov 05 2015 Kamil Dudka <kdudka@redhat.com> - 5.1.1-3
- make loading of module's dependencies work again (#1277996)

* Thu Oct 08 2015 Kamil Dudka <kdudka@redhat.com> - 5.1.1-2
- fix crash in ksh mode with -n and $HOME (#1269883)

* Mon Sep 14 2015 Kamil Dudka <kdudka@redhat.com> - 5.1.1-1
- Update to latest upstream release: Zsh 5.1.1

* Mon Aug 31 2015 Kamil Dudka <kdudka@redhat.com> - 5.1-1
- Update to latest upstream release: Zsh 5.1
- remove outdated workarounds in %%check

* Thu Jul 30 2015 Kamil Dudka <kdudka@redhat.com> - 5.0.8-6
- fix handling of command substitution in math context

* Wed Jul 22 2015 Kamil Dudka <kdudka@redhat.com> - 5.0.8-5
- prevent infinite recursion in ihungetc() (#1245712)

* Tue Jul 07 2015 Kamil Dudka <kdudka@redhat.com> - 5.0.8-4
- backport completion for dnf (#1239337)

* Thu Jul 02 2015 Kamil Dudka <kdudka@redhat.com> - 5.0.8-3
- backport completion-related upstream fixes (#1238544)

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Jun 03 2015 Kamil Dudka <kdudka@redhat.com> - 5.0.8-1
- Update to latest upstream release: Zsh 5.0.8

* Fri May 22 2015 Kamil Dudka <kdudka@redhat.com> - 5.0.7-8
- fix SIGSEGV of the syntax check in ksh emulation mode (#1222867)

* Mon Apr 20 2015 Kamil Dudka <kdudka@redhat.com> - 5.0.7-7
- fix SIGSEGV when handling heredocs and keyboard interrupt (#972624)
- queue signals when manipulating global state to avoid deadlock

* Sun Jan 25 2015 Kamil Dudka <kdudka@redhat.com> - 5.0.7-6
- use correct allocation function in the new 'cd' code (#1183238)

* Fri Jan 23 2015 Kamil Dudka <kdudka@redhat.com> - 5.0.7-5
- suppress a warning about closing an already closed file descriptor (#1184002)
- improve handling of NULL in the 'cd' built-in (#1183238)

* Wed Nov 19 2014 Kamil Dudka <kdudka@redhat.com> - 5.0.7-4
- update documentation of POSIX_JOBS in the zshoptions.1 man page (#1162198)

* Tue Nov 18 2014 Kamil Dudka <kdudka@redhat.com> - 5.0.7-3
- replace an incorrect comment in /etc/zshenv (#1164313)

* Mon Nov 10 2014 Kamil Dudka <kdudka@redhat.com> - 5.0.7-2
- make the wait built-in work for already exited processes (#1162198)

* Wed Oct 08 2014 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.7-1
- Update to latest upstream release: Zsh 5.0.7

* Thu Aug 28 2014 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.6-1
- Update to latest upstream release: Zsh 5.0.6

* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.5-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Thu Jul 17 2014 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.5-7
- apply upstream patch which fixes CPU load issue (RHBZ#1120424)

* Wed Jul 09 2014 Adam Jackson <ajax@redhat.com> 5.0.5-6
- Fix missing 'fi' in %%post

* Thu Jul 03 2014 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.5-5
- improve handling of /etc/shells

* Wed Jul 02 2014 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.5-4
- fix FTBFS issue (RHBZ#1106713)
- remove individual _bindir setting; install to /usr/bin/ (RHBZ#1034060)
- require info package instead of /sbin/install-info binary

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue Apr 08 2014 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.5-1
- Update to latest upstream release: Zsh 5.0.5

* Thu Jan 16 2014 James Antill <james@fedoraproject.org> - 5.0.2-8
- Remove unneeded build require on tetex.

* Sat Oct 26 2013 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.2-7
- Require hostname package instead of /bin/hostname

* Tue Oct 22 2013 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.2-6
- remove systemd completion, it delivers it's own now (RHBZ#1022039)

* Thu Aug 01 2013 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.2-5
- update systemd completion (adds machinectl command)

* Tue Jun 25 2013 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.2-4
- up-to-date systemd completion (#949003)
- apply patch for building for aarch64 (#926864)

* Mon Apr 15 2013 James Antill <james@fedoraproject.org> - 5.0.2-3
- Fix the changelog dates.
- Fix the texi itemx bug.
- Resolves: bug#927863

* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Tue Jan 08 2013 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.2-1
- Update to new upstream version: Zsh 5.0.2

* Wed Nov 21 2012 Dominic Hopf <dmaphy@fedoraproject.org> - 5.0.0-1
- Update to new upstream version: Zsh 5.0.0

* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.17-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sun Mar 04 2012 Dominic Hopf <dmaphy@fedoraproject.org> - 4.3.17-1
- Update to new upstream version: Zsh 4.3.17

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Sat Dec 24 2011 Dominic Hopf <dmaphy@fedoraproject.org> - 4.3.15-1
- Update to new upstream version: Zsh 4.3.15

* Sat Dec 17 2011 Dominic Hopf <dmaphy@fedoraproject.org> - 4.3.14-2
- change the License field to MIT (RHBZ#768548)

* Sat Dec 10 2011 Dominic Hopf <dmaphy@fedoraproject.org> - 4.3.14-1
- Update to new upstream version: Zsh 4.3.14

* Sat Dec 03 2011 Dominic Hopf <dmaphy@fedoraproject.org> - 4.3.13-1
- Update to new upstream version: Zsh 4.3.13

* Sat Aug 13 2011 Dominic Hopf <dmaphy@fedoraproject.org> - 4.3.12-1
- Update to new upstream version: Zsh 4.3.12

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Jan 20 2011 Christopher Ailon <caillon@redhat.com> - 4.3.11-1
- Rebase to upstream version 4.3.11

* Tue Dec 7 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 4.3.10-6
- Rebuild for FTBFS https://bugzilla.redhat.com/show_bug.cgi?id=631197
- Remove deprecated PreReq, the packages aren't needed at runtime and they're
  already in Requires(post,preun,etc): lines.

* Mon Mar 22 2010 James Antill <james@fedoraproject.org> - 4.3.10-5
- Add pathmunge to our /etc/zshrc, for profile.d compat.
- Resolves: bug#548960

* Fri Aug  7 2009 James Antill <james@fedoraproject.org> - 4.3.10-4
- Allow --excludedocs command to work!
- Resolves: bug#515986

* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Jul 20 2009 James Antill <james@fedoraproject.org> - 4.3.10-1
- Import new upstream 4.3.10

* Wed Jun 10 2009 Karsten Hopp <karsten@redhat.com> 4.3.9-4.1
- skip D02glob test on s390, too

* Mon Mar  2 2009 James Antill <james@fedoraproject.org> - 4.3.9-4
- Remove D02glob testcase on ppc/ppc64, and hope noone cares

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.3.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild