-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
-EAPI="2"
-inherit eutils multilib
+EAPI=4
+inherit user multilib
-DESCRIPTION="Groupware/Email/Jabberserver. Collaboration, Calender, BBS/Forum, Chat with easy install and usage"
+DESCRIPTION="Groupware with BBS/Email/XMPP Server, Collaboration and Calendar"
HOMEPAGE="http://www.citadel.org/"
SRC_URI="http://easyinstall.citadel.org/${P}.tar.gz"
# in all other cases or other ebuilds depending on virtual/mta cause blockers
DEPEND="=dev-libs/libcitadel-${PV}
- >=sys-libs/db-4.1.25_p1
+ >=sys-libs/db-4.2
virtual/libiconv
- ldap? ( >=net-nds/openldap-2.0.27 )
+ ldap? ( net-nds/openldap )
pam? ( sys-libs/pam )
- ssl? ( >=dev-libs/openssl-0.9.6 )"
+ ssl? ( dev-libs/openssl )"
RDEPEND="${DEPEND}
net-mail/mailbase
postfix? ( mail-mta/postfix )"
src_configure() {
econf \
- --with-rundir=/var/run/citadel \
+ --with-autosysconfdir=/var/lib/citadel/data \
--with-datadir=/var/lib/citadel \
+ --with-docdir=/usr/share/doc/${PF} \
+ --with-helpdir=/usr/share/citadel-server \
+ --with-localedir=/usr/share/locale \
+ --with-rundir=/var/run/citadel \
--with-spooldir=/var/spool/citadel \
- --with-autosysconfdir=/var/lib/citadel/data \
+ --with-ssldir=/etc/ssl/citadel \
--with-staticdatadir=/etc/citadel \
--with-sysconfdir=/etc/citadel \
- --with-ssldir=/etc/ssl/citadel \
- --with-helpdir=/usr/share/citadel-server \
- --with-docdir=/usr/share/doc/${PF} \
--with-utility-bindir=/usr/$(get_libdir)/citadel \
- --without-libdspam \
- $(use_enable pic pie) \
+ --with-db \
$(use_with pam) \
- $(use_with ssl openssl) \
- $(use_with ldap) \
- --with-db
+ $(use_enable pic pie) \
+ $(use_with ldap with-ldap) \
+ $(use_with ssl)
}
src_install() {
if use pam ; then
- dodir /etc/pam.d || die "Creating /etc/pam.d failed in sandbox"
+ dodir /etc/pam.d
fi
- emake DESTDIR="${D}" install-new || die "make install failed"
+ emake DESTDIR="${D}" install-new
- # Protect ${MESSAGEBASE}
+ # Protect files created at runtime by the server
echo CONFIG_PROTECT="${MESSAGEBASE}" > "${T}"/10citadel
- doenvd "${T}"/10citadel || die "Config-protecting failed"
+ doenvd "${T}"/10citadel
# Keep emerge from removing empty directories when updating
keepdir "${MESSAGEBASE}"/data
keepdir /etc/citadel/messages
#Fix some permissions and sendmail stuff
- fowners citadel:citadel /etc/citadel /var/lib/citadel || die "Changing owner failed"
- fowners root:citadel /usr/sbin/citmail || die "Changing owner failed"
+ fowners citadel:citadel /etc/citadel /var/lib/citadel
+ fowners root:citadel /usr/sbin/citmail
rm "${D}"/usr/sbin/sendmail || die "Removing sendmail bin failed"
if ! use postfix ; then
- dosym /usr/sbin/citmail /usr/sbin/sendmail || die "Linking sendmail to citmail failed"
- dosym /usr/sbin/citmail /usr/$(get_libdir)/sendmail || die "Compatibility sendmail link failed"
+ dosym /usr/sbin/citmail /usr/sbin/sendmail
+ dosym /usr/sbin/citmail /usr/$(get_libdir)/sendmail
fi
if use ldap ; then
insinto /etc/openldap/schema
- doins openldap/citadel.schema || die "Inserting LDAP schema failed"
- doins openldap/rfc2739.schema || die "Inserting LDAP schema failed"
+ doins openldap/citadel.schema
+ doins openldap/rfc2739.schema
fi
- newinitd "${FILESDIR}"/citadel.init citadel || die "Inserting initscript failed"
- newconfd "${FILESDIR}"/citadel.confd citadel || die "Inserting conf for initscript failed"
+ newinitd "${FILESDIR}"/citadel.init citadel
+ newconfd "${FILESDIR}"/citadel.confd citadel
+
+ dodoc "${FILESDIR}"/README.gentoo
}
pkg_postinst() {
#remove a file Citadel complains about in the logs while running
rm /var/lib/citadel/data/.keep_mail-mta_citadel-0 || die "Removing keepdir dummie failed"
- einfo "The administration tools have been placed in /usr/$(get_libdir)/citadel"
- einfo
- einfo "There are two possible options to get Citadel running, if this is"
- einfo "a new install:"
- einfo
- einfo "1. The no-nonse fullspeed approach with most stuff done for you:"
- einfo "# emerge --config =${CATEGORY}/${PF}"
- einfo
- einfo "2. Manually configuring it with its setup routine:"
- einfo "You should make yourself familiar with Citadels setup:"
- einfo "http://www.citadel.org/doku.php/documentation:cmdman:setup"
- einfo "You probalby do not want to let setup chose the mode of starting"
- einfo
- einfo "The second approach is only recommended to experienced users!!!"
- einfo
- einfo "The service will automatically start after you configured it."
- einfo "Initscript is /etc/init.d/citadel. Also look into /etc/conf.d"
- einfo
- einfo "The following clients are available:"
- einfo "a) the citadel console client was installed with this ebuild"
- einfo "b) www-servers/webcit provides a web-based gui"
+ elog "The administration tools have been placed in /usr/$(get_libdir)/citadel"
+ elog
+ elog "If this is your first install, run the following for a quick setup:"
+ elog "# emerge --config =${CATEGORY}/${PF}"
+ elog
+ elog "For further information check /usr/share/doc/${PF}/README.gentoo"
}
pkg_config() {
einfo "The server should now be up and running, enjoy!"
einfo "Citadel will listen on its default port 504"
if use postfix ; then
- einfo
- einfo "Citadel listens on port 25 by default, even with postfix useflag!"
- einfo "Right now this can only be disabled in WebCit or with the cli client."
- einfo "There is no elegant way to disable that atm, will be fixed upstream."
- einfo "Sorry for this inconvenience!"
+ elog
+ elog "Citadel listens on port 25 by default, even with postfix useflag!"
+ elog "Right now this can only be disabled in WebCit or with the cli client."
+ elog "There is no elegant way to disable that atm, will be fixed upstream."
+ elog "Sorry for this inconvenience!"
fi
}
#!/sbin/runscript
# original Author: Wilfried Goesgens <citadel@outgesourced.org>
-# adapted for Gentoo: the_mgt <themgt@mail.ru>
+# adapted for Gentoo: the_mgt <themgt@uncensored.citadel.org>
depend() {
use dns logger
provide mta
}
-RUNDIR="/var/run/citadel"
DAEMON="/usr/sbin/citserver"
-PIDFILE="${RUNDIR}/citadel.pid"
-SENDCOMMAND="/usr/sbin/sendcommand"
-
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
+CIT_CONFIG="/var/lib/citadel/data/citadel.config"
start() {
+
+ if [ ! -r "${CIT_CONFIG}" ] ; then
+ eerror "Cannot read the configuration file \`${CIT_CONFIG}'"
+ return 1
+ fi
+
ebegin "Starting citserver"
- start-stop-daemon --start --exec /usr/sbin/citserver -- ${CITSERVER_OPTS}
+
+ start-stop-daemon \
+ --start \
+ --exec "${DAEMON}" \
+ -- ${CITSERVER_OPTS}
eend $?
}
stop() {
- ebegin "Stopping citserver"
- ${SENDCOMMAND} DOWN &>/dev/null
- eend $?
-}
+ ebegin "Stopping citserver"
-restart() {
- ebegin "Restarting citserver"
- #sleep command mandatory due to long shutdown time!
- svc_stop && sleep 3 && svc_start
- eend $? "Failed to restart Citadel"
+ start-stop-daemon \
+ --stop \
+ --exec "${DAEMON}" \
+ --retry 61
+ eend $?
}