LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File esmtp.spec of Package esmtp (Project home:Ledest:erlang:R15)

%define bname esmtp
Name: %bname
Version: 0.3
Release: 2
Summary: A simple SMTP client for Erlang
License: BSD-3-Clause
Group: Development/Tools/Other
URL: https://github.com/pugpharm/%bname
Source: %bname.tar.xz
BuildArch: noarch
Provides: erlang-%bname = %version-%release

BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: erlang >= R13
BuildRequires: rebar erl_interface

%description
%bname is a simple OTP application providing a way to send emails (and
attachments) from erlang systems.


%prep
%setup -q -n %bname
sed -i 's/{@vsn}/%version/' src/*.erl include/*.hrl


%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,
                          lists:keystore(erl_opts, 1, L,
                                         {erl_opts, [no_debug_info,
                                                     slim, inline,
                                                     warnings_as_errors, warn_unused_vars, warn_unused_import]}))),
halt().'
for c in compile doc; do
	rebar -C %bname.rebar.config $c -v
done


%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/include
install -p -m 0644 include/* %buildroot%_otplibdir/%bname-%version/include/
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/priv
install -p -m 0644 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/%name-%version/doc %buildroot%_docdir/%name/html
install -p -m 0644 README* %buildroot%_docdir/%name/


%check
rebar -C %bname.rebar.config eunit


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


%changelog
* Sat Jul 25 2015 Led <ledest@gmail.com> 0.3-2
- fix Summary and description

* Sat Jul 25 2015 Led <ledest@gmail.com> 0.3-1
- initial build