diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ec1717d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/rebar3-3.6.2.tar.gz +/rebar3-bin-3.6.2.tar.gz diff --git a/add-rebar3-escript.patch b/add-rebar3-escript.patch new file mode 100644 index 0000000..a6407d5 --- /dev/null +++ b/add-rebar3-escript.patch @@ -0,0 +1,9 @@ +diff -Nru rebar3-3.6.1.orig/rebar3 rebar3-3.6.1/rebar3 +--- rebar3-3.6.1.orig/rebar3 1970-01-01 01:00:00.000000000 +0100 ++++ rebar3-3.6.1/rebar3 2018-10-12 11:27:36.787689371 +0200 +@@ -0,0 +1,5 @@ ++#!/usr/bin/escript ++%%! -noshell -noinput ++ ++main (Args) -> ++ rebar3:main(Args). diff --git a/erlang-rebar3.spec b/erlang-rebar3.spec new file mode 100644 index 0000000..2381224 --- /dev/null +++ b/erlang-rebar3.spec @@ -0,0 +1,90 @@ +%global realname rebar3 +%global otp_app_name rebar + +# Technically we're noarch, but our install path is not. +%global debug_package %{nil} + +# Bootstrapping +%global bootstrap 1 + +Name: erlang-%{realname} +Version: 3.6.2 +Release: 1%{?dist} +Summary: Tool for working with Erlang projects +License: ASL 2.0 and MIT +URL: https://github.com/erlang/%{realname} +Source0: %{url}/archive/%{version}.tar.gz#/%{realname}-%{version}.tar.gz +# Escript used to launch rebar3 +Patch0: add-rebar3-escript.patch +%if 0%{?bootstrap} +# I was not able to work with a non-archived source, so I built one with +# `fetch-precompiled-rebar3.sh` +Source1: %{realname}-bin-%{version}.tar.gz +%else +BuildRequires: rebar3 +%endif +BuildRequires: erlang-erts +BuildRequires: perl-interpreter +BuildRequires: erlang-erts +BuildRequires: erlang-erlware_commons +BuildRequires: erlang-ssl_verify_fun +BuildRequires: erlang-certifi +BuildRequires: erlang-providers +BuildRequires: erlang-getopt +BuildRequires: erlang-bbmustache +BuildRequires: erlang-relx +BuildRequires: erlang-cf +BuildRequires: erlang-cth_readable +BuildRequires: erlang-eunit_formatters +Requires: erlang-erts +Requires: erlang-erlware_commons +Requires: erlang-ssl_verify_fun +Requires: erlang-certifi +Requires: erlang-providers +Requires: erlang-getopt +Requires: erlang-bbmustache +Requires: erlang-relx +Requires: erlang-cf +Requires: erlang-cth_readable +Requires: erlang-eunit_formatters + +%description +Rebar3 is an Erlang tool that makes it easy to create, develop, and release +Erlang libraries, applications, and systems in a repeatable manner. + +%prep +%setup -q -n %{realname}-%{version} +%if 0%{?bootstrap} +%setup -q -D -T -a 1 -n %{realname}-%{version} +%endif +%patch0 -p1 + +%build +ebin_paths=$(perl -e 'print join(":", grep { !/rebar/} glob("%{_libdir}/erlang/lib/*/ebin"))') +%if 0%{?bootstrap} +./precompiled/%{realname} bare compile --paths $ebin_paths --separator : +%else +%{realname} bare compile --paths $ebin_paths --separator : +%endif + +%install +mkdir -p %{buildroot}%{_bindir} +mkdir -p %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/ebin/ +mkdir -p %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/priv/ +mkdir -p %{buildroot}%{_mandir}/man1/ +install -p -m755 %{realname} %{buildroot}%{_bindir}/%{realname} +install -p -m644 ebin/*.beam %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/ebin/ +install -p -m644 ebin/%{otp_app_name}.app %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/ebin/ +install -p -m755 -d priv/* %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/priv/ +install -p -m644 manpages/%{realname}.1 %{buildroot}%{_mandir}/man1/ + +%files +%license LICENSE +%doc README.md +%{_bindir}/%{realname} +%{_libdir}/erlang/lib/%{realname}-%{version} +%{_mandir}/man1/%{realname}.1* + +%changelog +* Fri Oct 12 2018 Timothée Floure - 3.6.2-1 +- Let there be package diff --git a/sources b/sources new file mode 100644 index 0000000..dd6dc38 --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (rebar3-3.6.2.tar.gz) = 94b2826ae1aa5679c6582bb7cc17a892f621f110b1042d69e0c63219e384c43fb2c090faa4828be2af48fab826c1f34842a6d84d24f66852e60a7f8a419a616a +SHA512 (rebar3-bin-3.6.2.tar.gz) = dfbb561fa274b5109df116716fce3c3159371f24c3d08e4047168b92dc7d6c6ba28176f70dd8eff29eb75635d09cc44e045e35658e4f94274e79d47f9c7735bc