From 415856bdd4f48ab4f2732996f0bae58595092bbe Mon Sep 17 00:00:00 2001 From: Parabola Date: Tue, 5 Apr 2011 14:26:38 +0000 Subject: Tue Apr 5 14:26:38 UTC 2011 --- extra/pdksh/PKGBUILD | 27 +++++++++++++++++++++++++++ extra/pdksh/pdksh-5.2.14.patch | 26 ++++++++++++++++++++++++++ extra/pdksh/pdksh.install | 22 ++++++++++++++++++++++ extra/pdksh/usr_ksh.sh | 9 +++++++++ 4 files changed, 84 insertions(+) create mode 100644 extra/pdksh/PKGBUILD create mode 100644 extra/pdksh/pdksh-5.2.14.patch create mode 100644 extra/pdksh/pdksh.install create mode 100644 extra/pdksh/usr_ksh.sh (limited to 'extra/pdksh') diff --git a/extra/pdksh/PKGBUILD b/extra/pdksh/PKGBUILD new file mode 100644 index 000000000..6f592e39c --- /dev/null +++ b/extra/pdksh/PKGBUILD @@ -0,0 +1,27 @@ +# $Id: PKGBUILD 30639 2009-03-21 04:22:46Z eric $ +# Maintainer: Aaron Griffin +# Contributor: Tom Newsom + +pkgname=pdksh +pkgver=5.2.14 +pkgrel=5 +pkgdesc="A public domain clone of the AT&T Korn shell" +arch=('i686' 'x86_64') +url="http://www.cs.mun.ca/~michael/pdksh/" +license=('custom') +depends=('glibc') +install=$pkgname.install +source=(ftp://ftp.cs.mun.ca/pub/$pkgname/$pkgname-$pkgver.tar.gz $pkgname-$pkgver.patch usr_ksh.sh) +md5sums=('871106b3bd937e1afba9f2ef7c43aef3' 'f11d1e711627d21a547c09e344e30dd3'\ + '56084a657ecafd5dd0813a6056036712') + +build() { + cd $srcdir/$pkgname-$pkgver + patch -Np1 -i ../$pkgname-$pkgver.patch || return 1 + ./configure --prefix=/ --mandir=/usr/share/man || return 1 + make || return 1 + make prefix=$pkgdir mandir=$pkgdir/usr/share/man/man1 install || return 1 + install -D -m 755 ${srcdir}/usr_ksh.sh ${pkgdir}/usr/bin/ksh || return 1 + install -D -m644 LEGAL $pkgdir/usr/share/licenses/$pkgname/LICENSE || return 1 +} +# vim: ts=2 sw=2 et ft=sh diff --git a/extra/pdksh/pdksh-5.2.14.patch b/extra/pdksh/pdksh-5.2.14.patch new file mode 100644 index 000000000..134e04f34 --- /dev/null +++ b/extra/pdksh/pdksh-5.2.14.patch @@ -0,0 +1,26 @@ +diff -ru pdksh-5.2.14/siglist.sh pdksh-5.2.14.arch/siglist.sh +--- pdksh-5.2.14/siglist.sh 1996-09-18 12:52:41.000000000 -0400 ++++ pdksh-5.2.14.arch/siglist.sh 2004-09-06 08:17:15.000000000 -0400 +@@ -11,19 +11,18 @@ + out=tmpo$$.c + ecode=1 + trapsigs='0 1 2 13 15' +-trap 'rm -f $in $out; trap 0; exit $ecode' $trapsigs ++trap 'rm -f $in $out; exit $ecode' $trapsigs + + CPP="${1-cc -E}" + + # The trap here to make up for a bug in bash (1.14.3(1)) that calls the trap +-(trap $trapsigs; +- echo '#include "sh.h"'; ++(echo '#include "sh.h"'; + echo ' { QwErTy SIGNALS , "DUMMY" , "hook for number of signals" },'; + sed -e '/^[ ]*#/d' -e 's/^[ ]*\([^ ][^ ]*\)[ ][ ]*\(.*[^ ]\)[ ]*$/#ifdef SIG\1\ + { QwErTy SIG\1 , "\1", "\2" },\ + #endif/') > $in + $CPP $in > $out +-sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort +2n +0n | ++sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort -g --key=3 | + sed 's/^[0-9]* //' | + awk 'BEGIN { last=0; nsigs=0; } + { diff --git a/extra/pdksh/pdksh.install b/extra/pdksh/pdksh.install new file mode 100644 index 000000000..844a4e731 --- /dev/null +++ b/extra/pdksh/pdksh.install @@ -0,0 +1,22 @@ +post_install() { + if [ ! "`grep /bin/ksh etc/shells`" ]; then + echo "updating /etc/shells... done." + sed -i "s|/bin/bash|/bin/bash\n/bin/ksh|" etc/shells + else + sed -i "s|/usr/bin/ksh|/bin/ksh|" etc/shells + + echo "" + echo ">> WARNING: /usr/bin/ksh has moved to /bin/ksh," + echo ">> please update your user accounts as needed" + echo "" + fi +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + echo -ne "\nupdating /etc/shells... " + sed -i "s|/bin/ksh||" etc/shells +} diff --git a/extra/pdksh/usr_ksh.sh b/extra/pdksh/usr_ksh.sh new file mode 100644 index 000000000..17a96d1bf --- /dev/null +++ b/extra/pdksh/usr_ksh.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +echo "WARNING: you should be calling ksh with /bin/ksh," +echo "not with /usr/bin/ksh. Please execute chsh to fix" +echo "this. Legacy /usr/bin/ksh support will go away!" +echo "" + +exec /bin/ksh $@ + -- cgit v1.2.3-54-g00ecf