File jc.spec of Package jc
%define bname jc
Name: %bname
Version: 1.2.1
Release: 1
Summary: Erlang in-memory distributable cache
License: BSD-3-Clause
Group: Development/Tools/Other
URL: https://github.com/jr0senblum/%bname
Source: %bname-%version.tar.xz
#Patch: %bname-%version-git.patch
BuildArch: noarch
Provides: erlang-%bname = %version-%release
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: rebar >= 2.6.1-7
BuildRequires: erlang_beam(lager_transform) >= 3.0.1
%description
Erlang in-memory distributable cache.
Featruing: Pub/Sub, JSON-query, consistency support, and a simple, TCP interop.
protocol.
%prep
%setup -q -n %bname-%version
#patch -p1
sed -i 's| *</br>||g' src/jc_netsplit.erl
%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|proplists:delete(native, proplists:get_value(erl_opts, L, []))]}|lists:foldl(fun proplists:delete/2, L, [erl_opts, deps, cover_enabled])])),
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/config
install -p -m 0644 config/* %buildroot%_otplibdir/%bname-%version/config/
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/
%if 0
%check
rebar -C %bname.rebar.config ct
%endif
%files
%defattr(-,root,root)
%doc %_docdir/%name
%_otplibdir/*
%changelog
* Wed Sep 14 2016 Led <ledest@gmail.com> 1.2.1-1
- 1.2.1
* Sat Jun 11 2016 Led <ledest@gmail.com> 1.2.0-1
- initial build