diff options
Diffstat (limited to 'gnustep-apps/sogo/sogo-9999.ebuild')
-rw-r--r-- | gnustep-apps/sogo/sogo-9999.ebuild | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/gnustep-apps/sogo/sogo-9999.ebuild b/gnustep-apps/sogo/sogo-9999.ebuild new file mode 100644 index 0000000..8f27b78 --- /dev/null +++ b/gnustep-apps/sogo/sogo-9999.ebuild @@ -0,0 +1,154 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=2 + +inherit gnustep-base flag-o-matic + +MY_PN="SOGo" +MY_PV="${PV/_/}" + +DESCRIPTION="Groupware server built around OpenGroupware.org and the SOPE application server" +HOMEPAGE="http://sogo.opengroupware.org/" +SRC_URI="" +KEYWORDS="" +LICENSE="GPL-2" +SLOT="0" +IUSE="postgres mysql logrotate" +DEPEND="gnustep-libs/sope[ldap,mysql?,postgres?] + !mysql? ( !postgres? ( virtual/postgresql-base ) ) + dev-util/monotone + dev-libs/libmemcached + net-nds/openldap" +RDEPEND="${DEPEND} + logrotate? ( app-admin/logrotate )" + +S=${WORKDIR}/${MY_PN} + +pkg_setup() { + gnustep-base_pkg_setup + local myLDFLAGS="$(gnustep-config --variable=LDFLAGS 2>/dev/null)" + if [ -n "${myLDFLAGS}" ] && (echo "${myLDFLAGS}" | grep -q "\-\-a\(dd\|s\)\-needed" 2>/dev/null); then + ewarn + ewarn "You seem to have compiled GNUstep with custom LDFLAGS:" + for foo in $(gnustep-config --variable=LDFLAGS); do + ewarn " "${foo} + done + ewarn + ewarn "SOGo is very sensitive regarding custom LDFLAGS. Especially with:" + ewarn " --add-needed" + ewarn " --as-needed" + ewarn + ewarn "If your SOGo install does not work as expected then please re-emerge SOGo," + ewarn "SOPE and your GNUstep (base and make) without any LDFLAGS before filing bugs." + ewarn + fi + append-ldflags -Wl,--no-as-needed +} + +src_unpack() { + EMTN_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/mtn-src" + addwrite "${EMTN_STORE_DIR}" + if [ ! -d "${EMTN_STORE_DIR}" ]; then + mkdir -p "${EMTN_STORE_DIR}" || die "Can't mkdir ${EMTN_STORE_DIR}." + fi + cd "${EMTN_STORE_DIR}" || die "Can't chdir to ${EMTN_STORE_DIR}" + + if [ ! -f "db.mtn" ]; then + mtn db init --db=./db.mtn || die "Failed to initialize Monotone database" + fi + + # Pull Inverse's SOGo Monotone repository + mtn --db=./db.mtn pull inverse.ca ca.inverse.sogo || die "Failed to pull Monotone repository" + if [ ! -d "SOGo" ]; then + mtn --db=./db.mtn checkout --branch ca.inverse.sogo SOGo || die "Failed to checkout SOGo branch" + else + cd SOGo + mtn update + fi + + # Pull SOGo Connector, SOGo Integrator and Lightning (Inverse Edition) + #mtn --db=./db.mtn pull inverse.ca ca.inverse.sogo-connector + #mtn --db=./db.mtn checkout --branch ca.inverse.sogo-connector + #mtn --db=./db.mtn pull inverse.ca ca.inverse.sogo-integrator + #mtn --db=./db.mtn checkout --branch ca.inverse.sogo-integrator + #mtn --db=./db.mtn pull inverse.ca ca.inverse.calendar + #mtn --db=./db.mtn checkout --branch ca.inverse.calendar + + mkdir -p "${S}" + cd "${EMTN_STORE_DIR}"/SOGo + rsync -rlpgo --exclude=".mtn-ignore" . "${S}" || die "Can't export to ${S}" + + cd "${S}" + gnustep-base_src_prepare +} + +src_configure() { + egnustep_env + ./configure \ + $(use_enable debug) \ + $(use_enable debug strip) \ + $(use_enable ldap ldap-config) \ + || die "configure failed" +} + +src_test() { + # SOGo tends to break horribly if gnustep-make is build with LDFLAGS such as + # -Wl,--add-needed or -Wl,--as-needed. So we check here some vital binaries. + # Check if Appointments.SOGo, Contacts.SOGo, Mailer.SOGo is correctly build/linked + local myAppointmentsLDD=$(ldd -d "${S}"/SoObjects/Appointments/Appointments.SOGo/Appointments 2>&1 | grep "lib\(OGoContentStore\|NG\(Cards\|ObjWeb\|Mime\|Streams\|Extensions\)\|SOGo\|GDL\(Access\|ContentStore\)\|EOControl\|DOM\|SaxObjC\|XmlRpc\)\.so\." | wc -l) + local myContactsLDD=$(ldd -d "${S}"/SoObjects/Contacts/Contacts.SOGo/Contacts 2>&1 | grep "lib\(OGoContentStore\|NG\(Cards\|ObjWeb\|Mime\|Streams\|Extensions\)\|SOGo\|GDL\(Access\|ContentStore\)\|EOControl\|DOM\|SaxObjC\|XmlRpc\)\.so\." | wc -l) + local myMailerLDD=$(ldd -d "${S}"/SoObjects/Mailer/Mailer.SOGo/Mailer 2>&1 | grep "lib\(OGoContentStore\|NG\(Cards\|ObjWeb\|Mime\|Streams\|Extensions\)\|SOGo\|GDL\(Access\|ContentStore\)\|EOControl\|DOM\|SaxObjC\|XmlRpc\)\.so\." | wc -l) + if [ -z "${myAppointmentsLDD}" -o -z "${myContactsLDD}" -o -z "${myMailerLDD}" -o "${myAppointmentsLDD}" != "13" -o "${myContactsLDD}" != "13" -o "${myMailerLDD}" != "13" ]; then + ewarn + ewarn "This SOGo installtion is not correctly build. Probably you are using" + ewarn "LDFLAGS to build SOGo that are not correctly handled in SOGo or you" + ewarn "have emerged gnustep-base/gnustep-make with LDFLAGS which are" + ewarn "preventing SOGo to link the needed libraries into it's own binaries." + ewarn "Please remerge gnustep-base/gnustep-make and/or SOGo with empty LDFLAGS." + ewarn + die "SOGo build is not complete (Appointments.SOGo, Contacts.SOGo, Mailer.SOGo)" + fi + # We could do the same for AdministrationUI.SOGo, CommonUI.SOGo, ContactsUI.SOGo, + # MailPartViewers.SOGo, MailerUI.SOGo, MainUI.SOGo, SOGoElements.wox and SchedulerUI.SOGo + # but if Appointments.SOGo, Contacts.SOGo and Mailer.SOGo are build correctly then the + # chance that the others are build/linked correctly is pretty high. So we don't test again. +} + +src_install() { + gnustep-base_src_install + newinitd "${FILESDIR}"/sogod.initd.1 sogod \ + || die "init.d script installation failed" + newconfd "${FILESDIR}"/sogod.confd sogod \ + || die "conf.d script installation failed" + diropts -m 0770 -o sogo -g root + dodir /var/log/sogo + dodir /var/run/sogod + if use logrotate; then + insopts -m644 -o root -g root + insinto /etc/logrotate.d + newins Scripts/logrotate SOGo || die "Failed to install logrotate.d file" + fi + newdoc Apache/SOGo.conf SOGo-Apache.conf +} + +pkg_preinst() { + enewuser sogo -1 /bin/bash /var/lib/sogo +} + +pkg_postinst() { + gnustep-base_pkg_postinst + elog + elog "Now follow the steps from the SOGo documentation:" + elog "http://www.inverse.ca/contributions/sogo/documentation.html#c803" + elog "The sogo user home directory is /var/lib/sogo" + elog + elog "Then you can start/stop sogo with /etc/init.d/sogod" + elog + elog "If you plan to use SOGo with Apache then please have a look at the" + elog "'SOGo-Apache.conf' included in the documentation directory of this" + elog "SOGo installation and don't forget to add '-D PROXY' to your" + elog "APACHE2_OPTS." + elog +} |