summaryrefslogtreecommitdiff
path: root/extra/pdksh
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /extra/pdksh
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'extra/pdksh')
-rw-r--r--extra/pdksh/PKGBUILD27
-rw-r--r--extra/pdksh/pdksh-5.2.14.patch26
-rw-r--r--extra/pdksh/pdksh.install22
-rw-r--r--extra/pdksh/usr_ksh.sh9
4 files changed, 84 insertions, 0 deletions
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 <aaron@archlinux.org>
+# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
+
+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 $@
+