aboutsummaryrefslogtreecommitdiff
blob: 0759b3158ec404e5d3f21c584c8fe6eacc783e0d (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
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

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"

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

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 . || die
		mv LINUX/Makefile.linux Makefile || die
	fi

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

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

	if use emacs; then
		cd EL || doe
		elisp-compile *.el
	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 || die
		elisp-install ${PN} *.el *.elc
		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
}