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

inherit mono multilib

MY_PN="dbus-sharp"
MY_P="${MY_PN}-${PV}"
GLIB_PV="0.3"
GLIB_PN="${MY_PN}-glib"
GLIB_P="${GLIB_PN}-${GLIB_PV}"
GLIB_S="${WORKDIR}/${GLIB_P}"

DESCRIPTION="a C# implementation of D-Bus."
HOMEPAGE="http://www.ndesk.org/DBusSharp"
SRC_URI="http://www.ndesk.org/archive/${MY_PN}/${MY_P}.tar.gz
	glib? ( http://www.ndesk.org/archive/${MY_PN}/${GLIB_P}.tar.gz )"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~x86"
IUSE="glib"
#IUSE="examples"

DEPEND=""
RDEPEND=""

S=${WORKDIR}/${MY_P}

src_unpack() {
	unpack ${A}
	cd "${S}"
	sed -e "s:@prefix@:/usr:" \
		-e "/^libdir/s:lib$:$(get_libdir):" \
		${PN}-1.0.pc.in > ${PN}-1.0.pc || die "sed failed"
	if use glib ; then
		sed -e "s:@prefix@:/usr:" \
		-e "s:mono/lib/:mono/:" \
		-e "/^libdir/s:lib$:$(get_libdir):" \
		${GLIB_S}/${PN}-glib-1.0.pc.in > ${GLIB_S}/${PN}-glib-1.0.pc \
		|| die "sed failed"
	fi
}

src_compile() {
	emake || die "emake install failed"

	if use glib ; then
		emake -C ${GLIB_S} DBUS_SHARP_PREFIX=${S} || die "emake failed"
	fi
}

src_install() {
	emake -C src DESTDIR="${D}" prefix=/usr install || die "emake install failed"
	dodoc README COPYING || die

	if use glib ; then
		emake -C ${GLIB_S}/glib DESTDIR="${D}" prefix=/usr \
			DBUS_SHARP_PREFIX=${S} install || die "emake install failed"
	fi

	insinto /usr/$(get_libdir)/pkgconfig
	doins ${PN}-1.0.pc || die
	if use glib ; then
		doins ${GLIB_S}/${PN}-glib-1.0.pc || die
	fi
}