File turnserver.spec of Package TurnServer

# spec file for package TurnServer
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# See also

Name:           turnserver
Version:        0.7.3
Release:        1.0
Summary:        Open-source TURN server implementation
License:        GPL-3.0
Group:          Productivity/Telephony/SIP/Servers
Source0:        turnserver-%{version}.tar.bz2
Source1:        turnserver.service
BuildRequires:  libopenssl-devel libconfuse-devel systemd
Conflicts:      rfc5766-turn-server
BuildRoot:     %{_tmppath}/%{name}-%{version}-build

TurnServer is a implementation of Traversal Using Relay around NAT (TURN) protocol. This protocol allows a client to obtain IP addresses and ports from such a relay.


%setup -q -n turnserver-%{version}

make %{?_smp_mflags}

make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/
mkdir -p %{buildroot}/etc/
install -m 0644 extra/turnserver.conf.template %{buildroot}/etc/turnserver.conf
install -m 0644 extra/turnusers.txt.template %{buildroot}/etc/turnusers.txt
install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/

getent group return >/dev/null || groupadd -r return
getent passwd return >/dev/null || \
    useradd -r -g return -d / -s /sbin/nologin \
    -c "reTurn TURN server" return
%service_add_pre turnserver.service

%service_add_post turnserver.service

%service_del_preun turnserver.service

%service_del_postun turnserver.service

%config /etc/turnserver.conf
%config /etc/turnusers.txt