diff options
author | root <root@rshg054.dnsready.net> | 2013-08-13 01:33:19 -0700 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2013-08-13 01:33:19 -0700 |
commit | 7a65a910b77ad191d69881098c47f9b0c852d92e (patch) | |
tree | 9564e611af1442f8952a8cbddb3b0ad25ed71aab /community/ejabberd | |
parent | 60da6abff6c9577a783d72865f11de7a585e912e (diff) |
Tue Aug 13 01:31:08 PDT 2013
Diffstat (limited to 'community/ejabberd')
-rw-r--r-- | community/ejabberd/PKGBUILD | 45 | ||||
-rw-r--r-- | community/ejabberd/ejabberd.install | 25 | ||||
-rw-r--r-- | community/ejabberd/ejabberd.logrotate | 12 | ||||
-rw-r--r-- | community/ejabberd/ejabberd.service | 13 |
4 files changed, 95 insertions, 0 deletions
diff --git a/community/ejabberd/PKGBUILD b/community/ejabberd/PKGBUILD new file mode 100644 index 000000000..189209940 --- /dev/null +++ b/community/ejabberd/PKGBUILD @@ -0,0 +1,45 @@ +# $Id: PKGBUILD 93139 2013-06-25 15:54:26Z spupykin $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: Jeff 'codemac' Mickey <jeff@archlinux.org> +# Contributor: Alexander Rødseth <rodseth@gmail.com> + +pkgname=ejabberd +pkgver=2.1.13 +pkgrel=1 +pkgdesc="Jabber server written in Erlang" +arch=('x86_64' 'i686') +url="http://www.ejabberd.im/" +license=("GPL") +depends=('expat' 'openssl' 'zlib' 'erlang-nox' 'pam' 'iproute2') +backup=('etc/ejabberd/ejabberd.cfg' + 'etc/ejabberd/ejabberdctl.cfg' + 'etc/logrotate.d/ejabberd') +install=$pkgname.install +source=("$pkgname-$pkgver.tar.gz::https://github.com/processone/ejabberd/archive/v$pkgver.tar.gz" + "$pkgname.logrotate" + "ejabberd.service") +md5sums=('2a7c3b711b4f7091f811c51b52beb735' + 'f97c8a96160f30e0aecc9526c12e6606' + 'df32aa17e40a7bc5d9946d3ba6fe5e16') + +build() { + cd "$srcdir/$pkgname-$pkgver/src" + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ + --enable-pam --enable-odbc + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver/src" + make DESTDIR="$pkgdir" install + install -d "$pkgdir/var/lib/$pkgname" + install -D -m0644 "$srcdir/$pkgname.logrotate" "$pkgdir/etc/logrotate.d/$pkgname" + chmod ug+r "$pkgdir/etc/$pkgname/"* + mkdir -p $pkgdir/usr/bin + mv $pkgdir/usr/sbin/ejabberdctl $pkgdir/usr/bin/ejabberdctl + chmod a+rx "$pkgdir/usr/bin/ejabberdctl" "$pkgdir/usr/lib/ejabberd/priv/bin/captcha.sh" + rm -rf "$pkgdir/var/lock" "$pkgdir/usr/sbin" + install -Dm0644 $srcdir/ejabberd.service $pkgdir/usr/lib/systemd/system/ejabberd.service +} + +# vim:set ts=2 sw=2 et: diff --git a/community/ejabberd/ejabberd.install b/community/ejabberd/ejabberd.install new file mode 100644 index 000000000..6e586229d --- /dev/null +++ b/community/ejabberd/ejabberd.install @@ -0,0 +1,25 @@ +post_install() { + groupadd -r jabber + useradd -r -G jabber -d /var/lib/ejabberd ejabberd + chown -R ejabberd.jabber /var/log/ejabberd + chown -R ejabberd.jabber /var/lib/ejabberd + chown root:ejabberd /usr/lib/ejabberd/priv/bin/epam + chown root:ejabberd /etc/ejabberd/ejabberd.cfg /etc/ejabberd/ejabberdctl.cfg /etc/ejabberd + chmod 4750 /usr/lib/ejabberd/priv/bin/epam +} + +post_upgrade() { + chown -R ejabberd.jabber /var/log/ejabberd + chown -R ejabberd.jabber /var/lib/ejabberd + chown root:ejabberd /etc/ejabberd/ejabberd.cfg /etc/ejabberd/ejabberdctl.cfg /etc/ejabberd + chown root:ejabberd /usr/lib/ejabberd/priv/bin/epam + chmod 4750 /usr/lib/ejabberd/priv/bin/epam + echo ">> ejabberd looks into /var/lib/ejabberd for mnesia db now" +} + +post_remove() { + userdel ejabberd + groupdel jabber +} + +# vim:set ts=2 sw=2 et: diff --git a/community/ejabberd/ejabberd.logrotate b/community/ejabberd/ejabberd.logrotate new file mode 100644 index 000000000..03069078a --- /dev/null +++ b/community/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/community/ejabberd/ejabberd.service b/community/ejabberd/ejabberd.service new file mode 100644 index 000000000..036cc7c53 --- /dev/null +++ b/community/ejabberd/ejabberd.service @@ -0,0 +1,13 @@ +[Unit] +Description=A distributed, fault-tolerant Jabber/XMPP server +After=network.target + +[Service] +Type=forking +User=ejabberd +LimitNOFILE=16000 +RestartSec=5 +ExecStart=/usr/bin/erl -pa /usr/lib/ejabberd/ebin -sname ejabberd -s ejabberd -ejabberd config \"/etc/ejabberd/ejabberd.cfg\" log_path \"/var/log/ejabberd/ejabberd.log\" -sasl sasl_error_logger \{file,\"/var/log/ejabberd/sasl.log\"\} -mnesia dir \"/var/lib/ejabberd\" -detached -kernel inetrc \"/etc/ejabberd/inetrc\" + +[Install] +WantedBy=multi-user.target |