summaryrefslogtreecommitdiff
blob: 522964ed044cb40bcb47f9973e66ecbcc5fcda82 (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/clearsilver/clearsilver-0.9.7.ebuild,v 1.10 2005/04/11 12:16:59 trapni Exp $

inherit eutils

DESCRIPTION="Clearsilver is a fast, powerful, and language-neutral HTML template system."
HOMEPAGE="http://www.clearsilver.net/"
SRC_URI="http://www.clearsilver.net/downloads/${P}.tar.gz"

LICENSE="CS-1.0"
SLOT="0"
KEYWORDS="x86 ppc ~sparc ~amd64"
IUSE="apache2 java perl python ruby zlib"

# Important:
#
# We don't redistribute clearsilver - we just provide a way to install it
# By doing this, I believe we are compliant with the license without any
# further actions
#
# stuart@gentoo.org, 25th April 2004

RESTRICT="nomirror"

DEPEND="apache2? ( >=net-www/apache-2 )
	java? ( virtual/jdk )
	perl? ( dev-lang/perl )
	python? ( >=dev-lang/python-2.1 )
	ruby? ( dev-lang/ruby )
	zlib? ( sys-libs/zlib )"

DOCS="CS_LICENSE README README.python INSTALL"

src_unpack () {
	unpack ${A}
	cd ${S}
	sed -i s/apxs/apxs2/g configure
	sed -i s,bin/httpd,bin/apache2,g configure
	sed -i s/2.2\ 2.1/2.3\ 2.2\ 2.1/ configure

	epatch ${FILESDIR}/${PV}-python.patch
}

src_compile() {
	local myconf
	local jdkhome=`java-config -O`

	use apache2 && myconf="${myconf} --with-apache" \
		|| myconf="${myconf} --disable-apache"
	use java && myconf="${myconf} --with-java=${jdkhome}" \
		|| myconf="${myconf} --disable-java"
	use perl && myconf="${myconf} --with-perl" \
		|| myconf="${myconf} --disable-perl"
	use python && myconf="${myconf} --with-python" \
		|| myconf="${myconf} --disable-python"
	# ruby support disabled for now
	# use ruby && myconf="${myconf} --with-ruby" \
	myconf="${myconf} --disable-ruby"
	use zlib || myconf="${myconf} --disable-compression"
	# mono support disabled for now
	# use mono && myconf="${myconf} --with-csharp" \
	myconf="${myconf} --disable-csharp"

	econf $myconf || die "./configure failed"

	emake -j1 || die "make failed"
}

src_install () {
	cd ${S}
	sed -i s,/usr/local,/usr, scripts/document.py
	make DESTDIR=${D} install || die "make install failed"

	dodir /var/www/localhost/cgi-bin
	mv ${D}/usr/bin/static.cgi ${D}/var/www/localhost/cgi-bin/clearsilver.cgi

	dodoc ${DOCS}
}