LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File mimerl.spec of Package mimerl (Project home:Ledest:erlang:19)

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

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

%description
%summary.


%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(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


%files
%defattr(-,root,root)
%doc %_docdir/%name
%_otplibdir/*


%changelog
* Sun Mar 12 2017 Led <ledest@gmail.com> 1.0.2-1
- initial build