Add bootstrap mode and add necessary conditionals for building rebar with a self-hosted rebar

Rebar is built with rebar, which makes getting the initial bootstrap
completed rather interesting. Additionally, erlang-rebar requires
erlang-getopt, but erlang-rebar can't be built without erlang-getopt
already available in the repo mock is using because of the patch which
removes the vendored version. This commit adds a variable which uses the
bundled getopt in order to bootstrap.
This commit is contained in:
Sam Kottler 2014-03-08 14:13:31 +06:00
parent 714c2005a9
commit b1366d5170
1 changed files with 25 additions and 0 deletions

View File

@ -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