# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit java-pkg gnuconfig DESCRIPTION="Netline OpenExhcnage groupware server" HOMEPAGE="http://mirror.open-xchange.org" SRC_URI="http://mirror.open-xchange.org/download/janus/${P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="postgres mysql ssl" DEPEND="ssl? ( >=dev-libs/openssl-0.9.6m ) mysql? ( dev-java/jdbc-mysql ) postgresql? ( dev-java/jdbc2-postgresql ) dev-java/ant >=virtual/jdk-1.4 dev-java/servletapi dev-java/sun-javamail-bin dev-java/sun-jaf-bin dev-java/xerces" S=${WORKDIR}/${PN}.${PV} pkg_setup() { if use mysql && use postgresql ; then echo ewarn "You have both \"mysql\" and \"postgres\" in your USE flags." ewarn "Will default to use mysql for OpenExchange database." ewarn "If you want to build with PostgreSQL support; hit Control-C now." ewarn "Set net-mail/openexchange -mysql in your package.use;" ewarn "or -mysql in your global USE." fi # dont' really sure if sql is required. Will check later. 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} cp ${FILESDIR}/Makefile.am ${S}/ 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 jdbc2-postgresql-5))" else myconf="${myconf} $(use_with mysql dbdriver org.mysql.Driver)" myconf="${myconf} $(use_with mysql jdbcjar $(java-config -p jdbc-mysql))" fi myconf="${myconf} $(use_with ssl openssl)" econf \ --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 \ --localstatedir=${ROOT}/var/lib/${PN} \ $myconf || die cd ${S} sed -i 's:jikes:modern:g' build.xml || die "sed failed" emake || die "make failed" if use doc ; then emake javadoc || die "make failed" fi } src_install() { make DESTDIR=${D} install || die 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 }