LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File eiconv.spec of Package eiconv (Project home:Ledest:erlang:18)

%define bname eiconv
Name: %bname
Version: 1.1
Release: 2
Summary: Erlang iconv NIF wrapper
License: Apache-2.0
Group: Development/Tools/Other
URL: https://github.com/mmzeeman/%bname
Source: %bname.tar.xz
Provides: erlang-%bname = %version-%release

BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: rebar erl_interface erts-devel

%description
Erlang NIF wrapper for iconv.


%prep
%setup -q -n %bname


%build
erl -noshell -eval '
{ok, L} = file:consult("rebar.config"),
file:write_file("%bname.rebar.config",
                lists:map(fun(E) -> io_lib:format("~p.~n", [E]) end,
                          [{erl_opts, [slim, inline, no_debug_info|lists:delete(debug_info, proplists:get_value(erl_opts, L, []))]}|lists:foldl(fun proplists:delete/2, L, [erl_opts, require_otp_vsn, deps])])),
halt().'
CFLAGS="%optflags -flto" LDFLAGS="%optflags -flto" 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/priv
install -p -m 0755 priv/* %buildroot%_otplibdir/%bname-%version/priv/
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
ln -sf %_otplibdir/%bname-%version/doc %buildroot%_docdir/%name/html


%if 0
%check
rebar -C %bname.rebar.config eunit
%endif


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


%changelog
* Tue Mar 22 2016 Led <ledest@gmail.com> 1.1-2
- fix build

* Sun Jun 07 2015 Led <ledest@gmail.com> 1.1-1
- initial build