File poison.spec of Package poison

%define bname poison
Name: %bname
Version: 2.2.0
Release: 1
Summary: An experimental Elixir JSON library
License: BSD-3-Clause
Group: Development/Tools/Other
URL: https://github.com/devinus/%bname
Source: %bname-%version.tar.xz
#Patch: %bname-%version-git.patch
BuildArch: noarch
Provides: elixir-%bname = %version-%release
Requires: elixir >= 1.0

BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: mix
BuildRequires: earmark >= 0.2
BuildRequires: ex_doc >= 0.11
# benchmarks
#BuildRequires: erlang-jiffy elixir-jazz elixir-exjsx

%description
Poison is a new JSON library for Elixir focusing on wicked-fast speed without
sacrificing simplicity, completeness, or correctness.
Poison takes several approaches to be the fastest JSON library for Elixir.


%prep
%setup -q -n %bname-%version
#patch -p1
rm -f mix.lock
sed -i -r '/^[[:blank:]]*deps:[[:blank:]]+deps\(\)[[:blank:]]*,[[:blank:]]*$/d' mix.exs


%build
rm -f config/config.exs
export LANG=en_US.UTF-8
mix compile --force --no-deps-check
mix docs


%install
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/ebin
install -p -m 0644 _build/dev/lib/%bname/ebin/* %buildroot%_otplibdir/%bname-%version/ebin/
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/doc/dist
install -p -m 0644 doc/dist/* %buildroot%_otplibdir/%bname-%version/doc/dist/
install -p -m 0644 doc/*.html %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/

%add_erlang_req_beam_skiplist Elixir.Poison.Decoder.Atom Elixir.Poison.Decoder.BitString Elixir.Poison.Decoder.Float
%add_erlang_req_beam_skiplist Elixir.Poison.Decoder.Function Elixir.Poison.Decoder.Integer Elixir.Poison.Decoder.List
%add_erlang_req_beam_skiplist Elixir.Poison.Decoder.Map Elixir.Poison.Decoder.PID Elixir.Poison.Decoder.Port
%add_erlang_req_beam_skiplist Elixir.Poison.Decoder.Reference Elixir.Poison.Decoder.Tuple
%add_erlang_req_beam_skiplist Elixir.Poison.Encoder.Function Elixir.Poison.Encoder.PID Elixir.Poison.Encoder.Port
%add_erlang_req_beam_skiplist Elixir.Poison.Encoder.Reference Elixir.Poison.Encoder.Tuple


%check
LANG=en_US.UTF-8 mix test --no-color


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


%changelog
* Sun Jun 26 2016 Led <ledest@gmail.com> 2.2.0-1
- 2.2.0

* Sat Jun 18 2016 Led <ledest@gmail.com> 2.1.0-1
- 2.1.0

* Sun Jan 31 2016 Led <ledest@gmail.com> 2.0.1-1
- 2.0.1

* Sun Oct 11 2015 Led <ledest@gmail.com> 1.5.0-5
- clean up BuildRequires

* Sun Oct 11 2015 Led <ledest@gmail.com> 1.5.0-4
- enable %%check

* Sun Oct 11 2015 Led <ledest@gmail.com> 1.5.0-3
- clean up deps

* Sun Oct 11 2015 Led <ledest@gmail.com> 1.5.0-2
- build docs

* Sun Oct 11 2015 Led <ledest@gmail.com> 1.5.0-1
- 1.5.0

* Sun Jul 05 2015 Led <ledest@gmail.com> 1.4.0-1
- initial build
openSUSE Build Service is sponsored by