aboutsummaryrefslogtreecommitdiff
blob: a4295d38c734964164d5828cc85ac98a5cf31aa9 (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
78
79
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit elisp-common versionator

DESCRIPTION="System for computational discrete algebra"
HOMEPAGE="http://www.gap-system.org/"
SLOT="0"
IUSE="emacs vim-syntax xtom"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~x86"

XTOM_VERSION=1r1p4

PV1=$(get_version_component_range 1-2 )
PV2=$(get_version_component_range 3 )
PV1=$(replace_version_separator 1 'r' ${PV1} )
PV2=${PV1}p${PV2}

SRC_URI="ftp://ftp.gap-system.org/pub/gap/gap4/tar.bz2/${PN}${PV2}.tar.bz2
	xtom? ( ftp://ftp.gap-system.org/pub/gap/gap4/tar.bz2/xtom${XTOM_VERSION}.tar.bz2 )"

RDEPEND="emacs? ( virtual/emacs )
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"

#### delete the next line when moving this ebuild to the main tree!
RESTRICT=mirror

S="${WORKDIR}"/${PN}${PV1}

src_compile() {
	econf
	emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" compile || die "emake failed"
}

src_test() {
	emake teststandard || die "test failed"
}

src_install() {
	dodoc README description*
	insinto /usr/share/${PN}
	doins -r doc grp lib pkg prim small trans tst sysinfo.gap
	source sysinfo.gap
	exeinto /usr/libexec/${PN}
	doexe bin/${GAParch}/gap
	sed -e "s|@gapdir@|/usr/share/${PN}|" \
		-e "s|@target@-@CC@|/usr/libexec/${PN}|" \
		-e "s|@EXEEXT@||" \
		-e 's|$GAP_DIR/bin/||' \
		gap.shi > gap
	exeinto /usr/bin
	doexe gap

	if use emacs ; then
		elisp-site-file-install etc/emacs/gap-mode.el
		elisp-site-file-install etc/emacs/gap-process.el
		elisp-site-file-install "${FILESDIR}"/64gap-gentoo.el
		dodoc etc/emacs/gap-mode.doc
	fi

	if use vim-syntax ; then
		insinto /usr/share/vim/vimfiles/syntax
		doins etc/gap.vim
		insinto /usr/share/vim/vimfiles/indent
		newins etc/gap_indent.vim gap.vim
		insinto /usr/share/vim/vimfiles/plugin
		newins etc/debug.vim debug_gap.vim
		dodoc etc/README.vim-utils etc/debugvim.txt
	fi
}

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

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