File active.spec of Package active

%define bname active
Name: %bname
Version: 1.4
Release: 1
Summary: Erlang sync replacement
License: BSD-3-Clause
Group: Development/Tools/Other
URL: https://github.com/synrc/%bname
Source: %bname-%version.tar
#Patch: %bname-%version-git.patch
BuildArch: noarch
Provides: erlang-%bname = %version-%release

BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: rebar erl_interface

%description
Active is sync replacement that uses native FileSystem OS async listeners to
compile and reload Erlang files, DTL templates and other files. It acts as FS
subscriber under supervision and uses MAD under the hood.


%prep
%setup -q
#patch -p1


%build
echo "{erl_opts, [slim]}." > %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,doc},%_docdir/%name}
install -p -m 0644 ebin/* %buildroot%_otplibdir/%bname-%version/ebin/
install -p -m 0644 doc/*.{css,html,png} %buildroot%_otplibdir/%bname-%version/doc/
install -p -m 0644 README* %buildroot%_docdir/%name/
ln -sf %_otplibdir/%bname-%version/doc %buildroot%_docdir/%name/html


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


%changelog
* Thu May 07 2015 Led <ledest@gmail.com> 1.4-1
- 1.4

* Sun Apr 05 2015 Led <ledest@gmail.com> 0.9-6
- clean up BuildRequires
- clean up docs

* Mon Mar 30 2015 Led <ledest@gmail.com> 0.9-5
- spec: cosmetic fixes

* Mon Mar 30 2015 Led <ledest@gmail.com> 0.9-4
- spec: cosmetic fixes

* Sat Feb 28 2015 Led <ledest@gmail.com> 0.9-3
- update patches:
  + active-0.9-git.patch

* Sat Feb 28 2015 Led <ledest@gmail.com> 0.9-2
- added provides

* Fri Feb 27 2015 Led <ledest@gmail.com> 0.9-1
- initial build