# Contributor: Alain Kalker <a.c.kalker at gmail dot com>

pkgname=seed7
pkgver="05_20130120"
pkgrel=2
pkgdesc="An extensible, general purpose programming language."
arch=('i686' 'x86_64')
url="http://seed7.sourceforge.net"
license=('GPL2' 'LGPL')
depends=('ncurses' 'libx11')
source=("http://sourceforge.net/projects/${pkgname}/files/${pkgname}/${pkgname}_${pkgver}/${pkgname}_${pkgver}.tgz")
md5sums=('3b3309189a63864a08dbf18830d32828')

build() {
cd ${srcdir}/${pkgname}/src
export S7_LIB_DIR=/usr/lib/${pkgname} SEED7_LIBRARY=/usr/share/${pkgname}/lib
make depend
make -j4
make s7c
}

package() {
cd ${srcdir}/${pkgname}
install -dm755 ${pkgdir}/usr/bin
install -m755 bin/{s7,s7c} ${pkgdir}/usr/bin
install -dm755 ${pkgdir}/usr/lib/${pkgname}
install -m644 bin/*.a ${pkgdir}/usr/lib/${pkgname}
install -dm755 ${pkgdir}/usr/share/${pkgname}
cp -dr --no-preserve=ownership prg lib ${pkgdir}/usr/share/${pkgname}
rm ${pkgdir}/usr/share/${pkgname}/prg/{s7,s7c}
install -dm755 ${pkgdir}/usr/share/doc/${pkgname}
install -m755 doc/* ${pkgdir}/usr/share/doc/${pkgname}
}