# 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}" # Contains fixes for serious bugs in 0.2.6 release [[ ${PV} == "0.2.6" ]] && EGIT_COMMIT="16d0e127a1e9fb8399c841aad315466bff3d5a3a" DESCRIPTION="Kolab WebDAV/CalDAV/CardDAV Server" HOMEPAGE="http://kolab.org" LICENSE="AGPLv3+" KEYWORDS="~amd64" IUSE="" SLOT="0" DEPEND="virtual/httpd-php >=dev-lang/php-5.3.3 net-misc/curl >=www-apps/kolab-roundcube-1.0.3 www-apps/kolab-chwala www-servers/nginx dev-lang/php[fpm] >=dev-php/composer-1.0.0_alpha10" 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="nginx" pkg_pretend() { # Check for Github API token if [[ -n "$GITHUB_API_TOKEN" ]] ; then einfo "Using Github API token \"$GITHUB_API_TOKEN\" from environment variable GITHUB_API_TOKEN ..." else eerror "Please specify a Github API key in GITHUB_API_TOKEN environment" eerror "variable to avoid exhausting the Github API limit when installing" eerror "vendor files using PHP's composer." eerror "You can manage your Github API tokens here: " eerror "https://github.com/settings/tokens" die "Please specify a Github API key in GITHUB_API_TOKEN environment variable!" fi } 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. cp -a "${CHWALA_DIR}/lib" "lib/FileAPI" pushd "lib/FileAPI/ext/" rm -rf "Auth" "HTTP" "Mail" "Net" "PEAR5.php" "PEAR.php" "Roundcube" popd # Apply patches for patch in $(find ${FILESDIR} -iname "${PF}-*.patch") ; do epatch "${patch}" done # Running PHP might create this addpredict /var/lib/net-snmp/mib_indexes # Add Github API token to composer file composer config -g github-oauth.github.com $GITHUB_API_TOKEN elog "Installing vendor files using PHP composer, this can take a while ..." composer install || die "Error while installing vendor files." } 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" dodir "${IRONY_DIR}/temp" fowners "${WWW_USER}" "${IRONY_DIR}/temp" 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" }