updated on Sat Jan 21 04:00:54 UTC 2012
[aur-mirror.git] / ast-ksh / PKGBUILD
blobd4b7892a00aedc6610314cb3631db19ab64796a5
1 # Contributor: Mark Taylor <skymt0@gmail.com>
2 # Contributor: Stefan Husmann <stefan-husmann@t-online.de>
3 # Contributor: xduugu
4 # Contributor: Kambus
6 pkgname=ast-ksh
7 pkgver=2011.02.08
8 _pkgver=${pkgver//./-}
9 pkgrel=1
10 pkgdesc="AT&T's Korn shell"
11 arch=('i686' 'x86_64')
12 url="http://www.kornshell.com/"
13 license=('CPL')
14 conflicts=('pdksh')
15 install=${pkgname}.install
16 source=(${pkgname}.install)
18 md5sums=('3e2580395329d97d9e031463648aba70')
20 build() {
21   set -e
23   cd "$srcdir"
25   if [ $(which curl 2>/dev/null) ]; then
26     GET_CMD="curl -# -A'Mozilla/5.0' -u'I accept www.opensource.org/licenses/cpl:.' --remote-name-all"
27     GET_PIPE="curl -s"
28   elif [ $(which wget 2>/dev/null) ]; then
29     GET_CMD="wget -U'Mozilla/5.0' --user='I accept www.opensource.org/licenses/cpl' --password='.'"
30     GET_PIPE="wget -O -"
31   else
32     echo "Please install eighter wget or curl."
33     return 1
34   fi
37   $GET_PIPE http://www.opensource.org/licenses/cpl1.0.txt | sed -e '/THE ACCOMPANYING/,/<\/div>/!d' -e 's/\s*<[^>]*>//g' > LICENSE
38   ${PAGER:-more} LICENSE
40   echo -n "I have read and accepted the license (yes/no): "
41   read -r answer
42   [ "$answer" != "yes" ] && return 0
44   # We have to evaluate $GET_CMD, otherwise the username would be 'I.
45   eval $GET_CMD http://www2.research.att.com/~gsf/download/tgz/{INIT,ast-ksh}.${_pkgver}.tgz
46   cat <<_END | md5sum -c
47 2870a583f7c170d4f67b1d9858d6b091  INIT.2011-02-08.tgz
48 5481d41adf067503afbad92d048ff91a  ast-ksh.2011-02-08.tgz
49 _END
51   if (( $? )); then
52     echo "Checksum valaidation failed."
53     return 1
54   fi
57   tar xf INIT.${_pkgver}.tgz || return 1
58   tar xf ast-ksh.${_pkgver}.tgz || return 1
60   ./bin/package only make ast-ksh || return 1
62   install -Dm755 arch/linux.*/bin/ksh $pkgdir/bin/ksh || return 1
63   install -Dm644 arch/linux.*/man/man1/sh.1 $pkgdir/usr/share/man/man1/ksh.1 || return 1
64   install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE || return 1