summaryrefslogtreecommitdiff
blob: 9f28e4707306278ac396bc06edc8e5821f250205 (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/log4cxx/log4cxx-0.9.7-r2.ebuild,v 1.2 2005/04/23 12:16:10 ka0ttic Exp $

inherit eutils flag-o-matic

DESCRIPTION="Library of C++ classes for flexible logging to files, syslog and other destinations"
HOMEPAGE="http://logging.apache.org/log4cxx/"
SRC_URI="http://www.apache.org/dist/logging/${PN}/${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="x86"
IUSE="doc unicode odbc smtp"

DEPEND="virtual/libc
		dev-libs/libxml2
		doc? ( app-doc/doxygen media-gfx/graphviz )
		odbc? ( dev-db/unixODBC )
		smtp? ( dev-libs/libsmtp )"

src_unpack() {
	unpack ${A}
	cd ${S}
	sed -i "s:\(htmldir = \).*\(/html\):\1\$(datadir)/doc/${PF}\2:" \
		docs/Makefile.am || die "sed failed"

	epatch ${FILESDIR}/${P}-gentoo.diff

	if use unicode && use odbc ; then
		epatch ${FILESDIR}/${P}-use-SQLWCHAR.diff
	fi
}

src_compile() {
	${S}/autogen.sh || die "autogen.sh failed"

	# has cppunit support, but make check builds nothing...
	local myconf="--disable-cppunit"
	use doc && myconf="${myconf} --enable-doxygen --enable-dot
		--enable-html-docs --enable-latex-docs" || \
		myconf="${myconf} --disable-doxygen --disable-dot --disable-html-docs"
	use smtp && myconf="${myconf} --with-SMTP=libsmtp"
	use odbc && myconf="${myconf} --with-ODBC=unixODBC"
	# it's broken, so we must do this rather than use_enable
	use unicode && myconf="${myconf} --enable-unicode"

	if use unicode && use odbc ; then
		# fix some warnings as w/o it TCHAR gets typedef'd to signed short
		# instead of wchar_t
		append-flags -DSQL_WCHART_CONVERT
	fi

	econf ${myconf} || die "econf failed"
	emake -j1 || die "emake failed"
}

src_install () {
	make DESTDIR=${D} install || die "make install failed"
	dodoc AUTHORS ChangeLog README
}