File redo.spec of Package redo

%define bname redo
Name: %bname
Version: 1.1.0
Release: 2
Summary: A pipelined redis client written in Erlang
License: MIT
Group: Development/Tools/Other
URL: https://github.com/jkvor/%bname
Source: %bname-%version.tar.xz
BuildArch: noarch
Provides: erlang-%bname = %version-%release

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

%description
Redo is a pipelined redis client written in Erlang. It lacks any sort of
syntactic sugar. The only API function is redo:cmd, which takes a raw redis
command.


%prep
%setup -q -n %bname-%version


%build
echo '{erl_opts, [slim, inline, no_debug_info]}.' > %bname.rebar.config
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/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 README* %buildroot%_docdir/%name/
ln -sf %_otplibdir/%bname-%version/doc %buildroot%_docdir/%name/html


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


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


%changelog
* Tue Mar 22 2016 Led <ledest@gmail.com> 1.1.0-2
- clean up BuildRequires

* Mon Apr 20 2015 Led <ledest@gmail.com> 1.1.0-1
- initial build