# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils mailer DESCRIPTION="Advanced multiprotocol messaging and collaboration server" HOMEPAGE="http://www.citadel.org/" SRC_URI="http://easyinstall.citadel.org/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86 ~ppc ~sparc" IUSE="ldap ssl zlib pam ncurses" S=${WORKDIR}/${PN} MESSAGEBASE="/var/lib/citadel" #should I bring in the calendar use flag? DEPEND=">=dev-libs/libical-0.24_rc4 >=sys-devel/autoconf-2.53 >=sys-libs/db-4.1.25_p1 ldap? ( >=net-nds/openldap-2.0.27 ) ssl? ( >=dev-libs/openssl-0.9.6 ) zlib? ( >=sys-libs/zlib-1.1.4 ) pam? ( sys-libs/pam ) ncurses? ( sys-libs/ncurses ) !ncurses? ( dev-libs/newt )" pkg_preinst() { #Create the user/group that the sever will run as. #Homedir needs to be the same as --with-datadir einfo "Adding Citadel User/Group" enewgroup citadel 175 enewuser citadel 175 /dev/null ${MESSAGEBASE} citadel } src_compile() { #Directory locations borrowed from citadel/debian/rules econf \ --prefix=/usr/sbin \ --with-sysconfdir=/etc/citadel \ --with-spooldir=/var/spool/citadel \ --with-datadir=${MESSAGEBASE} \ --with-rundir=/var/run/citadel \ --with-docdir=/usr/share/doc/${PF}/ \ $(use_with pam) \ $(use_with ssl openssl) \ $(use_with zlib) \ $(use_with ldap) \ $(use_with ncurses) \ --with-libical \ --with-db \ --enable-autologin \ || die "./configure failed" emake || die "make failed" } src_install() { if use pam ; then dodir /etc/pam.d fi make root=${D} install-new || die "make install failed" keepdir /var/lib/citadel/data mv ${D}/usr/sbin/setup ${D}/usr/sbin/citsetup rm ${D}/usr/sbin/sendmail if use mailwrapper ; then dosym /usr/sbin/citmail /usr/sbin/sendmail.citadel mailer_install_conf else dodir /usr/lib dosym /usr/sbin/citmail /usr/lib/sendmail dosym /usr/sbin/citmail /usr/sbin/sendmail fi if use ldap ; then dodir /etc/openldap/schema cp ${D}/usr/share/doc/citadel-6.63/citadel-openldap.schema ${D}/etc/openldap/schema fi prepall prepalldocs } pkg_config() { /usr/sbin/citsetup -q if test -f /etc/services then if ! grep '^citadel' /etc/services >/dev/null then echo "citadel 504/tcp # citadel" >> /etc/services fi fi if test -f /etc/inittab then grep -v 'citserver' /etc/inittab >/etc/inittab.new && \ echo "cit1:2345:respawn:/usr/sbin/citserver -h/var/lib/citadel -x7 -llocal4" >> /etc/inittab.new && \ mv -f /etc/inittab.new /etc/inittab /sbin/init q fi einfo "Citadel has been started." } pkg_prerm() { if test -f /etc/inittab then grep -v 'citserver' < /etc/inittab > /etc/inittab.new && \ mv -f /etc/inittab.new /etc/inittab /sbin/init q fi }