Add coturn

This commit is contained in:
Travis Burtrum 2018-09-26 23:36:00 -04:00
parent bb564104bf
commit 402f7c7495
4 changed files with 93 additions and 0 deletions

61
src/coturn/PKGBUILD Normal file
View File

@ -0,0 +1,61 @@
# Original Maintainer: Vladimir Tsanev <tsachev@gmail.com>
# Maintainer: MoeRT09 <https://aur.archlinux.org/account/MoeRT09>
# Maintainer: jlkon13 <internet@devpi.de>
pkgname=coturn
_portname=turnserver
pkgver=4.5.0.7
pkgrel=1
pkgdesc="Free open source implementation of TURN and STUN Server"
arch=('i686' 'x86_64' 'armv7h')
url="https://github.com/coturn/coturn"
license=('custom:New BSD')
depends=('libevent' 'postgresql-libs' 'libmariadbclient' 'hiredis' 'sqlite')
conflicts=('rfc5766-turn-server')
provides=('rfc5766-turn-server')
install="$_portname.install"
backup=("etc/turnserver.conf")
source=(http://$_portname.open-sys.org/downloads/v$pkgver/$_portname-$pkgver.tar.gz $_portname.service $_portname.tmpfiles.d)
sha256sums=('86248c541a1184eb388c54d4178cffbf16ef53504fbb60106e575194f078b221'
'319030c1916d353bfc3375626cc7f60d6eeca762fe4fce354f010212902c49dc'
'fe7ed64dc6844aabdfa00b76134b22d69d9097bd3f77120d704d0ee08c036c21')
build() {
cd "$srcdir/$_portname-$pkgver"
./configure --prefix=/usr --manprefix=/usr/share --examplesdir="/usr/share/$_portname/examples" --disable-rpath
make
}
check() {
cd "$srcdir/$_portname-$pkgver"
make check
}
package() {
cd "$srcdir/$_portname-$pkgver"
make DESTDIR="$pkgdir" install
install -D "$pkgdir/usr/share/$_portname/examples/etc/turnserver.conf" "$pkgdir/etc/turnserver.conf"
rm -r "$pkgdir/usr/etc"
chmod 644 "$pkgdir/usr/lib/libturnclient.a"
install -Dm 644 "../$_portname.service" "$pkgdir/usr/lib/systemd/system/$_portname.service"
install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
sed \
-e '/^#log-file=\/var\/tmp\/turn.log$/c log-file=\/var\/log\/turnserver\/turn.log' \
-i "$pkgdir/etc/turnserver.conf"
sed \
-e '/^#pidfile="\/var\/run\/turnserver.pid"$/c pidfile="\/var\/run\/turnserver\/turnserver.pid"' \
-i "$pkgdir/etc/turnserver.conf"
install -Dm644 "$srcdir/$_portname.tmpfiles.d" "$pkgdir/usr/lib/tmpfiles.d/$_portname.conf"
}

View File

@ -0,0 +1,20 @@
post_install() {
id turnserver &>/dev/null || \
useradd -r -g daemon -M -s /usr/bin/false turnserver
install -dm 755 "/var/log/turnserver"
chown -R turnserver:daemon /var/log/turnserver
systemd-tmpfiles --create turnserver.conf
echo "start server by issuing \"systemctl start turnserver.service\" or calling \"turnserver\""
}
post_upgrade() {
post_install
}
pre_remove() {
userdel turnserver
}

View File

@ -0,0 +1,11 @@
[Unit]
Description=STUN and TURN Relay Server for VoIP and WebRTC
After=network.target
[Service]
Type=forking
User=turnserver
ExecStart=/usr/bin/turnserver -c /etc/turnserver.conf -o -v
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
d /run/turnserver 0755 turnserver daemon -