# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=spim
pkgver=8.0
pkgrel=2
pkgdesc="Simulator for MIPS32"
url="http://spimsimulator.sourceforge.net/"
arch="all"
license="BSD"
depends=""
depends_dev=""
makedepends="bash flex bison"
install=""
subpackages="$pkgname-doc"
source="http://pages.cs.wisc.edu/~larus/SPIM/${pkgname}-${pkgver}.tar.gz
	respect-env.patch"

patch_args="-p0"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	make configuration $pkgname \
		-C "$builddir"/$pkgname || return 1
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" -C $pkgname install || return 1

	install -Dm644 Documentation/spim.man \
		"$pkgdir"/usr/share/man/man1/spim.1 || return 1
	for i in ChangeLog Documentation/BLURB README VERSION; do
		install -Dm644 $i \
			"$pkgdir"/usr/share/doc/$pkgname/${i##*/} || return 1
	done
}

md5sums="146558e8256f2b7577fb825fdc76a04f  spim-8.0.tar.gz
dac9099d3ac158d09caeee6e7eaa5b09  respect-env.patch"
sha256sums="6f205776cb9fa112729507008843b289012190ed3131cbd426c610a58387ee4b  spim-8.0.tar.gz
d2c7a9662312d5075e08c93fb9037895b633776a1413130674397c1432f612cf  respect-env.patch"
sha512sums="c4eb66863a931b74d6c6ecd92860d16fd6369c85caecba1e71a1149e73e708502d1070f17a9beb6d0af1368db1ee5a85c040b596866a1236275cdd410a661adf  spim-8.0.tar.gz
68e9f39bbcee4524557389fac2a617b1b588f2df7a1a807ce8a646053345b6a5f7aba6dda23d4821283783b654baa01763923cb70501a03467c5302f173383ef  respect-env.patch"
