OBS-URL: https://build.opensuse.org/package/show/devel:languages:erlang/eturnal?expand=0&rev=9
148 lines
4.4 KiB
RPMSpec
148 lines
4.4 KiB
RPMSpec
#
|
|
# spec file for package eturnal
|
|
#
|
|
# Copyright (c) 2013 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 http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%if 0%{?suse_version} >= 1550
|
|
%bcond_without rebar3
|
|
%else
|
|
%bcond_with rebar3
|
|
%endif
|
|
|
|
%define systemuser _eturnal
|
|
%define appdir /usr/lib/eturnal
|
|
|
|
Name: eturnal
|
|
Version: 1.4.4
|
|
Release: 1
|
|
Summary: A modern, straightforward STUN and TURN server
|
|
Group: Productivity/Networking/Talk/Servers
|
|
License: GPL-2.0
|
|
URL: https://eturnal.net/
|
|
Source0: https://eturnal.net/download/eturnal-%{version}.tar.gz
|
|
Source99: eturnal.sysusers
|
|
%if %{without influxdb} && %{without rebar3}
|
|
Patch0: noinflux.patch
|
|
%endif
|
|
%if %{with rebar3}
|
|
Patch1: use_distro_path.patch
|
|
%else
|
|
Patch1: use-minimal-service.patch
|
|
%endif
|
|
Patch2: HEAD.patch
|
|
BuildArch: noarch
|
|
BuildRequires: sysuser-shadow
|
|
BuildRequires: sysuser-tools
|
|
BuildRequires: pkgconfig(systemd)
|
|
%{?systemd_ordering}
|
|
%sysusers_requires
|
|
# for logger
|
|
Requires: util-linux-systemd
|
|
Requires(preun): util-linux-systemd
|
|
Requires(postun): util-linux-systemd
|
|
|
|
BuildRequires: erlang >= 21
|
|
%if %{with rebar3}
|
|
BuildRequires: erlang-rebar3
|
|
%else
|
|
BuildRequires: erlang-rebar-devel
|
|
%endif
|
|
%requires_eq erlang
|
|
# from rebar.config
|
|
BuildRequires: erlang-stun-devel >= 1.0.41
|
|
%requires_eq erlang-stun
|
|
#
|
|
BuildRequires: erlang-conf-devel >= 0.0.1
|
|
%requires_eq erlang-conf
|
|
#
|
|
BuildRequires: erlang-recon-devel >= 2.5.1
|
|
%requires_eq erlang-recon
|
|
#
|
|
%if %{with influxdb}
|
|
BuildRequires: erlang-influx_udp-devel >= 1.1.0
|
|
%requires_eq erlang-influx_udp
|
|
%endif
|
|
#/ from rebar.config
|
|
|
|
%description
|
|
eturnal is a modern, straightforward STUN and TURN server with full IPv6
|
|
support. For TURN authentication, the mechanism described in the REST API for
|
|
Access to TURN Services specification is implemented.
|
|
|
|
%prep
|
|
%autosetup -p 1
|
|
|
|
%build
|
|
%if %{with rebar3}
|
|
rm rebar.lock
|
|
SKIP_DEPS=true ./rebar3 as distro release
|
|
%else
|
|
export REBAR_DEPS_PREFER_LIBS=1
|
|
%rebar compile
|
|
%endif
|
|
%sysusers_generate_pre %{SOURCE99} eturnal
|
|
|
|
perl -p -i -e 's|\{\{eturnal_bin_prefix\}\}|%{appdir}|g' scripts/eturnalctl config/eturnal.service
|
|
perl -p -i -e 's|\{\{release_version\}\}|%{version}|g' scripts/eturnalctl config/eturnal.service
|
|
perl -p -i -e 's|\{\{eturnal_user\}\}|%{systemuser}|g' scripts/eturnalctl config/eturnal.service
|
|
|
|
%install
|
|
export REBAR_DEPS_PREFER_LIBS=1
|
|
install -D -m 0644 %{SOURCE99} %{buildroot}%{_sysusersdir}/eturnal.conf
|
|
install -D -m 0755 -d %{buildroot}%{appdir}/ %{buildroot}%{_sbindir}
|
|
%if %{with rebar3}
|
|
cp -rv \
|
|
_build/distro/rel/eturnal/bin/ \
|
|
_build/distro/rel/eturnal/releases/ \
|
|
_build/distro/rel/eturnal/lib/ \
|
|
_build/distro/lib/eturnal/ebin/ \
|
|
%{buildroot}%{appdir}/
|
|
|
|
install -D -m 0644 _build/distro/rel/eturnal/etc/systemd/system/eturnal.service %{buildroot}%{_unitdir}/eturnal.service
|
|
install -D -m 0640 _build/distro/rel/eturnal/etc/eturnal.yml %{buildroot}%{_sysconfdir}/eturnal.yml
|
|
%else
|
|
install -D -m 0755 -d %{buildroot}%{appdir}/ebin/
|
|
install -D -m 0644 ebin/* %{buildroot}%{appdir}/ebin/
|
|
install -D -m 0644 config/eturnal.service %{buildroot}%{_unitdir}/eturnal.service
|
|
install -D -m 0640 config/eturnal.yml %{buildroot}%{_sysconfdir}/eturnal.yml
|
|
%endif
|
|
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
|
|
|
|
|
|
%pre -f %{name}.pre
|
|
%service_add_pre %{name}.service
|
|
|
|
%post
|
|
%service_add_post %{name}.service
|
|
|
|
%preun
|
|
%service_del_preun %{name}.service
|
|
|
|
%postun
|
|
%service_del_postun %{name}.service
|
|
|
|
|
|
%files
|
|
%doc *.md
|
|
%license LICENSE
|
|
%config(noreplace) %attr(-,root,%{systemuser}) %{_sysconfdir}/eturnal.yml
|
|
%{_sysusersdir}/eturnal.conf
|
|
%{_unitdir}/eturnal.service
|
|
%{appdir}/
|
|
%{_sbindir}/rc%{name}
|
|
|
|
%changelog
|