# Copyright 2015 awesome information technology, http://awesome-it.de # Distributed under the terms of the GNU General Public License v3 # $Header: $ EAPI="5" inherit eutils git-2 EGIT_REPO_URI="https://git.kolab.org/diffusion/I/irony.git" [[ ${PV} == "9999" ]] || EGIT_COMMIT="iRony-${PV}" DESCRIPTION="Kolab WebDAV/CalDAV/CardDAV Server" HOMEPAGE="http://kolab.org" LICENSE="AGPLv3+" KEYWORDS="~amd64" IUSE="+nginx" SLOT="0" DEPEND="virtual/httpd-php >=dev-lang/php-5.3.3 net-misc/curl www-apps/kolab-roundcube www-apps/kolab-chwala nginx? ( www-servers/nginx dev-lang/php[fpm] )" RDEPEND="${DEPEND}" IRONY_DIR="/usr/share/kolab-irony" IRONY_LOG_DIR="/var/log/kolab/irony" IRONY_CONF_DIR="/etc/kolab-irony" CHWALA_DIR="/usr/share/kolab-chwala" ROUNDCUBE_DIR="/usr/share/kolab-roundcube" ROUNDCUBE_CONF_DIR="/etc/kolab-roundcube" WWW_USER="nobody" use nginx && WWW_USER="nginx" src_prepare() { cd ${S} # Link required Roundcube libraries ln -s "${ROUNDCUBE_DIR}/plugins" "lib/plugins" ln -s "${ROUNDCUBE_DIR}/program/lib/Roundcube" "lib/Roundcube" # Link Roundcube's config ln -s "${ROUNDCUBE_CONF_DIR}/config.inc.php" "config/config.inc.php" ln -s "${ROUNDCUBE_CONF_DIR}/defaults.inc.php" "config/defaults.inc.php" # Copy dependencies from Chwala's file API. Make sure to not copy # chwala's lib/ext directory since this contains conflicting PEAR # libs. mkdir "lib/FileAPI" cp -a "${CHWALA_DIR}/lib/"* "lib/FileAPI" rm -r "lib/FileAPI/ext" # Link Chwala's file API # Running PHP might create this addpredict /var/lib/net-snmp/mib_indexes # Set temp Composer home export COMPOSER_HOME="${S}/composer" elog "Installing vendor files using PHP composer, this can take a while ..." curl -s http://getcomposer.org/installer | php -- --version=1.0.0-alpha7 &>/dev/null php composer.phar install || die "Error while installing vendor files." rm -rf $COMPOSER_HOME # Adopt config to this setup epatch "${FILESDIR}/dav.inc-${PV}.patch" } src_install() { dodir "${IRONY_CONF_DIR}" insinto "${IRONY_CONF_DIR}" newins "config/dav.inc.php.sample" "dav.inc.php" for c in $(ls config) ; do doins "config/$c" done rm -rf "config" ln -s "${IRONY_CONF_DIR}" "config" dodir "${IRONY_LOG_DIR}" fowners "${WWW_USER}" "${IRONY_LOG_DIR}" [[ -d logs ]] && rm -rf logs ln -s "${IRONY_LOG_DIR}" "logs" dodir "${IRONY_DIR}" insinto "${IRONY_DIR}" doins -r "public_html" doins -r "lib" doins -r "vendor" doins "config" doins "logs" if use nginx ; then insinto "/etc/nginx/conf.d" newins "${FILESDIR}/nginx.conf" "kolab-irony.conf" dodir "/etc/php/fpm.d" insinto "/etc/php/fpm.d" newins "${FILESDIR}/php-fpm.conf" "kolab-irony.conf" fi }