# Maintainer: Jaromir Capik <tavvva@email.cz>
#
# Thanks to:
# Aaron Griffin <aaron@archlinux.org>

pkgname=bash
_patchlevel=025
pkgver=3.2
pkgrel=8
pkgdesc="The GNU Bourne Again shell"
license=('GPL')
url="http://www.gnu.org/software/bash/bash.html"
groups=('core')
backup=(etc/profile etc/bashrc etc/skel/.bashrc etc/skel/.bash_profile)
provides=('sh')
depends=('uclibc' 'ncurses' 'gettext')
makedepends=('uclibc-devel' 'ncurses-devel' 'gettext-devel')

source=(ftp://ftp.cwru.edu/pub/bash/bash-3.2.tar.gz
        bash-3.2-fixes-6.patch
        profile
        bashrc)

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  patch -p1 < ../bash-3.2-fixes-6.patch

  ./configure --prefix=/usr --without-bash-malloc --with-curses \
              --host=i386-pc-linux-gnu --build=i386-pc-linux-gnu

  make || return 1
  make DESTDIR=$pkgdir install

  mv $pkgdir/usr/bin $pkgdir/bin
  # we don't want bashbug
  rm -f $pkgdir/bin/bashbug
  rm -f $pkgdir/usr/man/man1/bashbug.1
  mkdir -p $pkgdir/etc
  ln -sf ${pkgname} $pkgdir/bin/sh

  mkdir -p $pkgdir/etc/skel/
  install -D -m644 $srcdir/bashrc $pkgdir/etc/skel/.bashrc
  echo ". \$HOME/.bashrc" > $pkgdir/etc/skel/.bash_profile
  echo ". /etc/profile" > $pkgdir/etc/bashrc
}

md5sums=('00bfa16d58e034e3c2aa27f390390d30' '6787b1c94648fde6edb3bbf5e3f042f8'\
         '36a0679aad928d6f7d237d6c5580b483' '9451109f3fe09d6381cbf36de9fbf06f')
