summaryrefslogtreecommitdiff
path: root/community/prosody/PKGBUILD
blob: 78a7aae01d8ea9177159e7c7c02bef8db5b5ca27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# $Id: PKGBUILD 96186 2013-08-21 12:28:21Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Dwayne Bent <dbb.0@liqd.org>
# Contributor: Paul-Sebastian Manole <brokenthorn@gmail.com>

pkgname=prosody
pkgver=0.9.0
pkgrel=1
pkgdesc="Lightweight and extensible Jabber/XMPP server written in Lua."
arch=('i686' 'x86_64' 'mips64el')
url="http://prosody.im/"
license=('MIT')
depends=('lua51' 'lua51-socket' 'lua51-expat' 'lua51-filesystem' 'libidn' 'openssl')
optdepends=('lua51-sec: TLS encryption support')
install=prosody.install
backup=('etc/logrotate.d/prosody'
	'etc/prosody/prosody.cfg.lua')
source=("http://prosody.im/depot/${pkgver}/prosody-${pkgver}.tar.gz"
	'prosody.logrotated'
	'fix-config.patch'
	'prosody.tmpfile.d'
	'prosody.service')
md5sums=('cf0dd4f3389ab666d2d2b3a43464afc4'
         '5b44aee99f1fa9e7f055e067688cafbd'
         'a21d6a6efef8a08ae21109c2aa9c2fc7'
         'e2f5a1df410b05696a30dcb058841084'
         'e74045f27cb60908d535969906781f75')

build() {
    cd "$srcdir/prosody-$pkgver"
    patch -p1 <$srcdir/fix-config.patch
    find . -type f -exec \
      sed -i '1s,^#! \?/usr/bin/\(env \|\)lua$,#!/usr/bin/lua5.1,' {} \;
    ./configure --prefix=/usr --sysconfdir=/etc/prosody \
        --datadir=/var/lib/prosody --with-lua-include=/usr/include/lua5.1
    make
}

package() {
    cd "$srcdir/prosody-$pkgver"

    make DESTDIR="$pkgdir" install
    make DESTDIR="$pkgdir" install -C tools/migration

    rm $pkgdir/etc/prosody/certs/*

    install -d "$pkgdir/etc/logrotate.d"
    install -d "$pkgdir/var/log/prosody"
    for i in tools/*.lua; do
      install -Dm0644 $i $pkgdir/usr/share/prosody/$i
    done

    install -o root -g root -m 644 "$srcdir/prosody.logrotated" \
        "$pkgdir/etc/logrotate.d/prosody"

    install -Dm0644 COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING
    install -Dm0644 $srcdir/prosody.tmpfile.d $pkgdir/usr/lib/tmpfiles.d/prosody.conf
    install -Dm0644 $srcdir/prosody.service $pkgdir/usr/lib/systemd/system/prosody.service
}