aboutsummaryrefslogtreecommitdiff
blob: fa8af4769df588d239694742837790050e2c8ea4 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

inherit elisp-common versionator

DESCRIPTION="Interpreter for big integer and multi-precision floating point arithmetic"
HOMEPAGE="http://www.mathematik.uni-muenchen.de/~forster/sw/${PN}.html"
SRC_URI="ftp://ftp.mathematik.uni-muenchen.de/pub/forster/${PN}/UNIX_LINUX/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE="doc emacs examples"

DEPEND="emacs? ( virtual/emacs )"
RDEPEND="${DEPEND}"

SITEFILE=64${PN}-gentoo.el
CH_PV=$(delete_all_version_separators)

src_prepare() {
	# Linux x86 assembly piece
	if use x86; then
		mv LINUX/arito386.S .
		mv LINUX/Makefile.linux Makefile
	fi

	# removing strip
	sed -e '/^	strip \$(PROGRAM)$/d' -i Makefile || die "sed failed"
}

src_compile() {
	cd src
	if use x86; then
		emake CFLAGS="-DLiNUX -DPROTO ${CFLAGS}"
	else
		emake CC=gcc CFLAGS="-DUNiX -DPROTO ${CFLAGS}"
	fi

	if use emacs; then
		cd EL
		elisp-compile *.el || die "elisp-compile failed"
	fi
}

src_install() {
	dobin src/${PN}
	doman doc/*.1
	dodoc CHANGES${CH_PV}.txt

	if use doc; then
		dodoc doc/${PN}.doc doc/${PN}.tut
	fi

	if use examples; then
		insinto /usr/share/${P}
		doins -r examples
	fi

	if use emacs; then
		cd src/EL
		elisp-install ${PN} *.el *.elc die "elisp-install failed"
		elisp-site-file-install "${FILESDIR}"/${SITEFILE}
		newdoc EL/README README.emacs
	fi
}

pkg_postinst() {
	use emacs && elisp-site-regen
}

pkg_postrm() {
	use emacs && elisp-site-regen
}