File ex_guard.spec of Package ex_guard
%def_enable check
%def_without doc
%define bname ex_guard
Name: %bname
Version: 1.6.1
Release: 2
Summary: A mix command to handle events on file system modifications
License: MIT
Group: Development/Tools/Other
URL: https://github.com/slashmili/%bname
Source: %bname-%version.tar.xz
#Patch0: %bname-%version-git.patch
BuildArch: noarch
Provides: elixir-%bname = %version-%release
Requires: elixir >= 1.3
Requires: erlang_app(fs) >= 8.6.1
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: elixir >= 1.3
BuildRequires: mix >= 1.3.2-7
BuildRequires: erlang_app(fs) >= 8.6.1
BuildRequires: elixir-hex
%{?_enable_check:BuildRequires: elixir-ex_unit}
%description
ExGuard is a mix command to handle events on file system modifications,
ExGuard heavily borrowed ideas/art works from Ruby Guard.
%prep
%setup -q -n %bname-%version
#patch -p1 -P0
sed -i '/^ deps:/a\ prune_code_paths: false,' mix.exs
sed -i '/^ deps:/s/: /&[], #/' mix.exs
%build
export LANG=en_US.UTF-8
ERL_COMPILER_OPTIONS='[inline,verbose]' mix compile --force --no-deps-check
%{?_with_doc: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 -m 0644 README* CHANGELOG* %buildroot%_docdir/%name/
%if_with doc
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/
ln -sf %_otplibdir/%bname-%version/doc %buildroot%_docdir/%name/html
%endif
%if_enabled check
%check
export LANG=en_US.UTF-8
MIX_ENV=test mix clean
ERL_COMPILER_OPTIONS='[inline,verbose]' mix test --no-deps-check
%endif
%files
%defattr(-,root,root)
%doc %_docdir/%name
%_otplibdir/*
%changelog
* Tue Nov 19 2024 Led <ledest@gmail.com> 1.6.1-2
- fix BuildRequires
* Thu May 09 2024 Led <ledest@gmail.com> 1.6.1-1
- 1.6.1
* Thu May 09 2024 Led <ledest@gmail.com> 1.4.0-1
- 1.4.0
* Thu May 09 2024 Led <ledest@gmail.com> 1.3.3-1
- 1.3.3