aboutsummaryrefslogtreecommitdiff
blob: fbd7a6d6dfa49d7d0b1ee3dc805f10bfbdf244b8 (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils multilib

MY_P=${PN}.${PV}

DESCRIPTION="SParse Object Oriented Linear Equations Solver"
HOMEPAGE="http://www.netlib.org/linalg/spooles"
SRC_URI="http://www.netlib.org/linalg/${PN}/${MY_P}.tgz"

LICENSE="public-domain"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="mpi threads"

DEPEND="mpi? ( virtual/mpi )"

S=${WORKDIR}

src_unpack() {
	unpack ${A}
	epatch "${FILESDIR}"/${P}_makefiles.patch
	epatch "${FILESDIR}"/${P}_shared-libs.patch
	epatch "${FILESDIR}"/${P}_I2Ohash-64bit.patch
}

src_compile () {
	if use mpi; then
		epatch "${FILESDIR}"/${P}_MPI.patch
		sed -i -e "s|-lm|-lmpi -lm|" makefile
	fi

	if use threads; then
		epatch "${FILESDIR}"/${P}_MT.patch
		sed -i -e "s|-lm|-lpthread -lm|" makefile
	fi

	emake lib || die "emake failed"
}

src_install () {
	dolib *.a *.so.${PV} || die "dolib failed"
	dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so

	find . -name '*.h' -print0 | xargs -0 -n1 --replace=headerfile install -D headerfile tmp/headerfile
	insinto /usr/include/${PN}
	doins -r tmp/*
}