File rebar3.spec of Package rebar3
%def_disable check
%define bname rebar3
Name: %bname
Version: 3.24.0
Release: 3
Summary: A sophisticated build-tool for Erlang projects that follows OTP principles
License: Apache-2.0
Group: Development/Tools/Other
URL: https://github.com/rebar/%bname
Source: %bname-%version.tar.xz
Source9: %name-rpmlintrc
#Patch0: %bname-%version-git.patch
Patch1: 0001-Bump-relx-vendored-copy.patch
Patch2: 0002-make-escriptize-reproducible-with-erlang-27.1.patch
Patch3: 0003-Add-Rebar3-and-Erlang-OTP-compatibility-list.patch
Patch4: 0004-Approach-the-sample-config.-file-to-rebar3.org-s-doc.patch
Patch5: 0005-Indent-it.patch
Patch7: 0007-Fallback-to-the-default-error-format-when-a-file-is-.patch
BuildArch: noarch
Requires: erlang
Provides: erlang-%bname = %version-%release
Requires: update-alternatives
Conflicts: erlang-rebar
BuildRequires: rpm-macros-erlang >= 0.9.1 rpm-build-erlang >= 0.10.0
BuildRequires: rebar >= 2.6.1-7
BuildRequires: erlang >= 1:21.0
BuildRequires: update-alternatives
BuildRequires: erlang-public_key-devel
BuildRequires: erlang-erlware_commons >= 1.7.0
BuildRequires: erlang-bbmustache >= 1.12.2
BuildRequires: erlang-certifi >= 2.13.0
BuildRequires: erlang-providers >= 1.9.0
BuildRequires: erlang-providers-devel >= 1.9.0
BuildRequires: erlang-relx >= 4.10.0
BuildRequires: erlang-cf >= 0.3.1-2
BuildRequires: erlang-eunit_formatters >= 0.5.0
BuildRequires: erlang-cth_readable >= 1.5.1
BuildRequires: erlang-getopt >= 1.0.2
BuildRequires: erlang-ssl_verify_fun >= 1.1.6
%if_enabled check
BuildRequires: erlang-meck >= 0.8.3
%endif
%description
Rebar3 is an Erlang build tool that makes it easy to compile and test Erlang
applications, port drivers and releases. %bname is a self-contained Erlang script,
so it's easy to distribute or even embed directly in a project. Where possible,
%bname uses standard Erlang/OTP conventions for project structures, thus
minimizing the amount of build configuration work. %bname also provides dependency
management, enabling application writers to easily re-use common libraries from a
variety of locations (git, hg, etc).
%package doc
Summary: Documentation of %bname
Group: Documentation/HTML
Provides: erlang-%bname-doc = %version-%release
Conflicts: %name < 3.20.0-1
Conflicts: %name-static < 3.20.0-1
%description doc
Rebar3 is an Erlang build tool that makes it easy to compile and test Erlang
applications, port drivers and releases.
This package contains documentation of %bname.
%package bash-completion
Summary: Bash completion for %bname
Requires: bash-completion
%description bash-completion
Rebar3 is an Erlang build tool that makes it easy to compile and test Erlang
applications, port drivers and releases.
This package contains bash completion for %bname.
%package static
Summary: A sophisticated build-tool for Erlang projects that follows OTP principles
Group: Development/Tools/Other
Provides: %name-bundle = %version-%release
Requires: erlang
Requires: erlang-otp-base erlang-syntax_tools
Requires: erlang_app(asn1) erlang_app(crypto) erlang_app(ssl) erlang_app(public_key)
%description static
%bname is an Erlang build tool that makes it easy to compile and test Erlang
applications, port drivers and releases. %bname is a self-contained Erlang script,
so it's easy to distribute or even embed directly in a project. Where possible,
%bname uses standard Erlang/OTP conventions for project structures, thus
minimizing the amount of build configuration work. %bname also provides dependency
management, enabling application writers to easily re-use common libraries from a
variety of locations (git, hg, etc).
%package relx
Summary: relx support for %bname
Group: Development/Tools/Other
Requires: %name = %version-%release
%description relx
Rebar3 is an Erlang build tool that makes it easy to compile and test Erlang
applications, port drivers and releases.
This package contains relx support for %bname.
%prep
%setup -q -n %bname-%version
#patch -p1 -P0
%patch -p1 -P1 -P2 -P3 -P4 -P5 -P7
%build
%define eoptflags [inline,verbose,{d,'OTP_19'}]
cd apps/rebar
erl -noinput -eval '
{ok, L} = file:consult("rebar.config"),
file:write_file("%bname.rebar.config",
lists:map(fun(E) -> [io_lib:print(E), ".\n"] end,
lists:foldl(fun({K, _} = V, A) -> lists:keystore(K, 1, A, V) end,
lists:foldl(fun(DK, DA) -> lists:keydelete(DK, 1, DA) end, L,
[edoc_opts, deps, overrides, profiles, post_hooks]),
[{edoc_opts, [{preprocess, true}|proplists:get_value(edoc_opts, L, [])]},
{erl_first_files,
["src/rebar_completion.erl", "src/rebar_compiler.erl",
"src/rebar_resource_v2.erl"]},
{escript_shebang, "#!%_bindir/escript\n"},
{escript_emu_args, proplists:get_value(escript_emu_args, L, "")},
{escript_incl_apps,
[bbmustache, certifi, cf, cth_readable, eunit_formatters, erlware_commons,
getopt, providers, relx, ssl_verify_fun]},
{escript_incl_extra,
[{"rebar/priv/templates/*", "escript"},
{"relx/priv/templates/*", "escript"}]},
{escript_comment, ""}])),
[raw]),
init:stop().'
ERL_COMPILER_OPTIONS="%eoptflags" rebar %{?_smp_mflags} -C %bname.rebar.config compile -v
install -d -m 0755 escript
ln -sf %_otplibdir/relx-* escript/relx
ln -sf .. escript/rebar
rebar %{?_smp_mflags} -C %bname.rebar.config escriptize -v
rebar %{?_smp_mflags} -C %bname.rebar.config doc -v
cat > %bname.escript <<__EOF__
#!/usr/bin/escript
%%%%
main(A) -> rebar3:main(A).
__EOF__
cd -
%install
cd apps/rebar
install -pD -m 0755 %bname %buildroot%_bindir/%bname-bundle
ln -sf %bname-bundle %buildroot%_bindir/%bname-static
for d in ebin priv/templates; do
install -d -m 0755 %buildroot%_otplibdir/rebar-%version/$d
install -p -m 0644 $d/* %buildroot%_otplibdir/rebar-%version/$d/
done
install -pD %bname.escript -m 0755 %buildroot%_bindir/%bname-otp
install -d -m 0755 %buildroot%_otplibdir/rebar-%version/doc
install -p -m 0644 doc/*.{css,html,png} %buildroot%_otplibdir/rebar-%version/doc/
install -d -m 0755 %buildroot%_docdir/%name
ln -sf %_otplibdir/rebar-%version/doc %buildroot%_docdir/%name/html
# completion
install -d -m 0755 %buildroot%_datadir/bash-completion/completions
install -p -m 0644 priv/shell-completion/bash/%bname %buildroot%_datadir/bash-completion/completions/
cd -
# docs
install -p -m 0644 CONTRIBUTING* README* THANKS* %buildroot%_docdir/%name/
install -d -m 0755 %buildroot%_mandir/man1
install -p -m 0644 manpages/*.1 %buildroot%_mandir/man1/
# alternatives
install -d -m 0755 %buildroot%_sysconfdir/alternatives
touch %buildroot%_sysconfdir/alternatives/%bname
ln -sf %_sysconfdir/alternatives/%bname %buildroot%_bindir/%bname
%add_erlang_req_app_skiplist relx
%post
%_sbindir/update-alternatives --quiet --install %_bindir/%bname %bname %_bindir/%bname-otp 10
%preun
[ "$1" != 0 ] || %_sbindir/update-alternatives --quiet --remove %bname %_bindir/%bname-otp
%post static
%_sbindir/update-alternatives --quiet --install %_bindir/%bname %bname %_bindir/%bname-bundle 5
%preun static
[ "$1" != 0 ] || %_sbindir/update-alternatives --quiet --remove %bname %_bindir/%bname-bundle
%if_enabled check
%check
./apps/rebar/rebar3 ct
%endif
%files
%defattr(-,root,root)
%doc %_docdir/%name
%_bindir/%bname-otp
%_otplibdir/*
%ghost %_bindir/%bname
%ghost %_sysconfdir/alternatives/*
%exclude %_otplibdir/rebar-*/doc
%exclude %_otplibdir/rebar-*/ebin/rebar_relx*
%exclude %_otplibdir/rebar-*/ebin/rebar_prv_rel*
%exclude %_otplibdir/rebar-*/ebin/rebar_prv_tar.*
%files doc
%defattr(-,root,root)
%doc %_docdir/%name
%doc %dir %_otplibdir/rebar-*
%doc %_otplibdir/rebar-*/doc
%_mandir/man1/*
%files bash-completion
%defattr(-,root,root)
%_datadir/bash-completion/completions/*
%files relx
%defattr(-,root,root)
%dir %_otplibdir/rebar-*
%dir %_otplibdir/rebar-*/ebin
%_otplibdir/rebar-*/ebin/rebar_relx.*
%_otplibdir/rebar-*/ebin/rebar_prv_rel*
%_otplibdir/rebar-*/ebin/rebar_prv_tar.*
%files static
%defattr(-,root,root)
%_bindir/%bname-bundle
%_bindir/%bname-static
%ghost %_bindir/%bname
%ghost %_sysconfdir/alternatives/*
%changelog
* Mon Dec 30 2024 Led <ledest@gmail.com> 3.24.0-3
- add patches:
+ 0001-Bump-relx-vendored-copy.patch
+ 0003-Add-Rebar3-and-Erlang-OTP-compatibility-list.patch
+ 0004-Approach-the-sample-config.-file-to-rebar3.org-s-doc.patch
+ 0005-Indent-it.patch
+ 0007-Fallback-to-the-default-error-format-when-a-file-is-.patch
* Tue Sep 24 2024 Led <ledest@gmail.com> 3.24.0-2
- add patches:
+ 0001-make-escriptize-reproducible-with-erlang-27.1.patch
* Sat Sep 14 2024 Led <ledest@gmail.com> 3.24.0-1
- 3.24.1
- remove patches:
+ rebar3-3.20.0-stacktrace.patch
* Sat Apr 20 2024 Led <ledest@gmail.com> 3.23.0-2
- add erl_first_files
* Sat Apr 20 2024 Led <ledest@gmail.com> 3.23.0-1
- 3.23.0
- update BuildRequires
- remove patches:
+ 0001-Fix-unicode-output-printed-as-charlist.patch
+ 0002-Prevent-xref-issue-when-analysis-runs-on-generated-c.patch
+ 0001-rebar_utils-add-metadata-to-primary-logger-config.patch
* Thu Nov 16 2023 Led <ledest@gmail.com> 3.22.1-4
- add patches:
+ 0001-rebar_utils-add-metadata-to-primary-logger-config.patch
* Wed Nov 01 2023 Led <ledest@gmail.com> 3.22.1-3
- add patches:
+ 0002-Prevent-xref-issue-when-analysis-runs-on-generated-c.patch
* Mon Sep 25 2023 Led <ledest@gmail.com> 3.22.1-2
- add patches:
+ 0001-Fix-unicode-output-printed-as-charlist.patch
* Mon Aug 07 2023 Led <ledest@gmail.com> 3.22.1-1
- 3.22.1
* Tue Jun 06 2023 Led <ledest@gmail.com> 3.22.0-3
- revert BuildRequires
* Sat Jun 03 2023 Led <ledest@gmail.com> 3.22.0-2
- update BuildRequires
* Sat Jun 03 2023 Led <ledest@gmail.com> 3.22.0-1
- 3.22.0
- remove patches:
+ 0001-Hotfix-erlware_commons-config-script.patch
* Sat Jun 03 2023 Led <ledest@gmail.com> 3.21.0-1
- 3.21.0
- add patches:
+ 0001-Hotfix-erlware_commons-config-script.patch
- update BuildRequires
* Sat Jun 03 2023 Led <ledest@gmail.com> 3.20.0-3
- git cc0c1a9
* Fri Mar 31 2023 Led <ledest@gmail.com> 3.20.0-2
- git 92710da
* Fri Mar 31 2023 Led <ledest@gmail.com> 3.20.0-1
- 3.20.0
- git 9edb142
- update patches:
+ rebar3-3.20.0-stacktrace.patch
- move docs to separate subpackage
- add manpage
* Thu Mar 30 2023 Led <ledest@gmail.com> 3.19.0-2
- fix changelog
* Thu Mar 30 2023 Led <ledest@gmail.com> 3.19.0-1
- 3.19.0
* Thu Mar 30 2023 Led <ledest@gmail.com> 3.18.0-1
- 3.18.0
- remove patches:
+ 0001-Don-t-crash-on-printing-non-ASCII-characters.patch
* Thu Mar 30 2023 Led <ledest@gmail.com> 3.17.0-1
- 3.17.0
- add patches:
+ 0001-Don-t-crash-on-printing-non-ASCII-characters.patch
- update patches:
+ rebar3-3.17.0-stacktrace.patch
* Thu Mar 30 2023 Led <ledest@gmail.com> 3.16.1-1
- 3.16.1
- git 1d2a8c1
- update BuildRequires
- remove patches:
+ rebar3-3.14.4-pre19.patch
- update patches:
+ rebar3-3.16.1-stacktrace.patch
* Thu Jul 28 2022 Led <ledest@gmail.com> 3.15.2-5
- update Conflicts
* Thu Jul 28 2022 Led <ledest@gmail.com> 3.15.2-4
- fix rebar3-bash-completion
* Thu Jul 28 2022 Led <ledest@gmail.com> 3.15.2-3
- add rebar3-bash-completion package
* Fri May 20 2022 Led <ledest@gmail.com> 3.15.2-2
- rebuild with rescent relx
* Mon May 24 2021 Led <ledest@gmail.com> 3.15.2-1
- 3.15.2
- remove patches:
+ 0001-pass-no_spawn_compiler_process-to-compile-file-2.patch
+ 0002-add-no_spawn_compiler_process-to-opts-that-don-t-eff.patch
+ 0003-Handle-OTP-24-function-location-in-xref.patch
+ 0004-Use-erl_anno-to-extract-line-number.patch
+ 0005-Fix-OTP24-complaining-about-underscored-variables.patch
+ 0006-Add-useful-example-constraint.patch
* Tue Mar 23 2021 Led <ledest@gmail.com> 3.14.4-5
- fix typo in spec
* Tue Mar 23 2021 Led <ledest@gmail.com> 3.14.4-4
- add patches:
+ rebar3-3.14.4-stacktrace.patch
+ rebar3-3.14.4-pre19.patch
* Mon Mar 22 2021 Led <ledest@gmail.com> 3.14.4-3
- add patches:
+ 0001-pass-no_spawn_compiler_process-to-compile-file-2.patch
+ 0002-add-no_spawn_compiler_process-to-opts-that-don-t-eff.patch
+ 0003-Handle-OTP-24-function-location-in-xref.patch
+ 0004-Use-erl_anno-to-extract-line-number.patch
+ 0005-Fix-OTP24-complaining-about-underscored-variables.patch
+ 0006-Add-useful-example-constraint.patch
* Thu Mar 11 2021 Led <ledest@gmail.com> 3.14.4-2
- add rebar and relx templates to bundle
* Thu Feb 25 2021 Led <ledest@gmail.com> 3.14.4-1
- 3.14.4
* Tue Feb 23 2021 Led <ledest@gmail.com> 3.14.3-1
- 3.14.3
* Tue Feb 23 2021 Led <ledest@gmail.com> 3.14.2-1
- 3.14.2
- remove patches:
+ 0001-Prevent-crash-when-function-deemed-undefined-has-no-.patch
+ 0002-use-aws-cp-when-copying-escript-to-s3.patch
+ 0003-Fix-lock-file-not-being-generated-when-no-deps-are-p.patch
+ 0005-Fix-output-issue-bug-when-dialyzer.warnings.unknown-.patch
+ rebar3-3.14.0-doc.patch
* Mon Sep 21 2020 Led <ledest@gmail.com> 3.14.1-2
- add patches:
+ 0003-Fix-lock-file-not-being-generated-when-no-deps-are-p.patch
+ 0005-Fix-output-issue-bug-when-dialyzer.warnings.unknown-.patch
* Thu Sep 10 2020 Led <ledest@gmail.com> 3.14.1-1
- 3.14.1
- remove patches:
+ 0001-Fix-Recursive-Behaviour-Lookup-Regression.patch
+ 0002-require-the-app-name-as-the-last-part-of-git_subdir-.patch
+ 0003-git-lock-abort-if-version-is-not-equal-to-or-greater.patch
- add patches:
+ 0001-Prevent-crash-when-function-deemed-undefined-has-no-.patch
+ 0002-use-aws-cp-when-copying-escript-to-s3.patch
* Thu Sep 03 2020 Led <ledest@gmail.com> 3.14.0-2
- add patches:
+ 0002-require-the-app-name-as-the-last-part-of-git_subdir-.patch
+ 0003-git-lock-abort-if-version-is-not-equal-to-or-greater.patch
* Wed Sep 02 2020 Led <ledest@gmail.com> 3.14.0-1
- 3.14.0
- git 992d8ba
- add patches:
+ 0001-Fix-Recursive-Behaviour-Lookup-Regression.patch
+ rebar3-3.14.0-doc.patch
- update BuildRequires
* Mon Aug 24 2020 Led <ledest@gmail.com> 3.13.2-1
- 3.13.2
- update BuildRequires
* Mon Aug 24 2020 Led <ledest@gmail.com> 3.12.0-1
- 3.12.0
- update BuildRequires
* Mon Aug 24 2020 Led <ledest@gmail.com> 3.11.1-1
- 3.11.1
- update BuildRequires
* Mon Aug 24 2020 Led <ledest@gmail.com> 3.10.0-1
- 3.10.0
- update BuildRequires
* Mon Aug 24 2020 Led <ledest@gmail.com> 3.9.1-1
- 3.9.1
- update BuildRequires
- update escript_incl_apps
* Mon Aug 24 2020 Led <ledest@gmail.com> 3.8.0-1
- 3.8.0
- update BuildRequires
* Sun Aug 23 2020 Led <ledest@gmail.com> 3.7.4-3
- update escript_incl_apps
* Sun Aug 23 2020 Led <ledest@gmail.com> 3.7.4-2
- update escript_incl_apps
* Sun Aug 23 2020 Led <ledest@gmail.com> 3.7.4-1
- 3.7.4
- remove patches:
+ 0001-Fix-sample-config-punctuation.patch
+ 0002-Fix-misleading-config-in-app-template.patch
- update BuildRequires
* Sun Aug 23 2020 Led <ledest@gmail.com> 3.6.2-3
- update Requires of rebar3-static
* Fri Sep 28 2018 Led <ledest@gmail.com> 3.6.2-2
- add patches:
+ 0001-Fix-sample-config-punctuation.patch
+ 0002-Fix-misleading-config-in-app-template.patch
* Fri Sep 28 2018 Led <ledest@gmail.com> 3.6.2-1
- 3.6.2
* Tue Aug 14 2018 Led <ledest@gmail.com> 3.6.1-1
- 3.6.1
* Thu Dec 07 2017 Led <ledest@gmail.com> 3.4.7-1
- 3.4.7
* Wed Sep 13 2017 Led <ledest@gmail.com> 3.4.4-1
- 3.4.4
* Sun Jul 16 2017 Led <ledest@gmail.com> 3.4.2-1
- 3.4.2
* Tue Jun 06 2017 Led <ledest@gmail.com> 3.4.1-1
- 3.4.1
- remove patches:
+ 0001-Typo-seperate-separate.patch
* Sun May 21 2017 Led <ledest@gmail.com> 3.3.6-3
- revert BuildRequires
* Sat May 20 2017 Led <ledest@gmail.com> 3.3.6-2
- update BuildRequires
- update config
* Thu Mar 30 2017 Led <ledest@gmail.com> 3.3.6-1
- 3.3.6
- add patches:
+ 0001-Typo-seperate-separate.patch
* Fri Mar 10 2017 Led <ledest@gmail.com> 3.3.5-2
- update BuildRequires
* Tue Feb 07 2017 Led <ledest@gmail.com> 3.3.5-1
- 3.3.5
* Tue Dec 27 2016 Led <ledest@gmail.com> 3.3.4-1
- 3.3.4
* Mon Dec 12 2016 Led <ledest@gmail.com> 3.3.3-1
- 3.3.3
- remove patches:
+ rebar3-3.1.0-doc.patch
* Sun Oct 30 2016 Led <ledest@gmail.com> 3.3.2-1
- 3.3.2
* Mon Sep 12 2016 Led <ledest@gmail.com> 3.3.1-1
- 3.3.1
* Fri Aug 12 2016 Led <ledest@gmail.com> 3.2.0-1
- 3.2.0
* Fri Jul 15 2016 Led <ledest@gmail.com> 3.1.0-3
- fix BuildRequires
* Sun Apr 10 2016 Led <ledest@gmail.com> 3.1.0-2
- add conflicts to rebar
* Sun Apr 10 2016 Led <ledest@gmail.com> 3.1.0-1
- initial build