# Tests by default. No tests: rpm -ba --define 'dotests 0' zsh*.spec %{!?dotests: %define dotests 1} Summary: A powerful interactive shell Name: zsh Version: 5.4.1 Release: 1 License: BSD URL: http://www.zsh.org Group: System Environment/Shells Source0: ftp://ftp.zsh.org/pub/%{name}-%{version}.tar.gz Source10: ftp://ftp.zsh.org/pub/%{name}-%{version}.tar.gz.asc Source1: zlogin.rhs Source2: zlogout.rhs Source3: zprofile.rhs Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc Source7:%{name}-%{version}-%{release}.build.log # Give me better tools or die! %define _default_patch_fuzz 2 # legacy downstream patches, TODO: either get them upstream or drop them Patch0: %{name}-%{version}-aix.patch Patch1: %{name}-%{version}.aix.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: coreutils, sed, info, make, patch BuildRequires: gdbm-devel >= 1.12-1 #BuildRequires: libiconv >= 1.15-1 BuildRequires: pcre-devel >= 8.33-1 Requires: /sbin/install-info, info Requires: gdbm >= 1.12-1 #Requires: libiconv >= 1.15-1 Requires: pcre >= 8.33-1 %define _libdir64 %{_prefix}/lib64 %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. %prep %setup -q %patch0 %patch1 rm -rf /tmp/%{name}-%{version}-32bit cp -pr . /tmp/%{name}-%{version}-32bit rm -fr * mv /tmp/%{name}-%{version}-32bit 32bit cp -pr 32bit 64bit %build export OBJECT_MODE=64 cd 64bit # required if you run 'configure' as root user export FORCE_UNSAFE_CONFIGURE=1 export CC="/opt/freeware/bin/gcc -maix64 -O2" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --mandir=%{_mandir} \ --infodir=%{_infodir} \ --enable-etcdir=/etc \ --enable-pcre \ --enable-maildir-support \ --with-tcsetpgrp \ gmake all html if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi export OBJECT_MODE=32 cd ../32bit export CC="/opt/freeware/bin/gcc -maix32 -O2 -D_LARGE_FILES" export LDFLAGS="-Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --mandir=%{_mandir} \ --infodir=%{_infodir} \ --enable-etcdir=/etc \ --libdir=%{_libdir} \ --enable-pcre \ --enable-maildir-support \ --with-tcsetpgrp \ gmake all html if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export PATH=/opt/freeware/bin:$PATH cd 64bit export OBJECT_MODE=64 make DESTDIR=${RPM_BUILD_ROOT} install install.info /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : rm -f ${RPM_BUILD_ROOT}%{_bindir}/zsh-%{version} mkdir -p ${RPM_BUILD_ROOT}/etc for i in %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} ; do install -m 644 $i ${RPM_BUILD_ROOT}/etc/"$(basename $i .rhs)" done mkdir -p ${RPM_BUILD_ROOT}/etc/skel install -m 644 %{SOURCE6} ${RPM_BUILD_ROOT}/etc/skel/.zshrc # replace to put proper command line to remove the dependency on /bin/zsh for i in calendar_add checkmail harden run-help run-help-ip sticky-note zcalc zed zkbd; do sed -i -e 's!/bin/zsh!%{_bindir}/zsh!' \ ${RPM_BUILD_ROOT}%{_datadir}/%{name}/%{version}/functions/${i} chmod +x ${RPM_BUILD_ROOT}%{_datadir}/%{name}/%{version}/functions/${i} done ( cd $RPM_BUILD_ROOT%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_64 done ) cd ../32bit export OBJECT_MODE=32 make DESTDIR=${RPM_BUILD_ROOT} install install.info /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : rm -f ${RPM_BUILD_ROOT}%{_bindir}/zsh-%{version} rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir gzip --best ${RPM_BUILD_ROOT}%{_infodir}/*info* mkdir -p ${RPM_BUILD_ROOT}/etc for i in %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} ; do install -m 644 $i ${RPM_BUILD_ROOT}/etc/"$(basename $i .rhs)" done mkdir -p ${RPM_BUILD_ROOT}/etc/skel install -m 644 %{SOURCE6} ${RPM_BUILD_ROOT}/etc/skel/.zshrc # replace to put proper command line to remove the dependency on /bin/zsh for i in calendar_add checkmail harden run-help run-help-ip sticky-note zcalc zed zkbd; do sed -i -e 's!/bin/zsh!%{_bindir}/zsh!' \ ${RPM_BUILD_ROOT}%{_datadir}/%{name}/%{version}/functions/${i} chmod +x ${RPM_BUILD_ROOT}%{_datadir}/%{name}/%{version}/functions/${i} done ( cd $RPM_BUILD_ROOT%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_32 ln -sf "$fic"_64 $fic done ) ( cd ${RPM_BUILD_ROOT} for dir in bin include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %post if [ "$1" = 1 ]; then if [ ! -f /etc/shells ]; then echo "%{_bindir}/zsh" >> /etc/shells else grep '^%{_bindir}/zsh$' /etc/shells || \ echo "%{_bindir}/zsh" >> /etc/shells fi fi if [ -f %{_infodir}/zsh.info.gz ]; then /sbin/install-info %{_infodir}/%{name}.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}/%{name}.info.gz %{_infodir}/dir \ --entry="* zsh: (zsh). An enhanced bourne shell." fi fi : %postun if [ "$1" = 0 ] ; then if [ ! -x %{_bindir}/zsh ]; then grep -v '^%{_bindir}/%{name}$' /etc/shells > /etc/shells.rpm && \ mv /etc/shells.rpm /etc/shells fi fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc 32bit/README 32bit/LICENCE 32bit/Etc/BUGS 32bit/Etc/CONTRIBUTORS 32bit/Etc/FAQ 32bit/FEATURES 32bit/MACHINES %doc 32bit/NEWS 32bit/Etc/zsh-development-guide 32bit/Etc/completion-style-guide %attr(755,root,system) %{_bindir}/zsh* %{_mandir}/man?/* %{_infodir}/* %{_libdir}/%{name} %{_libdir64}/%{name} %{_datadir}/%{name} #%config(noreplace) /etc/skel/.z* #%config(noreplace) /etc/z* /usr/bin/zsh* %changelog * Mon May 07 2018 Harshita Jain -5.4.1-1 - Updated to version 5.4.1 * Tue Jan 31 2017 Michael Perzl - 5.3.1-1 - updated to version 5.3.1 * Wed Dec 14 2016 Michael Perzl - 5.3-1 - updated to version 5.3 * Mon Dec 28 2015 Michael Perzl - 5.2-1 - updated to version 5.2 * Mon Dec 28 2015 Michael Perzl - 5.1.1-1 - updated to version 5.1.1 * Mon Dec 28 2015 Michael Perzl - 5.1-1 - updated to version 5.1 * Mon Dec 28 2015 Michael Perzl - 5.0.8-1 - updated to version 5.0.8 * Wed Oct 29 2014 Michael Perzl - 5.0.7-1 - updated to version 5.0.7 * Wed Oct 01 2014 Michael Perzl - 5.0.6-1 - updated to version 5.0.6 * Mon Jan 20 2014 Michael Perzl - 5.0.5-1 - updated to version 5.0.5 * Mon Jan 20 2014 Michael Perzl - 5.0.4-1 - updated to version 5.0.4 * Wed Dec 11 2013 Michael Perzl - 5.0.2-2 - fixed wrong dependency on /bin/zsh * Mon Jan 07 2013 Michael Perzl - 5.0.2-1 - updated to version 5.0.2 * Mon Jan 07 2013 Michael Perzl - 5.0.1-1 - updated to version 5.0.1 * Fri Feb 24 2012 Michael Perzl - 4.3.17-1 - updated to version 4.3.17 * Wed Dec 21 2011 Michael Perzl - 4.3.15-1 - updated to version 4.3.15 * Thu Dec 08 2011 Michael Perzl - 4.3.14-1 - updated to version 4.3.14 * Wed Jun 01 2011 Michael Perzl - 4.3.12-1 - updated to version 4.3.12 * Mon Jan 10 2011 Michael Perzl - 4.3.11-1 - updated to version 4.3.11 - automatically add entry to /etc/shells * Wed Aug 11 2010 Michael Perzl - 4.3.10-1 - first version for AIX V5.1 and higher