initial import
This commit is contained in:
93
prosody/PKGBUILD
Normal file
93
prosody/PKGBUILD
Normal file
@@ -0,0 +1,93 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
# Old Maintainer (Arch): Dwayne Bent <dbb@dbb.io>
|
||||
# Old Maintainer (Arch): Tilman Vatteroth <tilman.vatteroth@uni-dortmund.de>
|
||||
|
||||
pkgname=prosody
|
||||
epoch=1
|
||||
pkgver=0.11.9
|
||||
_debver=$pkgver
|
||||
_debrel=2
|
||||
pkgrel=2
|
||||
pkgdesc='Lightweight and extensible Jabber/XMPP server written in Lua'
|
||||
arch=('i686' 'x86_64')
|
||||
url='https://prosody.im/'
|
||||
license=('Expat')
|
||||
depends=('lua52' 'lua52-socket' 'lua52-expat' 'lua52-filesystem' 'lua52-sec'
|
||||
'libidn' 'libressl')
|
||||
makedepends=('quilt')
|
||||
conflicts=('prosody')
|
||||
provides=('prosody')
|
||||
optdepends=('lua52-dbi: SQL storage support')
|
||||
install=prosody.install
|
||||
backup=('etc/prosody/prosody.cfg.lua')
|
||||
source=("https://prosody.im/downloads/source/prosody-${pkgver}.tar.gz"{,.asc}
|
||||
"https://deb.debian.org/debian/pool/main/p/prosody/prosody_${_debver}-${_debrel}+deb11u2.debian.tar.xz"
|
||||
"prosody.initd"
|
||||
"prosody.run"
|
||||
"prosody.logrotated")
|
||||
sha512sums=('fabbbbb1acb3de4ff01e3e8c6e9e4dc37cb161259f1649683a1f9d925ed9f1709e052bfc831cba3f1861a9cca599f2b725ee739bfcb57164d6f50ac07011b52a'
|
||||
'SKIP'
|
||||
'3b398abcc82be9461064cbf0c2ab6f895dd0b7810ce1fa0f8b1a7f02f5211ddc95ee0c0d7c40abda5e1b0229486671b837a760da674a2eacec7e4138d558cc48'
|
||||
'06fd900a06536ba334580dd49539b0ca8f9fb4f5706bf39d4acfd3266d265d404554cddc5e0378be2b650ecf6277d4852ea7f25cccc66f158646ad7cd1f71e57'
|
||||
'6ba1aeeab49aa64401e45f969fac6eca3dbc36dd74e4c1bf03aed315399bf086c14c3d2f10f269a7e8cffbe48a789b4fdaddb65961698d20c89b3b5f3d91ecf3'
|
||||
'7867ac1303c09ed50c8b3f9a204fd7a970ba063e39a2bcdc95925a2192240b3000461d054f3d162b4cfd66de90c291af754df8945cdf257b058f998bca5c4c4f')
|
||||
validpgpkeys=('32A9EDDE3609931EB98CEAC315907E8E7BDD6BFE'
|
||||
'3E52119EF853C59678DBBF6BADED9A77B67AD329'
|
||||
'C01A477A8F69E6E57F5C54CDE7AB958013F1F1D5')
|
||||
|
||||
prepare() {
|
||||
cd ${pkgname}-${pkgver}
|
||||
|
||||
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES=debian/patches
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "$srcdir"/debian .
|
||||
|
||||
# Doesn't apply
|
||||
rm -v debian/patches/0001-conf.patch || true
|
||||
|
||||
quilt push -av
|
||||
fi
|
||||
|
||||
# disable logging to output and activate syslog
|
||||
sed -i s/"info = "/"-- info = "/g prosody.cfg.lua.dist
|
||||
sed -i s/"error = "/"-- error = "/g prosody.cfg.lua.dist
|
||||
sed -i s/"--\ \"\*syslog\"\;"/"info = \"*syslog\"\;"/g prosody.cfg.lua.dist
|
||||
|
||||
}
|
||||
|
||||
build() {
|
||||
cd prosody-$pkgver
|
||||
./configure \
|
||||
--ostype=linux \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/prosody \
|
||||
--datadir=/var/lib/prosody \
|
||||
--with-lua-include=/usr/include/lua5.2 \
|
||||
--cflags="${CPPFLAGS} ${CFLAGS} -fPIC -D_GNU_SOURCE" \
|
||||
--ldflags="${LDFLAGS} -shared" \
|
||||
--no-example-certs \
|
||||
--runwith=lua5.2
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd prosody-$pkgver
|
||||
make DESTDIR="${pkgdir}" install
|
||||
make DESTDIR="${pkgdir}" install -C tools/migration
|
||||
|
||||
# services
|
||||
install -Dm755 "${srcdir}"/${pkgname}.initd "${pkgdir}"/etc/init.d/${pkgname}
|
||||
install -Dm755 "${srcdir}/${pkgname}.run" "${pkgdir}/etc/sv/${pkgname}/run"
|
||||
|
||||
for i in tools/*.lua; do
|
||||
install -Dm 0644 ${i} "${pkgdir}"/usr/share/prosody/${i}
|
||||
done
|
||||
|
||||
install -Dm 0644 COPYING "${pkgdir}"/usr/share/licenses/prosody/COPYING
|
||||
install -Dm 0644 "$srcdir"/prosody.logrotated "${pkgdir}"/etc/logrotate.d/prosody
|
||||
rm "${pkgdir}"/etc/prosody/certs/*
|
||||
}
|
||||
47
prosody/prosody.initd
Normal file
47
prosody/prosody.initd
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Copyright 2019 Hyperbola Project
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
description="Prosody is a server for Jabber/XMPP written in Lua."
|
||||
description_reload="Reload configuration and reopen log files."
|
||||
extra_started_commands="reload"
|
||||
pidfile="/var/run/prosody/prosody.pid"
|
||||
|
||||
depend() {
|
||||
use dns
|
||||
need net
|
||||
provide jabber-server
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
if [ ! -e /etc/prosody/prosody.cfg.lua ] ; then
|
||||
eerror "You need a /etc/prosody/prosody.cfg.lua file to run prosody"
|
||||
return 1
|
||||
fi
|
||||
luac5.2 -p /etc/prosody/prosody.cfg.lua
|
||||
return $?
|
||||
}
|
||||
|
||||
start() {
|
||||
checkconfig || return 1
|
||||
checkpath -q -d -m 0770 -o prosody:prosody "$(dirname ${pidfile})"
|
||||
checkpath -q -f -m 0770 -o prosody:prosody "${pidfile}"
|
||||
checkpath -q -d -m 0750 -o prosody:prosody /var/log/prosody
|
||||
ebegin "Starting Prosody XMPP Server"
|
||||
prosodyctl start
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping Prosody XMPP Server"
|
||||
prosodyctl stop
|
||||
eend $?
|
||||
}
|
||||
|
||||
reload() {
|
||||
checkconfig || return 1
|
||||
ebegin "Reloading configuration of Prosody XMPP Server"
|
||||
prosodyctl reload
|
||||
eend $?
|
||||
}
|
||||
48
prosody/prosody.install
Normal file
48
prosody/prosody.install
Normal file
@@ -0,0 +1,48 @@
|
||||
post_install() {
|
||||
if ! getent group prosody &>/dev/null; then
|
||||
groupadd -g 412 prosody >/dev/null
|
||||
fi
|
||||
if ! getent passwd prosody &>/dev/null; then
|
||||
useradd -u 412 -d /var/lib/prosody -g prosody -s /bin/nologin prosody >/dev/null
|
||||
fi
|
||||
|
||||
chown prosody:prosody /var/lib/prosody
|
||||
|
||||
install -d -m750 /var/log/prosody
|
||||
chown prosody:prosody /var/log/prosody
|
||||
|
||||
prosody_shell=$(getent passwd prosody | cut -d: -f7)
|
||||
if [ "$prosody_shell" != '/bin/nologin' ]; then
|
||||
chsh -s /bin/nologin prosody &>/dev/null
|
||||
fi
|
||||
|
||||
echo ">> Documentation: http://wiki.archlinux.org/index.php/Prosody"
|
||||
echo ">> gpasswd -a <your-user> prosody"
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
post_install
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
if getent passwd prosody &>/dev/null; then
|
||||
userdel prosody >/dev/null
|
||||
fi
|
||||
if getent group prosody &>/dev/null; then
|
||||
groupdel prosody >/dev/null
|
||||
fi
|
||||
|
||||
paths=(/etc/prosody /var/lib/prosody /var/log/prosody
|
||||
/var/log/old/prosody)
|
||||
|
||||
first=true
|
||||
for path in ${paths[@]}; do
|
||||
if [ -d $path ]; then
|
||||
if $first; then
|
||||
first=false
|
||||
echo "==> Leftover Paths:"
|
||||
fi
|
||||
echo "==> $path"
|
||||
fi
|
||||
done
|
||||
}
|
||||
9
prosody/prosody.logrotated
Normal file
9
prosody/prosody.logrotated
Normal file
@@ -0,0 +1,9 @@
|
||||
/var/log/prosody/prosody.log /var/log/prosody/prosody.err {
|
||||
# olddir /var/log/old/prosody
|
||||
create 644 prosody prosody
|
||||
sharedscripts
|
||||
missingok
|
||||
postrotate
|
||||
/bin/kill -HUP `cat /run/prosody/prosody.pid 2> /dev/null` 2> /dev/null || true
|
||||
endscript
|
||||
}
|
||||
7
prosody/prosody.run
Normal file
7
prosody/prosody.run
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
mkdir -p /run/prosody
|
||||
chown prosody:prosody /run/prosody
|
||||
chown prosody:prosody /var/lib/prosody
|
||||
sed -i 's/daemonize = true/daemonize = false/' /etc/prosody/prosody.cfg.lua
|
||||
chpst -u prosody:prosody prosody
|
||||
exec pause
|
||||
Reference in New Issue
Block a user