File mimerl.spec of Package mimerl

%define bname mimerl
Name: %bname
Version: 1.0.2
Release: 1
Summary: Erlang library to handle mimetypes
License: MIT
Group: Development/Tools/Other
Source: %bname-%version.tar.xz
BuildArch: noarch

BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: rebar >= 2.6.1-7


%setup -q -n %bname-%version

erl -noshell -eval '
{ok, L} = file:consult("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, []))]}))),
rebar -C %bname.rebar.config compile -v
rebar -C %bname.rebar.config doc -v

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

%doc %_docdir/%name

* Sun Mar 12 2017 Led <> 1.0.2-1
- initial build