summaryrefslogtreecommitdiff
blob: eaca1b7b9fb76415813c9a7930fc2d509e008295 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=4

inherit multilib

MYPV="${PV//\./}"

DESCRIPTION="Library for genetic algorithms in C++ programs"
HOMEPAGE="http://lancet.mit.edu/ga/"
SRC_URI="http://lancet.mit.edu/ga/dist/galib${MYPV}.tgz"

LICENSE="BSD examples? ( GPL-2 )"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="doc examples"

S="${WORKDIR}/galib${MYPV}"

src_prepare() {
	sed -i \
		-e 's:/include:${EPREFIX}/usr/include:' \
		-e "s:/lib:${EPREFIX}/usr/$(get_libdir):" \
		-e '/^CXX/d' \
		-e '/^CXXFLAGS/d' \
		-e '/^LD/d' \
		makevars || die "sed makevars failed"
}

src_compile() {
	emake lib
}

src_install() {
	dodir /usr/$(get_libdir)
	default

	if use doc; then
		insinto /usr/share/doc/${PF}
		doins -r doc/*
	fi

	if use examples; then
		insinto /usr/share/doc/${PF}/examples
		cd examples
		make clean
		sed -i \
			-e '/^include/d' \
			-e '/^INC_DIRS/d' \
			-e '/^LIB_DIRS/d' \
			makefile || die "sed makefile failed"
		doins -r *
	fi
}