File erlang-metrics.spec of Package erlang-metrics
%define bname metrics
Name: erlang-%bname
Version: 1.2.0
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.4-26
%description
%summary.
A generic interface to folsom, exometer, grapherl or any compliant interface.
%package doc
Summary: %name documentation
Group: Documentation/HTML
Conflicts: %name < 1.2.0
%description doc
A generic interface to folsom, exometer, grapherl or any compliant interface.
This package contains documentation in HTML format.
%prep
%setup -q -n %bname-%version
%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(edoc_opts, 1, lists:keydelete(deps, 1, L),
{edoc_opts, case lists:keyfind(edoc_opts, 1, L) of
{_, O} -> lists:keystore(new, 1, lists:keydelete(doclet, 1, O),
{new, true});
_ -> [{new, true}]
end})),
[raw]),
init:stop().'
ERL_COMPILER_OPTIONS="[inline,verbose]" rebar %{?_smp_mflags} -C %bname.rebar.config compile -v
rebar %{?_smp_mflags} -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)
%_otplibdir/*
%exclude %_otplibdir/%bname-*/doc
%files doc
%defattr(-,root,root)
%doc %_docdir/%name
%doc %dir %_otplibdir/%bname-*
%doc %_otplibdir/%bname-*/doc
%changelog
* Mon Mar 25 2019 Led <ledest@gmail.com> 1.2.0-1
- 1.2.0
- move docs to separate subpackage
- add {new, true} to edoc_opts
- update BuildRequires
* Sun Mar 12 2017 Led <ledest@gmail.com> 1.0.1-1
- initial build