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

EAPI=5

inherit autotools-utils multilib

DESCRIPTION="Dynamic modification of a user's environment via modulefiles"
HOMEPAGE="http://modules.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="test X"

RDEPEND="
	dev-lang/tcl:0=
	dev-tcltk/tclx
	X? ( x11-libs/libX11 )"
DEPEND="${RDEPEND}
	test? ( dev-util/dejagnu )"

S="${WORKDIR}/${P%[a-z]}"

DOCS=(ChangeLog README NEWS TODO)

src_prepare() {
	has_version ">=dev-lang/tcl-8.6.0" && \
		epatch "${FILESDIR}"/${P}-errorline.patch
	epatch \
		"${FILESDIR}"/${P}-bindir.patch \
		"${FILESDIR}"/${P}-versioning.patch \
		"${FILESDIR}"/${P}-clear.patch \
		"${FILESDIR}"/${P}-avail.patch
	sed -e "s:@EPREFIX@:${EPREFIX}:g" \
		"${FILESDIR}"/modules.sh.in > modules.sh
}

src_configure() {
	local myeconfargs=(
		--disable-versioning
		--prefix="${EPREFIX}/usr/share"
		--exec-prefix="${EPREFIX}/usr/share/Modules"
		--with-module-path="${EPREFIX}/etc/modulefiles"
		--with-tcl="${EPREFIX}/usr/$(get_libdir)"
		$(use_with X x)
	)
	autotools-utils_src_configure
}

src_install() {
	autotools-utils_src_install
	insinto /etc/profile.d
	doins modules.sh
	exeinto /usr/share/Modules/bin
	doexe "${FILESDIR}"/createmodule.{sh,py}
	dosym /usr/share/Modules/init/csh /etc/profile.d/modules.csh
	dodir /etc/modulefiles
}