File erlang-metrics.spec of Package erlang-metrics
%define bname metrics
Name: erlang-%bname
Version: 1.0.1
Release: 1
Summary: A generic interface to different metrics systems in Erlang
License: BSD-3-Clause
Group: Development/Tools/Other
URL: https://github.com/benoitc/erlang-%bname
Source: %bname-%version.tar.xz
BuildArch: noarch
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: rebar >= 2.6.1-7
%description
%summary.
A generic interface to folsom, exometer, grapherl or any compliant interface.
%prep
%setup -q -n %bname-%version
rm -f doc/{*.{css,md,png},edoc-info}
%build
erl -noshell -eval '
{ok, L} = file:consult("rebar.config"),
file:write_file("%bname.rebar.config",
lists:map(fun(E) -> [io_lib:print(E), ".\n"] end,
lists:keystore(erl_opts, 1, lists:foldl(fun proplists:delete/2, L, [deps, cover_enabled]),
{erl_opts, [slim, inline, no_debug_info|lists:delete(debug_info, proplists:get_value(erl_opts, L, []))]}))),
halt().'
rebar -C %bname.rebar.config compile -v
rebar -C %bname.rebar.config doc -v
%install
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/ebin
install -p -m 0644 ebin/* %buildroot%_otplibdir/%bname-%version/ebin/
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/doc
install -p -m 0644 doc/*.{css,html,png} %buildroot%_otplibdir/%bname-%version/doc/
install -d -m 0755 %buildroot%_docdir/%name
install -p -m 0644 *.md %buildroot%_docdir/%name/
ln -sf %_otplibdir/%bname-%version/doc %buildroot%_docdir/%name/html
%add_erlang_req_beam_skiplist %{bname}_mod
%files
%defattr(-,root,root)
%doc %_docdir/%name
%_otplibdir/*
%changelog
* Sun Mar 12 2017 Led <ledest@gmail.com> 1.0.1-1
- initial build