File redo.spec of Package redo
%define bname redo
Name: %bname
Version: 2.0.0
Release: 2
Summary: A pipelined redis client written in Erlang
License: MIT
Group: Development/Tools/Other
#URL: https://github.com/jkvor/%bname
URL: https://github.com/heroku/%bname
Source: %bname-%version.tar.xz
Patch1: 0001-replace-erlang-now-0-to-os-timestamp-0.patch
Patch2: 0002-add-rebar.config.patch
Patch3: 0003-redo_concurrency_test-using-module-rand-for-Erlang-O.patch
BuildArch: noarch
Provides: erlang-%bname = %version-%release
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: rebar >= 2.6.1-7
# check
BuildRequires: redis
%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
%patch -p1 -P 1 -P 2 -P 3
mv src/bench.erl src/redo_concurrency_test.erl test/
%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,
[{erl_opts, [slim, inline, no_debug_info|lists:delete(debug_info, proplists:get_value(erl_opts, L, []))]}
|lists:foldl(fun proplists:delete/2, L, [deps, erl_opts])])),
init:stop().'
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 README* %buildroot%_docdir/%name/
ln -sf %_otplibdir/%bname-%version/doc %buildroot%_docdir/%name/html
%check
PATH=%_sbindir${PATH:+:$PATH} redis-server &
rebar -C %bname.rebar.config eunit && rc=0 || rc=1
kill %%1
exit $rc
%files
%defattr(-,root,root)
%doc %_docdir/%name
%_otplibdir/*
%changelog
* Sat Jun 24 2017 Led <ledest@gmail.com> 2.0.0-2
- add patches:
+ 0001-replace-erlang-now-0-to-os-timestamp-0.patch
+ 0002-add-rebar.config.patch
+ 0003-redo_concurrency_test-using-module-rand-for-Erlang-O.patch
* Sat Jun 24 2017 Led <ledest@gmail.com> 2.0.0-1
- 2.0.0
- update URL
* 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