summaryrefslogtreecommitdiff
blob: 4da6c07756c272f5b7d56b2d877a89e01b358b66 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-libs/shapelib/shapelib-1.2.10-r1.ebuild,v 1.4 2009/10/18 07:05:49 nerdboy Exp $

EAPI="2"
inherit eutils toolchain-funcs

DESCRIPTION="library for manipulating ESRI Shapefiles"
HOMEPAGE="http://shapelib.maptools.org/"
SRC_URI="http://dl.maptools.org/dl/shapelib//${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc x86"
IUSE=""

DEPEND=""

src_prepare() {
	epatch "${FILESDIR}"/makefile-fix.patch
	epatch "${FILESDIR}"/fix-shapelib-test.diff
	epatch "${FILESDIR}"/stdlib_include_fix.patch
	sed -i \
		-e 's:/usr/local/:${DESTDIR}/usr/:g' \
		-e "s:/usr/lib:/usr/$(get_libdir):g" \
		-e 's:SHPLIB_VERSION=1.2.9:SHPLIB_VERSION=1.2.10:g' \
		-e "s:-g:${CFLAGS}:" \
		-e "s:-g -O2:${CFLAGS}:g" \
		-e "s:link gcc :link gcc ${LDFLAGS}:" \
		Makefile || die "sed failed"
}

src_compile() {
	emake || die "emake failed"
	emake lib || die "emake lib failed"
}

src_install() {
	dobin shp{create,dump,test,add} dbf{create,dump,add} \
		|| die "dobin failed"
	emake DESTDIR="${D}" lib_install || die "emake lib_install failed"
	dodoc ChangeLog || die
	dohtml *.html || die
}