summaryrefslogtreecommitdiff
blob: 2f00b6193333d996d58bc4bdff8d2ed98f0166bc (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
74
75
76
77
78
79
80
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-www/cocoon/cocoon-2.0.2.ebuild,v 1.11 2003/09/06 01:54:08 msterret Exp $

A=cocoon-${PV}-src.tar.gz
S=${WORKDIR}/${P}
DESCRIPTION="A Web Publishing Framework for Apache"
SRC_URI="http://xml.apache.org/cocoon/dist/${A}"
HOMEPAGE="http://xml.apache.org/cocoon/"
KEYWORDS="x86 ~ppc ~sparc ~alpha"
SLOT="0"
LICENSE="Apache-1.1"

# FIXME: tomcat 4.0.x, x != 3 is okay
DEPEND=">=virtual/jdk-1.3
	>=net-www/tomcat-4.0.4
	jikes? ( >=dev-java/jikes-1.15 )
	"
IUSE="jikes"


src_unpack() {
	unpack ${A}

	cd ${S}
	echo -e `pwd`
	echo -e 'Patching Cocoon to fix JDBC3 filter bug'
	patch -p0 < ${FILESDIR}/${P}.patch || die

	# FIXME: We should rather depend on packages for JFOR

	# JFOR is required for the optional fo2rtf serializer.
	# Get the JFOR package from http://www.jfor.org/ and place the jar in ${DISTDIR}
	JFOR_JAR="jfor.jar"
	JFOR_HOME="http://www.jfor.org/"
	if [ ! -f ${DISTDIR}/${JFOR_JAR} ]; then
		einfo "Download ${JFOR_JAR} from ${JFOR_HOME} and place it in ${DISTDIR} for optional fo2rtf support"
	else
		cp ${DISTDIR}/${JFOR_JAR} ${S}/lib/optional/
	fi

	# FIXME: We should rather depend on packages for PHP

	# PHP is required for the optional php generator.
	# Get the PHP servlet (phpsrvlt.jar) from http://www.php.net/ and place the jar in ${DISTDIR}
	PHP_JAR="phpsrvlt.jar"
	PHP_HOME="http://www.php.net/"
	if [ ! -f ${DISTDIR}/${PHP_JAR} ]; then
		einfo "Download ${PHP_JAR} from ${PHP_HOME} and place it in ${DISTDIR} for optional PHP support"
	else
		cp ${DISTDIR}/${PHP_JAR} ${S}/lib/optional/
	fi
}

src_compile() {
	local myconf
	use jikes && myconf="-Dbuild.compiler=jikes"

	sh build.sh  \
		${myconf} \
		-Dinclude.webapp.libs=yes \
		-Dinstall.war=$CATALINA_HOME/webapps \
		webapp \
		|| die
}

src_install() {
	dodir ${CATALINA_HOME}/webapps
	insinto ${CATALINA_HOME}/webapps
	doins ${S}/build/cocoon/cocoon.war

	dodoc CREDITS INSTALL KEYS README
	dodoc changes.xml announcement.xml todo.xml

	dohtml -r docs/*
}

pkg_postinst() {
	einfo "You must restart tomcat to have access to Cocoon."
}