summaryrefslogtreecommitdiff
blob: b80b148d5ce43073885cdd5e4f3e4b268c84b175 (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/upnp/upnp-1.2.1a.ebuild,v 1.5 2005/12/14 09:07:15 flameeyes Exp $

inherit eutils toolchain-funcs

MY_P="lib${P}"

DESCRIPTION="Intel's UPnP SDK"
HOMEPAGE="http://upnp.sourceforge.net"
SRC_URI="mirror://sourceforge/upnp/${MY_P}.tar.gz"
RESTRICT="nomirror"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
IUSE="doc debug"

DEPEND="sys-fs/e2fsprogs
	doc? ( app-doc/doc++
	       app-text/tetex
	       virtual/ghostscript )"

S="${WORKDIR}/${MY_P}/upnp"

src_unpack() {
	unpack ${A}
	cd ${S}/..

	epatch "${FILESDIR}/${MY_P}-gcc4.patch"
	epatch "${FILESDIR}/${MY_P}-fbsd.patch"
}

src_compile() {
	myconf=""

	if use debug; then
		myconf="DEBUG=1"
	fi

	# Fix for distcc/crosscompile, and make sure it doesn't strip
	emake ${myconf} \
		CC=$(tc-getCC) \
		AR=$(tc-getAR) \
		LD=$(tc-getLD) \
		STRIP=true \
		|| die "Compile failed!"

	if use doc; then
		emake doc || die "Documentation generation failed!"
	fi
}

src_install () {
	if use debug; then
		dolib.so bin/debug/libupnp.so
		dolib.so bin/debug/libixml.so
		dolib.so bin/debug/libthreadutil_dbg.so
	else
		dolib.so bin/libupnp.so
		dolib.so bin/libixml.so
		dolib.so bin/libthreadutil.so
	fi

	dodir /usr/include/upnp
	insinto /usr/include/upnp
	doins inc/*.h

	dodoc LICENSE ../README doc/UPnP_Programming_Guide.pdf
	if use doc; then
		dodoc doc/ixml.pdf doc/upnpsdk.pdf
		dohtml doc/html/*
	fi
}