From bd0e5a61be7dab2cf357d4cf474c909e65d563b8 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Mar 07 2019 12:55:54 +0000 Subject: Let Elixir to be built and tested w/o rebar or rebar3 Signed-off-by: Peter Lemenkov --- diff --git a/elixir.spec b/elixir.spec index 7cb1d3e..cbbbe37 100644 --- a/elixir.spec +++ b/elixir.spec @@ -1,8 +1,11 @@ %global debug_package %{nil} +%global __with_rebar 1 +# We don't use rebar3 for now +%global __with_rebar3 0 Name: elixir Version: 1.8.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A modern approach to programming for the Erlang VM License: ASL 2.0 @@ -11,12 +14,30 @@ URL: http://elixir-lang.org/ Source0: https://github.com/elixir-lang/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: https://github.com/elixir-lang/%{name}/releases/download/v%{version}/Docs.zip#/%{name}-%{version}-doc.zip #BuildArch: noarch -BuildRequires: erlang-rebar -BuildRequires: git -BuildRequires: sed +BuildRequires: erlang-compiler +BuildRequires: erlang-crypto +BuildRequires: erlang-dialyzer +BuildRequires: erlang-erts +BuildRequires: erlang-eunit +BuildRequires: erlang-inets +BuildRequires: erlang-kernel +BuildRequires: erlang-parsetools +BuildRequires: erlang-public_key +%if %{__with_rebar} +BuildRequires: erlang-rebar +%endif %{__with_rebar} +%if %{__with_rebar3} +BuildRequires: erlang-rebar3 +%endif %{__with_rebar3} +BuildRequires: erlang-stdlib +BuildRequires: erlang-tools +BuildRequires: erlang-xmerl +BuildRequires: git +BuildRequires: sed Requires: erlang-compiler Requires: erlang-crypto Requires: erlang-erts +#Requires: erlang-eunit Requires: erlang-inets Requires: erlang-kernel Requires: erlang-parsetools @@ -50,18 +71,48 @@ find . -name .gitignore -delete find . -name .gitkeep -delete # Let the Makefile speak! -sed -i 's/$(Q)//g' Makefile +sed -i '/^Q\s*:=/d' Makefile + +rm -f ./lib/mix/test/fixtures/rebar ./lib/mix/test/fixtures/rebar3 +%if %{__with_rebar} +# Do nothing +%else +# Disable rebar-related tests (tests require both rebar and rebar3) +rm -f ./lib/mix/test/mix/rebar_test.exs +touch ./lib/mix/test/fixtures/rebar +%endif %{__with_rebar} + +%if %{__with_rebar3} +# Do nothing +%else +# Disable rebar-related tests (tests require both rebar and rebar3) +rm -f ./lib/mix/test/mix/rebar_test.exs +touch ./lib/mix/test/fixtures/rebar3 +%endif %{__with_rebar3} %build export LANG=C.UTF-8 +%if %{__with_rebar} export REBAR=/usr/bin/rebar -export ERL_LIBS=/usr/share/erlang/lib/ export REBAR_DEPS_PREFER_LIBS=TRUE +%endif %{__with_rebar} +%if %{__with_rebar3} +export REBAR3=/usr/bin/rebar3 +%endif %{__with_rebar3} +export ERL_LIBS=/usr/share/erlang/lib/ make compile make build_man %check export LANG=C.UTF-8 +%if %{__with_rebar} +export REBAR=/usr/bin/rebar +export REBAR_DEPS_PREFER_LIBS=TRUE +%endif %{__with_rebar} +%if %{__with_rebar3} +export REBAR3=/usr/bin/rebar3 +%endif %{__with_rebar3} +export ERL_LIBS=/usr/share/erlang/lib/ make test %install @@ -99,6 +150,9 @@ HTML documentation for eex, elixir, iex, logger and mix. %doc docs/doc/eex docs/doc/elixir docs/doc/iex docs/doc/logger docs/doc/mix %changelog +* Thu Mar 07 2019 Peter Lemenkov - 1.8.1-2 +- Let it to be built and tested w/o rebar/rebar3 + * Wed Feb 06 2019 Timothée Floure - 1.8.1-1 - Update to upstream 1.8.1