From 5a6dd13775124f855145c8849b85abee7967281e Mon Sep 17 00:00:00 2001 From: "Stefan Garthe (the_mgt)" Date: Mon, 20 Feb 2012 00:21:23 +0000 Subject: mail-mta/citadel: Version bump to 8.04 and EAPI=4 cleanups. Initscript improved and gentoo helpfile added. Thanks to floppym, hasufell and everyone else who was most helpful. svn path=/sunrise/; revision=12765 --- mail-mta/citadel/ChangeLog | 10 +- mail-mta/citadel/Manifest | 9 +- mail-mta/citadel/citadel-7.86.ebuild | 197 ----------------------------------- mail-mta/citadel/citadel-8.04.ebuild | 184 ++++++++++++++++++++++++++++++++ mail-mta/citadel/files/README.gentoo | 21 ++++ mail-mta/citadel/files/citadel.init | 36 ++++--- 6 files changed, 238 insertions(+), 219 deletions(-) delete mode 100644 mail-mta/citadel/citadel-7.86.ebuild create mode 100644 mail-mta/citadel/citadel-8.04.ebuild create mode 100644 mail-mta/citadel/files/README.gentoo (limited to 'mail-mta') diff --git a/mail-mta/citadel/ChangeLog b/mail-mta/citadel/ChangeLog index 25f886bb3..5e4ead7aa 100644 --- a/mail-mta/citadel/ChangeLog +++ b/mail-mta/citadel/ChangeLog @@ -1,7 +1,15 @@ # ChangeLog for mail-mta/citadel -# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ +*citadel-8.04 (20 Feb 2012) + + 20 Feb 2012; the_mgt themgt@uncensored.citadel.org +citadel-8.04.ebuild, + +files/README.gentoo, -C, files/citadel.init: + Version bump to 8.04 and EAPI=4 cleanups. Initscript improved and gentoo + helpfile added. Thanks to floppym, hasufell and everyone else who was most + helpful. + 07 Oct 2011; Markos Chandras citadel-7.86.ebuild: Drop non-existing dependency to net-mail/mainwrapper diff --git a/mail-mta/citadel/Manifest b/mail-mta/citadel/Manifest index 360f79ad8..d252acbf1 100644 --- a/mail-mta/citadel/Manifest +++ b/mail-mta/citadel/Manifest @@ -1,6 +1,7 @@ +AUX README.gentoo 816 RMD160 9da85bbaab3ef5beb89fca768cd919cc54d58852 SHA1 9e94d959808799bb77f1cf3b4006f7f6796cc67c SHA256 c78323d4a5274c1f3e08d92a8e6e7b2259ef1e06cf0ecf8f10546857b8ae33ff AUX citadel.confd 957 RMD160 50f8ade88eb6b0c88aa94b42e13f81b725099027 SHA1 091d9223315c5d390ecd18bba44198ed6dfe2c22 SHA256 ef9309d200cb0617b91ee0983db41b53e424a9b4095e0f5ec76112866865871f -AUX citadel.init 767 RMD160 afd16e3aec56496d4fa3ee59966428e742d31dd1 SHA1 719871e18211554f1088ef3ad2ca438c9c67c20d SHA256 16fc77dc01825c920d38864b880f0a00bc22aee5ebc552518c0bf94cb8b4b7c7 -DIST citadel-7.86.tar.gz 843785 RMD160 d16ac1ecd2fe50398a3de16c9bcbbe66865a68bf SHA1 2635cf494d3453c3aa0cfbae9cdffcd560a07aed SHA256 a23b0a25e441727221d198d429101c811be0c26080d46fab40d74258a1e048b8 -EBUILD citadel-7.86.ebuild 6630 RMD160 397a013f4e24e13ddeaced26d8a550a1ab41d46e SHA1 d6f4bb5d607a0abb9e1f9b60e194d3e81067fc7e SHA256 1c70041335231828d587cb592fa0b8c71cc17da460abe99dc2dba87dc93af91e -MISC ChangeLog 2539 RMD160 df6ed096fe78909c8d0ddd2e233acb5d970c2d59 SHA1 23531cde2df8740e21df6a7904ab742e616bd345 SHA256 98103374a184ef8528864faf0167afdc30ffe1378865c17e79242713c84e6b95 +AUX citadel.init 721 RMD160 7514378c9e14c395aa91906827eb604a7687dfc5 SHA1 c0889d44739a9e7d3ff3a7102a8fa1ea80f07cdf SHA256 1939772ad1b5aa93d88b88918b2ef67d0d0b52df3c288fc78d74af085e17511f +DIST citadel-8.04.tar.gz 807652 RMD160 0c54045492fe328fbb2158968b0a8a20918df527 SHA1 4a1512a16e8879d7f84915d5441b07fb3fd3df6b SHA256 61a59864654c721f726b34fbdb41f61131a698f5cb87089db0ef3969e6b5333c +EBUILD citadel-8.04.ebuild 5513 RMD160 a2ade01c4a64f6aa2052af8dfdb479c96f92f958 SHA1 8c664d41faeb6c34da0d431b79e2108ea16e8377 SHA256 54c6a743fa4cdc9e3e8de619b9da823101193e3bd6dd3c4a9748347a6bf15b2c +MISC ChangeLog 2855 RMD160 6595d62562425cd9ed5eafc6b161ebc1a156f29a SHA1 f28c32c0dd9669f8876cc6eb91f635c19257723d SHA256 72b1ca0de071dd19e56c67c2db4c315ac2c3e3b176f86a5c6b9c0f716a51fec0 MISC metadata.xml 1214 RMD160 4438c8e0ed49d08c2c430d92b49b71e9ec2e04a5 SHA1 eb1644e458ea40d4d55abaf21855ffa1c6da8c00 SHA256 2cd8b3283e2f7be00cc71061203b716b6143340319634cd20d387e1f91d1b8d2 diff --git a/mail-mta/citadel/citadel-7.86.ebuild b/mail-mta/citadel/citadel-7.86.ebuild deleted file mode 100644 index 7a890630f..000000000 --- a/mail-mta/citadel/citadel-7.86.ebuild +++ /dev/null @@ -1,197 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="2" -inherit eutils multilib - -DESCRIPTION="Groupware/Email/Jabberserver. Collaboration, Calender, BBS/Forum, Chat with easy install and usage" -HOMEPAGE="http://www.citadel.org/" -SRC_URI="http://easyinstall.citadel.org/${P}.tar.gz" - -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="ldap pam pic postfix ssl threads" -# postfix can be used as mta with citadel. citadel needs to provide virtual/mta -# 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 - virtual/libiconv - ldap? ( >=net-nds/openldap-2.0.27 ) - pam? ( sys-libs/pam ) - ssl? ( >=dev-libs/openssl-0.9.6 )" -RDEPEND="${DEPEND} - net-mail/mailbase - postfix? ( mail-mta/postfix )" - -MESSAGEBASE="/var/lib/citadel" - -pkg_setup() { - #Homedir needs to be the same as --with-datadir - einfo "Adding Citadel User/Group" - enewgroup citadel - enewuser citadel -1 -1 ${MESSAGEBASE} citadel,mail -} - -src_configure() { - econf \ - --with-rundir=/var/run/citadel \ - --with-datadir=/var/lib/citadel \ - --with-spooldir=/var/spool/citadel \ - --with-autosysconfdir=/var/lib/citadel/data \ - --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) \ - $(use_with pam) \ - $(use_with ssl openssl) \ - $(use_with ldap) \ - --with-db -} - -src_install() { - if use pam ; then - dodir /etc/pam.d || die "Creating /etc/pam.d failed in sandbox" - fi - - emake DESTDIR="${D}" install-new || die "make install failed" - - # Protect ${MESSAGEBASE} - echo CONFIG_PROTECT="${MESSAGEBASE}" > "${T}"/10citadel - doenvd "${T}"/10citadel || die "Config-protecting failed" - - # Keep emerge from removing empty directories when updating - keepdir "${MESSAGEBASE}"/data - keepdir /var/spool/citadel/network/{systems,spoolout,spoolin} - keepdir /var/run/citadel/network/{systems,spoolout,spoolin} - 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" - 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" - 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" - fi - - newinitd "${FILESDIR}"/citadel.init citadel || die "Inserting initscript failed" - newconfd "${FILESDIR}"/citadel.confd citadel || die "Inserting conf for initscript failed" -} - -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" -} - -pkg_config() { - #we have to stop the server if it is accidently running - [ -f /var/run/citadel/citadel.socket ] && \ - die "Citadel seems to be running, please stop it while configuring!" - - #Citadel's setup uses a few enviromental variables to control it. - # Mandatory for non-interactive setup! - export CITADEL_INSTALLER="yes" - - # Citadel location. - export CITADEL="/var/run/citadel/" - - if use ldap ; then - export SLAPD_Binary="/usr/$(get_libdir)/openldap/slapd" - export LDAP_CONFIG="/etc/openldap/sldap.conf" - fi - - # Don't create any inittab/initscript/xinet stuff entry. - # We'll provide our own init script - export CREATE_INITTAB_ENTRY="no" - export CREATE_XINETD_ENTRY="no" - export NO_INIT_SCRIPTS="yes" - export ACT_AS_MTA="no" #just prohibits setup to mess with init scripts - - einfo "On which ip should the server listen?" - einfo "Press enter to default to 0.0.0.0 and listen on all interfaces." - read -rp " >" ipadress ; echo - if [ -z "$ipadress" ] ; then - export IP_ADDR="0.0.0.0" - else - export IP_ADDR="$ipadress" - fi - - # The main admin name for citadel can be chosen at random - einfo "Insert a name for your citadel admin account:" - read -rp " >" sysadminname ; echo - export SYSADMIN_NAME="$sysadminname" - - local pwd1="misch" - local pwd2="masch" - - until [[ "x$pwd1" = "x$pwd2" ]] ; do - einfo "Insert a password for the citadel admin user" - einfo "Avoid [\"'\\_%] characters in the password" - read -rsp " >" pwd1 ; echo - - einfo "Retype the password" - read -rsp " >" pwd2 ; echo - - if [[ "x$pwd1" != "x$pwd2" ]] ; then - ewarn "Passwords are not the same" - fi - done - export SYSADMIN_PW="$pwd2" - - #Now we will create the config using defaults and enviromental variables. - /usr/$(get_libdir)/citadel/setup -q - unset SYSADMIN_PW - - #Verify the /etc/services entry was made - if [ -f /etc/services ] && ! grep -q '^citadel' /etc/services ; then - echo "citadel 504/tcp # citadel" >> /etc/services - fi - - einfo "Be sure to read the documentation in /usr/share/doc/${PF}" - einfo - 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!" - fi -} diff --git a/mail-mta/citadel/citadel-8.04.ebuild b/mail-mta/citadel/citadel-8.04.ebuild new file mode 100644 index 000000000..53f6dd7b7 --- /dev/null +++ b/mail-mta/citadel/citadel-8.04.ebuild @@ -0,0 +1,184 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=4 +inherit user multilib + +DESCRIPTION="Groupware with BBS/Email/XMPP Server, Collaboration and Calendar" +HOMEPAGE="http://www.citadel.org/" +SRC_URI="http://easyinstall.citadel.org/${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="ldap pam pic postfix ssl threads" +# postfix can be used as mta with citadel. citadel needs to provide virtual/mta +# in all other cases or other ebuilds depending on virtual/mta cause blockers + +DEPEND="=dev-libs/libcitadel-${PV} + >=sys-libs/db-4.2 + virtual/libiconv + ldap? ( net-nds/openldap ) + pam? ( sys-libs/pam ) + ssl? ( dev-libs/openssl )" +RDEPEND="${DEPEND} + net-mail/mailbase + postfix? ( mail-mta/postfix )" + +MESSAGEBASE="/var/lib/citadel" + +pkg_setup() { + #Homedir needs to be the same as --with-datadir + einfo "Adding Citadel User/Group" + enewgroup citadel + enewuser citadel -1 -1 ${MESSAGEBASE} citadel,mail +} + +src_configure() { + econf \ + --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-ssldir=/etc/ssl/citadel \ + --with-staticdatadir=/etc/citadel \ + --with-sysconfdir=/etc/citadel \ + --with-utility-bindir=/usr/$(get_libdir)/citadel \ + --with-db \ + $(use_with pam) \ + $(use_enable pic pie) \ + $(use_with ldap with-ldap) \ + $(use_with ssl) +} + +src_install() { + if use pam ; then + dodir /etc/pam.d + fi + + emake DESTDIR="${D}" install-new + + # Protect files created at runtime by the server + echo CONFIG_PROTECT="${MESSAGEBASE}" > "${T}"/10citadel + doenvd "${T}"/10citadel + + # Keep emerge from removing empty directories when updating + keepdir "${MESSAGEBASE}"/data + keepdir /var/spool/citadel/network/{systems,spoolout,spoolin} + keepdir /var/run/citadel/network/{systems,spoolout,spoolin} + keepdir /etc/citadel/messages + + #Fix some permissions and sendmail stuff + 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 + dosym /usr/sbin/citmail /usr/$(get_libdir)/sendmail + fi + + if use ldap ; then + insinto /etc/openldap/schema + doins openldap/citadel.schema + doins openldap/rfc2739.schema + fi + + 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" + + 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() { + #we have to stop the server if it is accidently running + [ -f /var/run/citadel/citadel.socket ] && \ + die "Citadel seems to be running, please stop it while configuring!" + + #Citadel's setup uses a few enviromental variables to control it. + # Mandatory for non-interactive setup! + export CITADEL_INSTALLER="yes" + + # Citadel location. + export CITADEL="/var/run/citadel/" + + if use ldap ; then + export SLAPD_Binary="/usr/$(get_libdir)/openldap/slapd" + export LDAP_CONFIG="/etc/openldap/sldap.conf" + fi + + # Don't create any inittab/initscript/xinet stuff entry. + # We'll provide our own init script + export CREATE_INITTAB_ENTRY="no" + export CREATE_XINETD_ENTRY="no" + export NO_INIT_SCRIPTS="yes" + export ACT_AS_MTA="no" #just prohibits setup to mess with init scripts + + einfo "On which ip should the server listen?" + einfo "Press enter to default to 0.0.0.0 and listen on all interfaces." + read -rp " >" ipadress ; echo + if [ -z "$ipadress" ] ; then + export IP_ADDR="0.0.0.0" + else + export IP_ADDR="$ipadress" + fi + + # The main admin name for citadel can be chosen at random + einfo "Insert a name for your citadel admin account:" + read -rp " >" sysadminname ; echo + export SYSADMIN_NAME="$sysadminname" + + local pwd1="misch" + local pwd2="masch" + + until [[ "x$pwd1" = "x$pwd2" ]] ; do + einfo "Insert a password for the citadel admin user" + einfo "Avoid [\"'\\_%] characters in the password" + read -rsp " >" pwd1 ; echo + + einfo "Retype the password" + read -rsp " >" pwd2 ; echo + + if [[ "x$pwd1" != "x$pwd2" ]] ; then + ewarn "Passwords are not the same" + fi + done + export SYSADMIN_PW="$pwd2" + + #Now we will create the config using defaults and enviromental variables. + /usr/$(get_libdir)/citadel/setup -q + unset SYSADMIN_PW + + #Verify the /etc/services entry was made + if [ -f /etc/services ] && ! grep -q '^citadel' /etc/services ; then + echo "citadel 504/tcp # citadel" >> /etc/services + fi + + einfo "Be sure to read the documentation in /usr/share/doc/${PF}" + einfo + einfo "The server should now be up and running, enjoy!" + einfo "Citadel will listen on its default port 504" + if use postfix ; then + 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 +} diff --git a/mail-mta/citadel/files/README.gentoo b/mail-mta/citadel/files/README.gentoo new file mode 100644 index 000000000..47b7792da --- /dev/null +++ b/mail-mta/citadel/files/README.gentoo @@ -0,0 +1,21 @@ +The administration tools have been placed in /usr/lib(64)/citadel + +There are two possible options to get Citadel running, if this is +a new install: + +1. The no-nonse fullspeed approach with most stuff done for you: +# emerge --config mail-mta/citadel + +2. Manually configuring it with its setup routine: +You should make yourself familiar with Citadels setup: +http://www.citadel.org/doku.php/documentation:cmdman:setup +You probalby do not want to let setup chose the mode of starting + +The second approach is only recommended to experienced users!!! + +The service will automatically start after you configured it. +Initscript is /etc/init.d/citadel. Also look into /etc/conf.d + +The following clients are available: +a) the citadel console client was installed with this ebuild +b) www-servers/webcit provides a web-based gui diff --git a/mail-mta/citadel/files/citadel.init b/mail-mta/citadel/files/citadel.init index 023f6ec74..87a57e6eb 100644 --- a/mail-mta/citadel/files/citadel.init +++ b/mail-mta/citadel/files/citadel.init @@ -1,7 +1,7 @@ #!/sbin/runscript # original Author: Wilfried Goesgens -# adapted for Gentoo: the_mgt +# adapted for Gentoo: the_mgt depend() { use dns logger @@ -9,29 +9,31 @@ depend() { 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 $? } -- cgit v1.2.3-65-gdbad