- switch to rebar3 for all distros

- build with rebar3 on TW

OBS-URL: https://build.opensuse.org/package/show/devel:languages:erlang/eturnal?expand=0&rev=10
This commit is contained in:
2021-01-25 13:23:31 +00:00
committed by Git OBS Bridge
parent 1b21ffabb4
commit 20a6854cb8
2 changed files with 8 additions and 28 deletions

View File

@@ -1,7 +1,12 @@
-------------------------------------------------------------------
Mon Jan 25 13:22:59 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>
- switch to rebar3 for all distros
-------------------------------------------------------------------
Sun Jan 24 21:17:11 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>
- build with rebar on TW
- build with rebar3 on TW
-------------------------------------------------------------------
Sun Jan 24 17:03:31 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>

View File

@@ -16,12 +16,6 @@
#
%if 0%{?suse_version} >= 1550
%bcond_without rebar3
%else
%bcond_with rebar3
%endif
%define systemuser _eturnal
%define appdir /usr/lib/eturnal
@@ -34,14 +28,10 @@ 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}
%if %{without influxdb}
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
@@ -55,11 +45,7 @@ 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
@@ -86,13 +72,9 @@ Access to TURN Services specification is implemented.
%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
@@ -103,7 +85,6 @@ perl -p -i -e 's|\{\{eturnal_user\}\}|%{systemuser}|g' scripts/eturnalctl conf
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/ \
@@ -113,12 +94,6 @@ cp -rv \
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}