File pcache.spec of Package pcache

%define bname pcache
Name: %bname
Version: 2.0.0
Release: 3
Summary: Erlang process based cache
License: Public domain
Group: Development/Tools/Other
URL: https://github.com/mattsta/%bname
Source: %bname-%version.tar.xz
Patch: %bname-%version-git.patch
Provides: erlang-%bname = %version-%release
BuildArch: noarch

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

%description
%bname is an Erlang process based cache.
%bname uses erlang processes to auto-expire cache items.


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


%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
ln -sf %_otplibdir/%bname-%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
* Mon Mar 21 2016 Led <ledest@gmail.com> 2.0.0-3
- clean up BuildRequires
- remove patches:
  + 0001-pcache_reaper-simplify-pcache_reaper-2-by-using-time.patch
  + 0002-pcache_reaper-remove-double-check-of-cache-size-for-.patch
  + 0003-pcache_server-remove-unneeded-multiple-calls-of-os-t.patch
- add patches:
  + pcache-2.0.0-git.patch

* Sat Jan 23 2016 Led <ledest@gmail.com> 2.0.0-2
- add patches:
  + 0001-pcache_reaper-simplify-pcache_reaper-2-by-using-time.patch
  + 0002-pcache_reaper-remove-double-check-of-cache-size-for-.patch
  + 0003-pcache_server-remove-unneeded-multiple-calls-of-os-t.patch

* Sat Jan 23 2016 Led <ledest@gmail.com> 2.0.0-1
- 2.0.0

* Sat Jul 04 2015 Led <ledest@gmail.com> 1.0.0-1
- initial build
openSUSE Build Service is sponsored by