# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit java-pkg eutils gnuconfig DESCRIPTION="Netline OpenExchange groupware server" HOMEPAGE="http://mirror.open-xchange.org" SRC_URI="http://mirror.open-xchange.org/download/${P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="-x86" IUSE="postgres jdom ssl doc" DEPEND="dev-java/sun-javamail-bin dev-java/sun-jaf-bin dev-java/xerces www-servers/tomcat dev-java/servletapi >=virtual/jdk-1.4 jdom? ( dev-java/jdom ) postgres? ( dev-java/jdbc3-postgresql ) ssl? ( >=dev-libs/openssl-0.9.6m )" RDEPEND="dev-perl/perl-ldap" S=${WORKDIR}/${PN}.${PV} pkg_setup() { if ! use postgres ; then echo eerror "The \"postgres\" USE flag is required. please add it to" eerror "'/etc/make.conf' or '/etc/portage/package.use'" eerror "'man 5 portage' for the correct syntax for '/etc/postage/package.use'" echo die "required USE flag is missing." fi } src_unpack() { unpack ${A} cd ${S} epatch ${FILESDIR}/${PV}-Makefile.am.patch || die "epatch failed" rm -rf ${S}/autom4te.cache || die "remove cache failed" aclocal -I m4/ && autoconf || die "reconfigure failed" } src_compile() { local myconf if use postgres; then myconf="${myconf} $(use_with postgres dbdriver org.postgresql.Driver)" myconf="${myconf} $(use_with postgres jdbcjar $(java-config -p jdbc3-postgresql-1))" fi if use ssl; then ewarn "Currently SSL doesn't build properly so usage of this flag" ewarn "is disabled" # myconf="${myconf} $(use_enable ssl)" fi if use jdom; then myconf="${myconf} --with-jdomjar=${ROOT}/usr/share/jdom/lib/jdom.jar" fi econf \ --with-sysconfdir=${ROOT}/etc \ --with-datadir=${ROOT}/usr/share \ --with-mailjar=${ROOT}/usr/share/sun-javamail-bin/lib/mail.jar \ --with-activationjar=${ROOT}/usr/share/sun-jaf-bin/lib/activation.jar \ --with-xercesjar=${ROOT}/usr/share/xerces-2/lib/xercesImpl.jar \ --with-jsdkjar=${ROOT}/opt/tomcat5/common/lib/servlet-api.jar \ --with-runuid=apache \ --with-rungid=apache \ --enable-webdav \ $myconf || die "configure failed" cd ${S} sed -i 's:jikes:modern:g' build.xml || die "sed failed" emake || die "make failed" } src_install() { make install || die "make install failed" chown -R root:apache "${D}/var/lib/${PN}" cd ${S} java-pkg_dojar lib/sessiond.jar java-pkg_dojar lib/comfiretools.jar java-pkg_dojar lib/nas.jar java-pkg_dojar lib/intranet.jar java-pkg_dojar lib/webmail.jar rm -rf ${D}/usr/lib keepdir ${ROOT}/var/lib/open-xchange/log keepdir ${ROOT}/var/lib/open-xchange/filespool keepdir ${ROOT}/var/lib/open-xchange/drafts keepdir ${ROOT}/var/lib/open-xchange/webmailupload keepdir ${ROOT}/var/lib/open-xchange/dictionary keepdir ${ROOT}/var/lib/open-xchange/settings/intranet keepdir ${ROOT}/var/lib/open-xchange/settings/webmail if use doc ; then dohtml -r api/* fi dodoc AUTHORS COPYING ChangeLog INSTALL NEWS README THANKS }