File earmark_parser.spec of Package earmark_parser

%def_disable check
%def_without doc

%define bname earmark_parser
Name: %bname
Version: 1.4.42
Release: 1
Summary: A Pure Elixir Markdown Parser
License: Apache-2.0
Group: Development/Tools/Other
URL: https://github.com/RobertDober/%bname
Source: %bname-%version.tar.xz
#Patch0: %bname-%version-git.patch
BuildArch: noarch
Provides: elixir-%bname = %version-%release
Requires: elixir >= 1.7

BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: elixir >= 1.7
BuildRequires: mix >= 1.3.2-7
BuildRequires: erlang-parsetools-devel
BuildRequires: elixir-hex
%if_enabled check
# check
BuildRequires: elixir-extractly >= 0.5.3
BuildRequires: elixir-earmark_ast_dsl >= 0.3.7
BuildRequires: elixir-excoveralls >= 0.14.4
BuildRequires: elixir-floki >= 0.32
%endif

%description
EarmarkParser is a pure Elixir Markdown Parser (split from Earmark).


%prep
%setup -q -n %bname-%version
#patch -p1 -P0
sed -i '/elixir:/s/1\.11/1.7/' mix.exs
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* RELEASE* %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
LANG=en_US.UTF-8 ERL_COMPILER_OPTIONS='[inline,verbose]' mix test --no-deps-check
%endif


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


%changelog
* Tue Dec 24 2024 Led <ledest@gmail.com> 1.4.42-1
- 1.4.42
- disable check

* Tue Dec 24 2024 Led <ledest@gmail.com> 1.4.40-1
- 1.4.40
- enable check

* Wed Jun 26 2024 Led <ledest@gmail.com> 1.4.39-3
- disable check

* Sun May 12 2024 Led <ledest@gmail.com> 1.4.39-2
- fix BuildRequires

* Sat May 11 2024 Led <ledest@gmail.com> 1.4.39-1
- 1.4.39
- enable check

* Wed May 08 2024 Led <ledest@gmail.com> 1.4.31-1
- 1.4.31

* Sun Jul 16 2023 Led <ledest@gmail.com> 1.4.19-1
- 1.4.19

* Sat Jul 15 2023 Led <ledest@gmail.com> 1.4.10-2
- clean up BuildRequires

* Sat Jul 15 2023 Led <ledest@gmail.com> 1.4.10-1
- 1.4.10
openSUSE Build Service is sponsored by