summaryrefslogtreecommitdiff
blob: 73a35d77c4c5e57a415b8e128db3ffbf2a7b02fa (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/commons-daemon/commons-daemon-1.0.1-r1.ebuild,v 1.1 2006/07/22 22:32:40 nelchael Exp $

inherit java-pkg-2 java-ant-2 eutils

DESCRIPTION="Tools to allow java programs to run as unix daemons"
SRC_URI="mirror://apache/jakarta/commons/daemon/source/daemon-${PV}.tar.gz"
HOMEPAGE="http://jakarta.apache.org/commons/daemon/"

LICENSE="Apache-1.1"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="doc examples source"

DEPEND=">=virtual/jdk-1.4
	dev-java/ant-core
	source? ( app-arch/zip )"
RDEPEND=">=virtual/jre-1.4"

S=${WORKDIR}/daemon-${PV}

src_unpack() {
	unpack ${A}

	# Submitted upstream to http://bugs.gentoo.org/show_bug.cgi?id=132563
	epatch "${FILESDIR}/1.0.1-as-needed.patch"

	cd ${S}/src/native/unix
	sed -e "s/powerpc/powerpc|powerpc64/g" -i support/apsupport.m4
	export WANT_AUTOCONF="2.5"
	autoconf
}

src_compile() {
	# compile native stuff
	cd ${S}/src/native/unix
	econf || die "configure failed"
	emake || die "make failed"

	# compile java stuff
	cd ${S}
	local antflags="jar"
	use doc && antflags="${antflags} javadoc"
	eant ${antflags} || die "compilation problem"
}

src_install() {
	dobin src/native/unix/jsvc
	java-pkg_dojar dist/${PN}.jar || die "Unable to install"

	dodoc README RELEASE-NOTES.txt *.html
	use doc && java-pkg_dohtml -r dist/docs/*
	if use examples; then
		dodir /usr/share/doc/${PF}/examples
		cp -R src/samples/* ${D}/usr/share/doc/${PF}/examples
	fi
	use source && java-pkg_dosrc src/java/* src/native/unix/native
}