File horus.spec of Package horus
%define bname horus
Name: %bname
Version: 0.2.3
Release: 2
Summary: Erlang anonymous function to standalone module
License: Apache-2.0 and MPL-2.0
Group: Development/Tools/Other
URL: https://github.com/rabbitmq/%bname
Source: %bname-%version.tar.xz
#Patch0: %bname-%version-git.patch
Patch1: %bname-0.2.3-doc.patch
BuildArch: noarch
Provides: erlang-%bname = %version-%release
BuildRequires: erlang >= 1:21.2
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: rebar >= 2.6.1-7
%description
Horus is a library that extracts an anonymous function’s code and creates
a standalone version of it in a new module at runtime.
The goal is to have a storable and transferable function which does not depend
on the availability of the module that defined it.
%package devel
Summary: Headers of %bname
Group: Development/Tools/Other
Provides: erlang-%bname-devel = %version-%release
%description devel
Horus is a library that extracts an anonymous function’s code and creates
a standalone version of it in a new module at runtime.
This package contains headers of %bname.
%package doc
Summary: Documentation of %bname
Group: Documentation/HTML
Provides: erlang-%bname-doc = %version-%release
%description doc
Horus is a library that extracts an anonymous function’s code and creates
a standalone version of it in a new module at runtime.
This package contains documentation of %bname.
%prep
%setup -q -n %bname-%version
#patch -p1 -P0
%patch -p1 -P1
%build
erl -noshell -eval '
{ok, L} = file:consult("rebar.config"),
C = case lists:keyfind(edoc_opts, 1, L) of
{_, [_|_] = O} ->
lists:keystore(edoc_opts, 1, L,
{edoc_opts, lists:foldl(fun(K, A) -> lists:keydelete(K, 1, A) end, O, [doclet, layout])});
_ -> L
end,
file:write_file("%bname.rebar.config", [[io_lib:print(E), ".\n"] || E <- lists:keydelete(deps, 1, C)], [raw]),
init:stop().'
ERL_COMPILER_OPTIONS="[inline,verbose]" rebar %{?_smp_mflags} -C %bname.rebar.config compile -v
rebar %{?_smp_mflags} -C %bname.rebar.config doc -v
%install
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/ebin
install -p -m 0644 ebin/* %buildroot%_otplibdir/%bname-%version/ebin/
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/include
install -p -m 0644 include/* %buildroot%_otplibdir/%bname-%version/include/
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/doc
install -p -m 0644 doc/*.{css,html,png} %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/
%check
export ERL_COMPILER_OPTIONS="[inline,verbose]"
rebar -C %bname.rebar.config xref
#rebar -C %bname.rebar.config eunit -v
%files
%defattr(-,root,root)
%_otplibdir/*
%exclude %_otplibdir/%bname-*/include
%exclude %_otplibdir/%bname-*/doc
%files devel
%defattr(-,root,root)
%dir %_otplibdir/%bname-*
%_otplibdir/%bname-*/include
%files doc
%defattr(-,root,root)
%doc %_docdir/%name
%doc %dir %_otplibdir/%bname-*
%doc %_otplibdir/%bname-*/doc
%changelog
* Sat May 11 2024 Led <ledest@gmail.com> 0.2.3-2
- add patches:
+ horus-0.2.3-doc.patch
* Sat May 11 2024 Led <ledest@gmail.com> 0.2.3-1
- 0.2.3