summaryrefslogtreecommitdiff
blob: 79f3b1e4e202c5cdc8e6cc842e8a49eb2483a34d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/spim/spim-6.5.ebuild,v 1.5 2003/10/18 21:10:33 brandy Exp $

IUSE="X"

HOMEPAGE="http://www.cs.wisc.edu/~larus/spim.html"
SRC_URI="http://www.cs.wisc.edu/~larus/SPIM/spim.tar.gz"
DESCRIPTION="MIPS Simulator"
SLOT="0"
KEYWORDS="x86"
LICENSE="as-is"
S=${WORKDIR}/${P}

src_compile() {
	pwd -P
	./Configure || die "Configure script failed"

	sed -e "s:\(BIN_DIR = \).*$:\1/usr/bin:" \
	    -e "s:\(MAN_DIR = \).*$:\1/usr/share/bin:" \
	    -e "s:\(TRAP_DIR = \).*$:\1/usr/sbin:" \
	    Makefile > Makefile.comp
	cp Makefile.comp Makefile

	einfo "Making console spim"
	emake spim || die "make spim failed"
	if [ `use X` ]; then
		einfo "Making xspim"
		emake xspim || die "make xspim failed"
	else
		sed -e "/install:: xspim/,+4d" \
		    Makefile > Makefile.nox
		cp Makefile.nox Makefile
	fi
}

src_install() {
	sed -e "s:\(BIN_DIR = \).*$:\1${D}usr/bin:" \
	    -e "s:\(MAN_DIR = \).*$:\1${D}usr/share/bin:" \
	    -e "s:\(TRAP_DIR = \).*$:\1${D}usr/sbin:" \
	    Makefile > Makefile.inst
	cp Makefile.inst Makefile

	dodir /usr/sbin

	dodoc BLURB README VERSION CangeLog Documentation/*

	make install || die "Install failed"
}

pkg_postinst() {
	cd ${S}
	cp Makefile.comp Makefile
	make test || die "Test failed"

}