File elixir-hex.spec of Package elixir-hex
%def_without docs
%define bname hex
Name: elixir-%bname
Version: 0.19.0
Release: 1
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
Patch1: %bname-0.19.0-stacktrace.patch
BuildArch: noarch
Requires: elixir >= 1.0
Provides: erlang-%bname = %version-%release
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: mix erlang-public_key-devel
%{?_with_docs:BuildRequires: ex_doc}
%description
Hex is package manager for the Erlang VM.
%prep
%setup -q -n %bname-%version
#patch0 -p1
%patch1 -p1
%build
export LANG=en_US.UTF-8 MIX_NO_DEPS=1
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 hex_pb_names hex_pb_versions
%if 0
%check
mix test --force --no-deps-check
%endif
%files
%defattr(-,root,root)
%doc %_docdir/%name
%_otplibdir/*
%changelog