# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit java-pkg eutils webapp DESCRIPTION="A groupware for sharing items with other users" HOMEPAGE="http://www.open-xchange.org/" SRC_URI="http://mirror.open-xchange.org/download/${P}.tar.gz" LICENSE="GPL-2" KEYWORDS="~x86" IUSE="ssl doc" S="${WORKDIR}/${PN}.${PV}" DEPEND=">=virtual/jdk-1.4 >=dev-java/java-config-1.2 dev-db/postgresql >=www-servers/tomcat-5.0.0 net-nds/openldap dev-java/sun-javamail-bin >=net-www/apache-2.0.0 sys-apps/findutils sys-apps/sed net-www/webapp-config dev-java/jdbc2-postgresql dev-java/jdom dev-java/jikes dev-java/servletapi 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 app-admin/sudo app-text/ispell ssl? ( dev-libs/openssl ) dev-perl/mod_perl" pkg_setup() { webapp_pkg_setup # # Check if postgresql was configured # if [ ! -f /var/lib/postgresql/data/PG_VERSION ] ; then ewarn "Please configure your database first with 'ebuild pkgname config'" die fi } src_unpack() { unpack ${A} ; cd ${S} rm -rf ${S}/autom4te.cache aclocal -I m4/ && autoconf || die "reconfigure failed" } src_compile() { ./configure \ --enable-webdav \ --with-mailjar=${ROOT}/usr/share/sun-javamail-bin/lib/mail.jar \ --with-activationjar=${ROOT}/usr/share/sun-jaf-bin/lib/activation.jar \ --with-jsdkjar=${ROOT}/usr/share/servletapi-2.4/lib/servlet-api.jar \ --with-jdbcjar=${ROOT}/usr/share/jdbc2-postgresql-5/lib/pg73jdbc2.jar \ --with-jdomjar=${ROOT}/usr/share/jdom/lib/jdom.jar \ --with-xercesjar=${ROOT}/usr/share/xerces-2/lib/xercesImpl.jar \ --with-dbname=openexchange \ --with-dbuser=openexchange \ --with-runuid=apache \ --prefix=${D}opt/${PN} || die "bad ./configure" # --with-dbpass=secret # replace the string "jikes" with "modern". We dont want to see all jikes warnings sed -i "s|jikes|modern|g" build.xml emake || die "make failed" if use doc ; then emake javadoc || die "javadoc failed" fi # Replace WORKDIR find ${S}/lib/ -type f ! -name '*.in' | xargs perl -pi -e "s|${D}|/|g" find ${S}/bin/ -type f ! -name '*.in' | xargs perl -pi -e "s|${D}|/|g" find ${S}/sbin/ -type f ! -name '*.in' | xargs perl -pi -e "s|${D}|/|g" find ${S}/system/ -type f ! -name '*.in' | xargs perl -pi -e "s|${D}|/|g" find ${S}/webmail/ -type f ! -name '*.in' | xargs perl -pi -e "s|${D}|/|g" find ${S}/groupware/ -type f ! -name '*.in' | xargs perl -pi -e "s|${D}|/|g" find ${S}/src/misc/login/ -type f -name login.pm | xargs perl -pi -e "s|${D}|/|g" find ${S}/conf/ -type f ! -name '*.in' | xargs perl -pi -e "s|${D}|/|g" } src_install() { # next step is to prepare webapp directory in /usr/share/webapp/open-xchange/ webapp_src_preinst # DOC dodoc AUTHORS ChangeLog INSTALL NEWS README # copy all images, css and javascript dodir ${MY_HTDOCSDIR}/cfintranet/ dodir ${MY_HTDOCSDIR}/cfintranet/webmail cd system/www/groupware cp -r css images javascript ${D}${MY_HTDOCSDIR}/cfintranet/. cd ../webmail cp -r css images javascript ${D}${MY_HTDOCSDIR}/cfintranet/webmail/. # Install this big thing cd ${S} make \ PREFIX=${D}opt/${PN} \ install || die "Failed on make install" # create user mailadmin, needed for mailsupport enewuser mailadmin -1 -1 /dev/null users # for file in ${D}${MY_HTDOCSDIR}/cfintranet; do # echo "${file}" # webapp_serverowned "${file}" # done # Init script exeinto /etc/init.d insopts -m0755 newexe ${D}opt/${PN}/etc/init.d/openexchange openexchange # Copy rest of cgi scripts cd ${D} insinto ${MY_CGIBINDIR} insopts -m0755 newins ${D}opt/${PN}/share/perl/login.pl login.pl newins ${D}opt/${PN}/share/perl/login.pm login.pm # show config webapp_postinst_txt en ${FILESDIR}/postinstall-en.txt webapp_hook_script ${FILESDIR}/reconfig # Install webapp webapp_src_install }