-# $Revision: 1.17 $ $Date: 2000-06-09 07:55:17 $
+# $Revision: 1.47 $ $Date: 2002-02-22 23:30:12 $
+#
+# Conditional build:
+# _without_static - without static version
+#
Summary: Enhanced bourne shell
Summary(de): Enhanced Bourne Shell
+Summary(es): Shell bourne mejorada
Summary(fr): Bourne shell amélioré
Summary(tr): Geliþmiþ bir BASH sürümü
Summary(pl): Ulepszona pow³oka Bourne'a
+Summary(pt_BR): Shell bourne melhorada
Name: zsh
-Version: 3.1.9
-Release: 1
-License: GPL
-Group: Shells
-Group(pl): Pow³oki
+Version: 4.0.4
+Release: 3
+License: BSD-like
+Group: Applications/Shells
+URL: http://www.zsh.org/
Source0: ftp://ftp.zsh.org/pub/zsh/%{name}-%{version}.tar.gz
-Source1: ftp://ftp.zsh.org/pub/zsh/%{name}-%{version}-doc.tar.gz
-Patch0: zsh-info.patch
-Patch1: zsh-DESTDIR.patch
-Patch2: zsh-sys_capability.patch
-Patch3: zsh-cap_get_proc.patch
-Patch4: zsh-tinfo.patch
-Patch5: zsh-addons.patch
+Source1: %{name}.1.pl
+Patch0: %{name}-info.patch
+Patch1: %{name}-tinfo.patch
+Patch2: %{name}-addons.patch
+Patch3: %{name}-paths.patch
+Patch4: %{name}-no_nis.patch
Prereq: grep
-Prereq: gawk
-Prereq: sed
-BuildRequires: ncurses-devel
-BuildRequires: glibc-static
-BuildRequires: ncurses-static
+Prereq: fileutils
+BuildRequires: autoconf
+BuildRequires: ncurses-devel >= 5.1
+BuildRequires: texinfo
+%{!?_without_static:BuildRequires: glibc-static}
+%{!?_without_static:BuildRequires: ncurses-static}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+Obsoletes: zsh-doc-html, zsh-doc-ps, zsh-doc-dvi
-%define _exec_prefix /
+%define _bindir /bin
%description
zsh is an enhanced version of the Bourne shell with csh additions and
most features of ksh, bash, and tcsh.
+%description -l es
+zsh es una versión mejorada del bourne shell con estas
+características:
+- muy próximo de la gramática del ksh/sh, con adiciones csh,
+- varias características del ksh, bash y tcsh,
+- 75 funciones empotradas, 89 opciones, 154 combinaciones de teclas,
+- selección,
+- funciones shell ...y mucho más.
+
%description -l pl
zsh jest ulepszon± pow³ok± Bourne'a z elementami pow³oki csh. Posiada
wiêkszo¶æ cech ksh, bash i tcsh.
+%description -l pt_BR
+zsh é uma versão melhorada do bourne shell com essas características:
+- muito próximo da gramática do ksh/sh, com adições csh,
+- várias características do ksh, bash e tcsh,
+- 75 funções embutidas, 89 opções, 154 combinações de teclas,
+- seleção,
+- funções shell ...e muito mais.
+
+%package completions
+Summary: Files needed for advanced TAB-completion
+Summary(pl): Pliki potrzebne dla zaawansowanej TAB-completion
+Group: Applications/Shells
+Requires: %{name} = %{version}
+
+%description completions
+This package contains files needed for advanced tab completion in zsh.
+
+%description -l pl completions
+Ten pakiet zawiera pliki wymagane przez zsh dla zaawansowanej
+TAB-completion.
+
%package static
Summary: Statically linked Enhanced bourne shell
-Summary(pl): Zaawansowany bourne SHell - linkowany statycznie
-Group: Shells
-Group(pl): Pow³oki
+Summary(pl): Zaawansowany bourne SHell - linkowany statycznie
+Group: Applications/Shells
Requires: %{name} = %{version}
%description static
wiêkszo¶æ cech ksh, bash i tcsh. W tym pakiecie jest statycznie
linkowany.
-%package doc-html
-Summary: HTML documentation for zsh
-Group: Shells
-
-%description doc-html
-HTML documentation for zsh.
-
-%package doc-ps
-Summary: Postscript version of zsh documentation
-Group: Shells
-
-%description doc-ps
-Postscript version of zsh documentation.
-
-%package doc-dvi
-Summary: DVI version of zsh documentation
-Group: Shells
-
-%description doc-dvi
-DVI version of zsh documentation.
-
%prep
%setup -q
-%setup -q -b 1 -D
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
-%patch5 -p1
%build
autoconf
-LDFLAGS="-static -s"; export LDFLAGS
+%if %{!?_without_static:1}%{?_without_static:0}
+LDFLAGS="%{rpmldflags} -static"
%configure
%{__make}
-mv Src/zsh Src/zsh.static
+mv -f Src/zsh Src/zsh.static
+LDFLAGS="%{rpmldflags}"
+%endif
-LDFLAGS="-s"; export LDFLAGS
-%configure --enable-maildir-support
+%configure \
+ --enable-maildir-support
%{__make}
+(cd Doc; makeinfo zsh.texi)
+
%install
rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_infodir},%{_sysconfdir},%{_bindir},%{_mandir}/pl/man1}
+
%{__make} install DESTDIR=$RPM_BUILD_ROOT
-install Src/zsh.static $RPM_BUILD_ROOT%{_bindir}
+%{!?_without_static:install Src/zsh.static $RPM_BUILD_ROOT%{_bindir}}
+install Doc/zsh.info* $RPM_BUILD_ROOT%{_infodir}
-install -d $RPM_BUILD_ROOT%{_infodir}
-install Doc/zsh.info* $RPM_BUILD_ROOT%{_infodir}
+touch $RPM_BUILD_ROOT%{_sysconfdir}/{zlogout,zlogin,zshenv}
+echo ". /etc/profile" > $RPM_BUILD_ROOT%{_sysconfdir}/zprofile
+echo -e "PS1='[%%n@%%m %%~]%%(!.#.%%\\$) '\nbindkey -e >/dev/null 2>&1\nalias which=whence" > \
+ $RPM_BUILD_ROOT%{_sysconfdir}/zshrc
-install -d $RPM_BUILD_ROOT%{_sysconfdir}
-touch $RPM_BUILD_ROOT%{_sysconfdir}/{zlogout,zprofile,zshrc,zlogin,zshenv}
+rm -f Etc/Makefile*
+find Functions Util StartupFiles -name .distfiles -o -name .cvsignore | xargs rm -f
+install %{SOURCE1} $RPM_BUILD_ROOT%{_mandir}/pl/man1/zsh.1
-rm Etc/Makefile*
-gzip -9nf $RPM_BUILD_ROOT%{_mandir}/man1/* \
- Etc/* README ChangeLog META-FAQ \
- $RPM_BUILD_ROOT/%{_infodir}/zsh.info*
+gzip -9nf Etc/* README LICENCE ChangeLog META-FAQ
%post
if [ ! -f /etc/shells ]; then
- echo "/bin/zsh" > /etc/shells
+ echo "%{_bindir}/zsh" >> /etc/shells
else
- if ! grep '^/bin/zsh$' /etc/shells > /dev/null; then
- echo "/bin/zsh" >> /etc/shells
- fi
+ grep -q '^%{_bindir}/zsh$' /etc/shells || echo "%{_bindir}/zsh" >> /etc/shells
fi
-
[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} > /dev/null 2>&1
-%postun
+%preun
if [ "$1" = "0" ]; then
- grep -v /bin/zsh /etc/shells > /etc/shells.new
- mv /etc/shells.new /etc/shells
+ grep -v '^%{_bindir}/zsh$' /etc/shells > /etc/shells.new
+ mv -f /etc/shells.new /etc/shells
fi
+%postun
[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} > /dev/null 2>&1
%post static
if [ ! -f /etc/shells ]; then
- echo "/bin/zsh.static" > /etc/shells
+ echo "%{_bindir}/zsh.static" >> /etc/shells
else
- grep '^/bin/zsh.static$' /etc/shells > /dev/null || echo "/bin/zsh.static" >> /etc/shells
+ grep -q '^%{_bindir}/zsh\.static$' /etc/shells || echo "%{_bindir}/zsh.static" >> /etc/shells
fi
-%postun static
-if [ ! -x /bin/zsh.static ]; then
- grep -v '^/bin/zsh.static$' /etc/shells > /etc/shells.rpm
- mv /etc/shells.rpm /etc/shells
+%preun static
+if [ "$1" = "0" ]; then
+ grep -v '^%{_bindir}/zsh\.static$' /etc/shells > /etc/shells.new
+ mv -f /etc/shells.new /etc/shells
fi
+
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc {META-FAQ,README,ChangeLog}.gz Etc/* Util Functions
-%doc %{_infodir}/zsh.info*
-%dir %{_libdir}/zsh/%{version}
-%config %{_sysconfdir}/*
-
+%doc *.gz Etc/* Util StartupFiles
%attr(755,root,root) %{_bindir}/zsh
+%config %{_sysconfdir}/*
+%dir %{_libdir}/zsh
+%dir %{_libdir}/zsh/%{version}
+%dir %{_datadir}/zsh/
+%dir %{_datadir}/zsh/site-functions
+%dir %{_datadir}/zsh/%{version}
+%dir %{_datadir}/zsh/%{version}/functions
+%{_datadir}/zsh/%{version}/functions/[^_c]*
+%{_datadir}/zsh/%{version}/functions/c[^o]*
+%{_datadir}/zsh/%{version}/functions/co[^m]*
%attr(755,root,root) %{_libdir}/zsh/%{version}/*
-%{_mandir}/man1/zsh*.1.gz
+%{_infodir}/zsh.info*
+%{_mandir}/man1/zsh*.1*
+%lang(pl) %{_mandir}/pl/man1/zsh*.1*
-%files static
+%files completions
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/zsh.static
-
-%files doc-html
-%defattr(644,root,root,755)
-%doc Doc/*html
+%{_datadir}/zsh/%{version}/functions/comp*
+%{_datadir}/zsh/%{version}/functions/_*
-%files doc-ps
-%defattr(644,root,root,755)
-%doc Doc/*ps
-
-%files doc-dvi
+%if %{!?_without_static:1}%{?_without_static:0}
+%files static
%defattr(644,root,root,755)
-%doc Doc/*dvi
+%attr(755,root,root) %{_bindir}/zsh.static
+%endif