File elixir-hex.spec of Package elixir-hex
%def_without docs
%define bname hex
Name: elixir-%bname
Version: 2.0.6
Release: 2
Summary: Package manager for the Erlang VM
License: Apache-2.0
Group: Development/Tools/Other
URL: https://github.com/hexpm/%bname
Source: %bname-%version.tar.xz
#Patch0: %bname-%version-git.patch
Patch11: %bname-1.0.1-stacktrace.patch
BuildArch: noarch
Requires: elixir >= 1.5
Provides: erlang-%bname = %version-%release
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: mix erlang-public_key-devel
BuildRequires: erlang-otpbp-devel >= 0.37.0
%{?_with_docs:BuildRequires: ex_doc}
%description
Hex is package manager for the Erlang VM.
%prep
%setup -q -n %bname-%version
#patch0 -p1
%patch11 -p1
%build
export LANG=en_US.UTF-8 MIX_NO_DEPS=1
%if %_otp_release < 21
ERL_COMPILER_OPTIONS="[inline,verbose,{parse_transform,otpbp_pt}]" \
%else
ERL_COMPILER_OPTIONS="[inline,verbose]" \
%endif
mix compile --force --no-deps-check
%{?_with_docs: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%_docdir/%name
install -p -m 0644 *.md %buildroot%_docdir/%name/
%if_with docs
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/doc
install -p -m 0644 doc/*.html %buildroot%_otplibdir/%bname-%version/doc/
ln -sf %_otplibdir/%bname-%version/doc %buildroot%_docdir/%name/html
%endif
%add_erlang_req_beam_skiplist %(echo Elixir.Hex.Solver.Constraint.{Atom,BitString,Float,Function,Integer,List,Map,PID,Port,Reference,Tuple})
%if 0
%check
%if %_otp_release < 21
ERL_COMPILER_OPTIONS="[inline,verbose,{parse_transform,otpbp_pt}]" \
%else
ERL_COMPILER_OPTIONS="[inline,verbose]" \
%endif
mix test --force --no-deps-check
%endif
%files
%defattr(-,root,root)
%doc %_docdir/%name
%_otplibdir/*
%changelog