# 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/janus/open-xchange-${PV}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="-x86" IUSE="postgres mysql jdom ssl doc" DEPEND="dev-perl/Net-SSLeay dev-perl/IO-Socket-SSL dev-perl/XML-NamespaceSupport dev-perl/XML-SAX-Base dev-perl/Authen-SASL dev-perl/Convert-ASN1 dev-perl/perl-ldap dev-java/sun-javamail-bin dev-java/sun-jaf-bin dev-java/xerces dev-java/servletapi >=virtual/jdk-1.4 jdom? ( dev-java/jdom ) postgres? ( dev-java/jdbc3-postgresql ) mysql? ( dev-java/jdbc-mysql ) ssl? ( >=dev-libs/openssl-0.9.6m )" RDEPEND="www-servers/tomcat" S=${WORKDIR}/${PN}.${PV} pkg_setup() { if use mysql && use postgres ; then echo ewarn "You have both \"mysql\" and \"postgres\" in your USE flags." ewarn "Open-Xchange will default to use PostgreSQL as its default" ewarn "Open-Xchange database." ewarn "If you want to build with MySQL support; hit Control-C now." ewarn "Set net-mail/openexchange -postgres in your package.use;" ewarn "or -postgres in your global USE." fi if ! use mysql && ! use postgresql ; then echo eerror "Either \"mysql\" or \"postgres\" USE flag is required." eerror "please add it to '/etc/make.conf' or '/etc/portage/package.use'" eerror "'man 5 portage' for correct syntax usage for '/etc/postage/package.use'" echo die "required USE flag is missing." fi } src_unpack() { unpack ${A} cd ${S} epatch ${FILESDIR}/${PV}-makefile.patch rm -rf ${S}/autom4te.cache 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-5))" else myconf="${myconf} $(use_with mysql dbdriver org.mysql.Driver)" myconf="${myconf} $(use_with mysql jdbcjar $(java-config -p jdbc-mysql))" fi if use ssl; then 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/open-xchange \ --with-datadir=${ROOT}/usr/share/${PN} \ --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}/usr/share/servletapi-2.4/lib/servlet-api.jar \ --with-runuid=apache \ --enable-webdav \ --localstatedir=${ROOT}/var/lib/${PN} \ $myconf || die "configure failed" emake || die 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 }