# Copyright 2015 awesome information technology, http://awesome-it.de # Distributed under the terms of the GNU General Public License v3 # $Header: $ EAPI=5 DESCRIPTION="The Kolab Groupware Solution." HOMEPAGE="http://www.kolab.org" LICENSE="GPL" SLOT="0" KEYWORDS="~amd64" IUSE="" # kolab DEPEND="sys-apps/coreutils" # kolab-cli, kolab-conf, kolab-server DEPEND="${DEPEND} =dev-python/pykolab-0.7.1" # kolab-imap DEPEND="${DEPEND} >=net-mail/cyrus-imapd-2.5[sieve,-mysql,ldap,nntp,replication,perl] =dev-python/pykolab-0.7.1" # kolab-ldap DEPEND="${DEPEND} =net-nds/389-ds-base-1.3.0.2-r2 =net-nds/389-admin-1.1.31-r1 =net-nds/kolab-schema-3.1" # kolab-mta DEPEND="${DEPEND} mail-filter/amavisd-new app-antivirus/clamav mail-mta/postfix mail-filter/spamassassin =dev-python/pykolab-0.7.1" # kolab-saslauthd DEPEND="${DEPEND} =dev-python/pykolab-0.7.1 mail-mta/postfix[sasl]" # kolab-utils DEPEND="${DEPEND} ~dev-util/kolab-utils-3.1" # kolab-webadmin DEPEND="${DEPEND} =www-apps/kolab-webadmin-3.2.1" # kolab-webclient DEPEND="${DEPEND} =www-apps/kolab-chwala-0.2 =www-apps/kolab-irony-0.2.8 ~www-apps/kolab-freebusy-1.0.5 =www-apps/kolab-syncroton-2.3.0 virtual/mysql >=www-apps/kolab-roundcube-1.1.0 >=www-apps/kolab-roundcube-compose-addressbook-8.0.4 >=www-apps/kolab-roundcube-contextmenu-2.1 >=www-apps/kolab-roundcube-converse-0.8.3.0 >=www-apps/kolab-roundcube-listcommands-2.3.5 >=www-apps/kolab-roundcube-recipient-to-contact-0.3 >=www-apps/kolab-roundcube-mark-as-junk2-1.9" DEPEND="${DEPEND} =net-libs/libkolab-0.6.0 =net-libs/libkolabxml-1.1.0" RDEPEND="${DEPEND}" src_unpack() { mkdir $S } src_install() { insinto "/usr/share/kolab/updates" doins -r "$FILESDIR/updates-${PV}/"* for f in $(cd ${D} && find . -iname '*.sh') ; do fperms +x "/${f}" done } pkg_postinst() { einfo "Is this is a fresh installation, adjust the default settings " einfo "in /etc/kolab/kolab.conf and execute the following command to " einfo "run the initial setup:" einfo einfo "# emerge --config \"=${CATEGORY}/${PF}\"" einfo einfo "If this is an update, just run the following command and choose " einfo "to update an existing installation when prompted:" einfo einfo "# emerge --config \"=${CATEGORY}/${PF}\"" einfo einfo "Additional installation or update notes can be found at " einfo "http://wiki.awesome-it.de/kolab and http://docs.kolab.org" } pkg_config() { einfo "Upgrade an existing installation? [Y|n] " do_upgrade="" while true do read -r do_upgrade if [[ $do_upgrade == "n" || $do_upgrade == "N" ]] ; then do_upgrade="" && break elif [[ $do_upgrade == "y" || $do_upgrade == "Y" || $do_upgrade == "" ]] ; then do_upgrade=1 && break else eerror "Please type either \"Y\" or \"N\" ... " ; fi done if [[ $do_upgrade ]] ; then einfo "Please make sure, that all Kolab services and Postfix are stopped." einfo "Press enter to continue, strg-c to cancel ..." read update_basedir="/usr/share/kolab/updates" update_completed="$update_basedir/.${PV}" # Apply patches and run update scripts for p in $(cd "$update_basedir" && find . -iname '*.diff' -o -iname '*.patch' -o -iname '*.sh' | sort) ; do grep "$p" "$update_completed" &>/dev/null && continue dir="/$(dirname $p)" dir=$(realpath "$dir") target_filename=$(basename ${p%.*}) if [[ ${p##*.} == "sh" ]] ; then script=$(realpath "$update_basedir/$p") einfo "Running script \"$script\" ..." log=$(mktemp) if ! $script ; then die "... failed, please fix the error above and re-try." else echo "$p" >> "$update_completed" rm -f ${dir}/._cfg*_${target_filename} fi else patch_file=$(realpath "$update_basedir/$p") einfo "Applying \"$patch_file\" to \"$target_filename\" in \"$dir\" ..." if ! log=$(patch -b -s -N -d "$dir" -r - < $patch_file) ; then if echo $log | grep "Reversed" &>/dev/null ; then echo "$p" >> "$update_completed" else echo $log ewarn "... patch failed, ignore." fi else echo "$p" >> "$update_completed" rm -f ${dir}/._cfg*_${target_filename} fi fi done else einfo "Running setup-kolab ..." if ! setup-kolab ; then die "Setup failed. Try to manually run \"setup-kolab -l debug\"." fi fi einfo "Setup done. Rumble young man, rumble!" }