diff options
author | Leonardo Arena <rnalrd@alpinelinux.org> | 2012-01-26 12:50:48 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2012-01-26 12:51:04 +0000 |
commit | d5b5f59dceb3766dc9601715530d66ab0545f2b2 (patch) | |
tree | 651fcdf1eb7ddd2ddf6fd2c6ae00f317f0490341 /testing/ejabberd | |
parent | d4addaa2278f2f7290728179d88f52aa4a3f9ab9 (diff) | |
download | aports-d5b5f59dceb3766dc9601715530d66ab0545f2b2.tar.bz2 aports-d5b5f59dceb3766dc9601715530d66ab0545f2b2.tar.xz |
testing/ejabberd: initd, confd, install/upgrade triggers, logrotate support added
Diffstat (limited to 'testing/ejabberd')
-rw-r--r-- | testing/ejabberd/APKBUILD | 14 | ||||
-rw-r--r-- | testing/ejabberd/ejabberd.confd | 5 | ||||
-rw-r--r-- | testing/ejabberd/ejabberd.initd | 47 | ||||
-rw-r--r-- | testing/ejabberd/ejabberd.logrotate | 12 | ||||
-rwxr-xr-x | testing/ejabberd/ejabberd.post-install | 8 | ||||
-rwxr-xr-x | testing/ejabberd/ejabberd.post-remove | 4 | ||||
-rwxr-xr-x | testing/ejabberd/ejabberd.post-upgrade | 6 |
7 files changed, 90 insertions, 6 deletions
diff --git a/testing/ejabberd/APKBUILD b/testing/ejabberd/APKBUILD index 52835bb862..7adb858054 100644 --- a/testing/ejabberd/APKBUILD +++ b/testing/ejabberd/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: pkgname=ejabberd pkgver=2.1.10 -pkgrel=1 +pkgrel=2 pkgdesc="An erlang jabber server" url="http://www.ejabberd.im" arch="x86" @@ -10,7 +10,7 @@ license="GPL" depends= depends_dev="erlang-dev expat-dev libiconv-dev openssl-dev zlib-dev" makedepends="$depends_dev" -install= +install="$pkgname.post-install $pkgname.post-upgrade" subpackages="$pkgname-dev $pkgname-doc" source="http://www.process-one.net/downloads/ejabberd/${pkgver/_/-}/ejabberd-${pkgver}.tar.gz" @@ -19,7 +19,7 @@ _builddir="$srcdir"/$pkgname-$pkgver prepare() { cd "$_builddir" - # apply patches here + return 0 } build() { @@ -36,9 +36,11 @@ package() { cd "$_builddir"/src make DESTDIR="$pkgdir" install - # remove the 2 lines below (and this) if there is no init.d script - # install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname - # install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname + install -d ${pkgdir}/var/spool/$pkgname + install -d ${pkgdir}/var/lib/$pkgname + install -D -m0644 ../../../$pkgname.logrotate ${pkgdir}/etc/logrotate.d/$pkgname + install -m755 -D ../../../$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -m644 -D ../../../$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname } md5sums="70f0e17983114c62893e43b6ef2e9d0c ejabberd-2.1.10.tar.gz" diff --git a/testing/ejabberd/ejabberd.confd b/testing/ejabberd/ejabberd.confd new file mode 100644 index 0000000000..b1e984e4d7 --- /dev/null +++ b/testing/ejabberd/ejabberd.confd @@ -0,0 +1,5 @@ +# Please configure everything at /etc/jabber/ejabberdctl.cfg +# Put here only command line arguments for ejabberdctl (if any are required) + +#EJABBERDCTL_OPTS="" + diff --git a/testing/ejabberd/ejabberd.initd b/testing/ejabberd/ejabberd.initd new file mode 100644 index 0000000000..2d6d44d3c3 --- /dev/null +++ b/testing/ejabberd/ejabberd.initd @@ -0,0 +1,47 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/files/ejabberd-3.initd,v 1.3 2010/06/02 07:12:27 pva Exp $ + +depend() { + use dns + need net + provide jabber-server +} + +start() { + if ejabberdctl status >/dev/null 2>&1; then + ewarn "ejabberd is already started (manually?)." + return 0 + fi + ebegin "Starting ejabberd" + /usr/sbin/ejabberdctl ${EJABBERDCTL_OPT} start + eend $? +} + +stop() { + ejabberdctl status >/dev/null 2>&1 + if test $? = 3; then + ewarn "ejabberd is already stopped (manually?)." + return 0 + fi + ebegin "Stopping ejabberd" + if /usr/sbin/ejabberdctl stop >/dev/null 2>&1; then + cnt=0 + sleep 1 + while ejabberdctl status >/dev/null 2>&1 || test $? = 1; do + echo -n . + cnt=`expr $cnt + 1` + if [ $cnt -ge 60 ] ; then + eend 1 + break + fi + sleep 1 + done + eend 0 + else + eend 1 + einfo "Please, run '/usr/sbin/ejabberdctl stop' to see what's going on." + fi + eend 0 +} diff --git a/testing/ejabberd/ejabberd.logrotate b/testing/ejabberd/ejabberd.logrotate new file mode 100644 index 0000000000..03069078aa --- /dev/null +++ b/testing/ejabberd/ejabberd.logrotate @@ -0,0 +1,12 @@ +/var/log/ejabberd/ejabberd.log { + weekly + missingok + rotate 10 + compress + delaycompress + ifempty + nomail + sharedscripts + postrotate ejabberdctl --node ejabberd reopen-log > /dev/null + endscript +} diff --git a/testing/ejabberd/ejabberd.post-install b/testing/ejabberd/ejabberd.post-install new file mode 100755 index 0000000000..817314e97d --- /dev/null +++ b/testing/ejabberd/ejabberd.post-install @@ -0,0 +1,8 @@ +#!/bin/sh + +groupadd jabber +useradd -G jabber -d /var/lib/ejabberd ejabberd +chown -R ejabberd.jabber /var/log/ejabberd +chown -R ejabberd.jabber /var/spool/ejabberd +chown -R ejabberd.jabber /var/lib/ejabberd +chown root:ejabberd /etc/ejabberd/ejabberd.cfg /etc/ejabberd/ejabberdctl.cfg /etc/ejabberd diff --git a/testing/ejabberd/ejabberd.post-remove b/testing/ejabberd/ejabberd.post-remove new file mode 100755 index 0000000000..8b0ddcbdd0 --- /dev/null +++ b/testing/ejabberd/ejabberd.post-remove @@ -0,0 +1,4 @@ +#!/bin/sh + +userdel ejabberd +groupdel jabber diff --git a/testing/ejabberd/ejabberd.post-upgrade b/testing/ejabberd/ejabberd.post-upgrade new file mode 100755 index 0000000000..a9c1a406b0 --- /dev/null +++ b/testing/ejabberd/ejabberd.post-upgrade @@ -0,0 +1,6 @@ +#!/bin/sh + +chown -R ejabberd.jabber /var/log/ejabberd +chown -R ejabberd.jabber /var/spool/ejabberd +chown -R ejabberd.jabber /var/lib/ejabberd +chown root:ejabberd /etc/ejabberd/ejabberd.cfg /etc/ejabberd/ejabberdctl.cfg /etc/ejabberd |