diff --git a/erlang-rebar.spec b/erlang-rebar.spec index e75bbcf..a9f00ae 100644 --- a/erlang-rebar.spec +++ b/erlang-rebar.spec @@ -4,6 +4,13 @@ %global git_tag ebb474b %global patchnumber 0 +# Set this to true when starting a rebuild of the whole erlang stack. There's +# a cyclical dependency between erlang-rebar and erlang-getopt so this package +# (rebar) needs to get built first in bootstrap mode. +%global need_bootstrap_set 0 + +%{!?need_bootstrap: %global need_bootstrap %{need_bootstrap_set}} + Name: erlang-%{realname} Version: 2.1.0 @@ -19,8 +26,13 @@ Source1: rebar.escript Patch1: rebar-0001-Don-t-load-templates-from-the-bundle.patch # Fedora/EPEL-specific Patch2: rebar-0002-Remove-bundled-mustache.patch + +# The bundled getopt is necessary to do the initial bootstrap since +# erlang-getopt requires erlang-rebar to build and vice versa. +%if 0%{?need_bootstrap} < 1 # Fedora/EPEL-specific Patch3: rebar-0003-Remove-bundled-getopt.patch +%endif # Backported from upstream Patch4: rebar-0004-Be-sure-to-filter-empty-sources-h-t-to-Tuncer-and-Jo.patch # Will be proposed for inclusion @@ -35,7 +47,13 @@ Patch8: rebar-0008-Remove-abnfc-compiler-support-n-a-in-Fedora-EPEL.patch Patch9: rebar-0009-Adjust-app-version.patch # Backported from upstream Patch10: rebar-0010-Fix-default-DTL-compilation-when-no-erlydtl_opts-are.patch + +%if 0%{?need_bootstrap} < 1 BuildRequires: erlang-rebar +%else +BuildRequires: erlang +%endif + # FIXME wip #Requires: erlang-abnfc%{?_isa} Requires: erlang-asn1%{?_isa} @@ -77,7 +95,9 @@ Erlang Build Tools. %setup -q -n %{upstream}-%{realname}-%{git_tag} %patch1 -p1 -b .dont_load_templates %patch2 -p1 -b .remove_bundled_mustache +%if 0%{?need_bootstrap} < 1 %patch3 -p1 -b .remove_bundled_getopt +%endif %patch4 -p1 -b .dont_try_building_so %patch5 -p1 -b .allow_discarding_ports %patch6 -p1 -b .use_locally_installed @@ -88,7 +108,12 @@ Erlang Build Tools. %build +%if 0%{?need_bootstrap} < 1 rebar compile -v +%else +./bootstrap +./rebar compile -v +%endif %install