View previous topic :: View next topic |
Author |
Message |
Seclorum n00b
Joined: 05 Feb 2007 Posts: 8 Location: Russia
|
|
Back to top |
|
|
Seclorum n00b
Joined: 05 Feb 2007 Posts: 8 Location: Russia
|
Posted: Tue Jul 31, 2007 8:57 pm Post subject: |
|
|
cat /usr/local/portage/my/mail-mta/communigate/communigate-5.2.0.ebuild
Code: |
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# mantainer: Ilya Kashirin (seclorum@seclorum.ru)
inherit eutils rpm versionator
MY_PV=$(replace_version_separator 2 '-')
MY_PV1=${PV%.*}
DESCRIPTION="CommuniGate Pro,the leading high-end Internet Messaging platform"
HOMEPAGE="http://www.stalker.com/CommuniGatePro/"
SRC_URI="ftp://ftp.communigate.com/pub/CommuniGatePro/${MY_PV1}/CGatePro-Linux-${MY_PV}.i386.rpm \
http://www.communigate.com/pub/CommuniGatePro/${MY_PV1}/CGatePro-Linux-${MY_PV}.i386.rpm"
LICENSE="STALKER"
SLOT="0"
KEYWORDS="~x86"
IUSE="doc mailwrapper"
RDEPEND=">=sys-libs/glibc-2.4
!mailwrapper? ( !virtual/mta )
mailwrapper? ( >=net-mail/mailwrapper-0.2 )"
PROVIDE="virtual/mta virtual/mda virtual/imapd"
APPLICATION="/opt/CommuniGate"
MYBASE="/var/CommuniGate"
S=${WORKDIR}
src_unpack () {
rpm_src_unpack ${A}
cd ${S}
cp ${FILESDIR}/communigate.init ${S}
sed -i -e "s:APPLICATION=\"/opt/CommuniGate\":APPLICATION=\"${APPLICATION}\":" communigate.init
sed -i -e "s:MYBASE=\"/var/CommuniGate\":MYBASE=\"${MYBASE}\":" communigate.init
}
src_install() {
DIROPTIONS="--mode=0750 --owner=root --group=mail"
dodir ${MYBASE}/
dodir ${APPLICATION}/
dodir /usr/doc/CommuniGate/
cp -R ${S}/opt/CommuniGate/* "${D}/${APPLICATION}/" || die "Install failed!"
if use doc ; then
cp -R "${S}/usr/doc/CommuniGate/" "${D}/usr/doc/" || die "Install failed!"
fi
if ! use mailwrapper ; then
dosym ${APPLICATION}/mail /usr/bin/mail
dosym ${APPLICATION}/sendmail /usr/sbin/sendmail
fi
newinitd ${S}/communigate.init communigate
newconfd ${FILESDIR}/communigate.conf communigate
}
pkg_postinst() {
einfo "The CommuniGate Pro server has been installed."
einfo ""
einfo "Use \`rc-update add communigate default\` if you"
einfo "want communigate start when boot"
einfo ""
einfo "If you are installing the Server for the first time,"
einfo "connect to the Server using any Web Browser: <http://yourhost:8010>"
einfo "and initialize the postmaster password"
einfo ""
einfo "The postmaster password will be stored in"
einfo "/var/CommuniGate/Accounts/postmaster.macnt/account.settings"
einfo "file."
einfo ""
einfo "Check the General Settings and verify that the Server Main Domain"
einfo "is correct - it should be the FULL domain of your system, i.e."
einfo "it should be \"department.company.com\", but not just \"department\"."
einfo ""
einfo "Then proceed with registering users."
einfo ""
einfo "See <http://www.stalker.com/CommuniGatePro/> for the complete documentation."
}
|
cat /usr/local/portage/my/mail-mta/communigate/files/communigate.init
Code: | #!/sbin/runscript
# Copyright 1999-2007 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header:
APPLICATION="/opt/CommuniGate"
MYBASE="/var/CommuniGate"
opts="start stop controller"
depend() {
need net
use logger dns
provide mta
}
start() {
ebegin "Starting Communigate Pro"
umask 0
ulimit -u ${ULIMIT_U}
ulimit -n ${ULIMIT_N}
start-stop-daemon --start --quiet --chuid root:mail --exec ${APPLICATION}/CGServer -- --Base ${MYBASE} --Daemon ${SUPPLPARAMS}
touch /var/lock/subsys/CommuniGate
result=$?
eend $result
}
controller() {
ebegin "Starting CommuniGate Pro Cluster Controller"
umask 0
ulimit -u ${CL_ULIMIT_U}
ulimit -n ${CL_ULIMIT_N}
start-stop-daemon --start --chuid root:mail --quiet --exec ${APPLICATION}/CGServer -- --Base ${MYBASE} --Daemon ${CL_SUPPLPARAMS} --ClusterController
touch /var/lock/subsys/CommuniGate
result=$?
eend $result
}
stop() {
ebegin "Shutting down the CommuniGate Pro Server"
start-stop-daemon --stop --quiet --pidfile /var/CommuniGate/ProcessID
sleep 5
rm -f /var/lock/subsys/CommuniGate
result=$?
eend $result
}
|
cat /usr/local/portage/my/mail-mta/communigate/files/communigate.conf
Code: | # /etc/conf.d/communigate: config file for /etc/init.d/communigate
# Ulimits
ULIMIT_U=2000
ULIMIT_N=16384
#SUPPLPARAMS="--DefaultStackSize 131072 --useNonBlockingSockets --closeStuckSockets --CreateTempFilesDirectly 10"
# Controller settings
#
# For Frontends:
#CL_SUPPLPARAMS=”—-ClusterFrontend --DefaultStackSize 131072 --useNonBlockingSockets --closeStuckSockets --CreateTempFilesDirectly 10”
# For Backends:
#CL_SUPPLPARAMS=”--ClusterBackend --DefaultStackSize 131072 --useNonBlockingSockets --closeStuckSockets --CreateTempFilesDirectly 10”
# Cluster Controller ulimits
CL_ULIMIT_N=16384
CL_ULIMIT_U=2000 |
Last edited by Seclorum on Thu Feb 21, 2008 6:39 am; edited 4 times in total |
|
Back to top |
|
|
elgato319 Guru
Joined: 15 Sep 2005 Posts: 546
|
Posted: Tue Jul 31, 2007 9:19 pm Post subject: |
|
|
thanks for sharing |
|
Back to top |
|
|
|