File lager.spec of Package lager
%define bname lager
Name: %bname
Version: 3.6.2
Release: 1
Summary: A logging framework for Erlang/OTP
License: Apache-2.0
Group: Development/Tools/Other
URL: https://github.com/erlang-lager/%bname
Source: %bname-%version.tar.xz
#Patch0: %bname-%version-git.patch
Patch1: lager-3.6.1-filtermap.patch
BuildArch: noarch
Provides: erlang-%bname = %version-%release
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: erlang >= 1:18
BuildRequires: rebar >= 2.6.1-7
BuildRequires: erlang-otp-base-devel
# check
BuildRequires: erlang-goldrush
%description
Lager (as in the beer) is a logging framework for Erlang. Its purpose is to
provide a more traditional way to perform logging in an erlang application that
plays nicely with traditional UNIX logging tools like logrotate and syslog.
%package devel
Summary: Headers and parse transformer of %bname
Group: Development/Tools/Other
Provides: erlang-%bname-devel = %version-%release
Conflicts: %name < 3.2.4-2
%description devel
Headers and parse transformer of %bname
%package doc
Summary: Documentation of %bname
Group: Documentation/HTML
Provides: erlang-%bname-doc = %version-%release
Conflicts: %name < 3.2.4-2
%description doc
Documentation of %bname.
%prep
%setup -q -n %bname-%version
#patch0 -p1
%patch1 -p1
%build
erl -noshell -eval '
{ok, L} = file:consult("rebar.config"),
file:write_file("%bname.rebar.config", [[io_lib:print(E), ".\n"] || E <- lists:keydelete(deps, 1, L)], [raw]),
init:stop().'
ERL_COMPILER_OPTIONS="[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/%name-%version/doc %buildroot%_docdir/%name/html
install -p -m 0644 README* TODO %buildroot%_docdir/%name/
%add_erlang_req_beam_skiplist lager_default_tracer
%check
rebar -C %bname.rebar.config eunit
%files
%defattr(-,root,root)
%_otplibdir/*
%exclude %_otplibdir/%bname-*/doc
%exclude %_otplibdir/%bname-*/include
%exclude %_otplibdir/%bname-*/ebin/%{bname}_transform.*
%files devel
%defattr(-,root,root)
%dir %_otplibdir/%bname-*
%_otplibdir/%bname-*/include
%_otplibdir/%bname-*/ebin/%{bname}_transform.*
%files doc
%defattr(-,root,root)
%doc %_docdir/%name
%doc %dir %_otplibdir/%bname-*
%doc %_otplibdir/%bname-*/doc
%changelog
* Mon Apr 30 2018 Led <ledest@gmail.com> 3.6.2-1
- 3.6.2
* Mon Apr 16 2018 Led <ledest@gmail.com> 3.6.1-3
- git 0f30212
* Mon Feb 19 2018 Led <ledest@gmail.com> 3.6.1-2
- fix %%files
* Tue Feb 13 2018 Led <ledest@gmail.com> 3.6.1-1
- 3.6.1
- git ff7ae90
- update patches:
+ lager-3.6.1-filtermap.patch
* Tue Nov 07 2017 Led <ledest@gmail.com> 3.5.2-1
- 3.5.2
- remove 'inline' compile option
- enable %%check
* Thu Jun 15 2017 Led <ledest@gmail.com> 3.5.1-1
- 3.5.1
- git f2e8623
- update URL
- update patches:
+ lager-3.5.1-filtermap.patch
* Thu Jun 15 2017 Led <ledest@gmail.com> 3.5.0-1
- 3.5.0
- git 4536da6
* Sun May 21 2017 Led <ledest@gmail.com> 3.2.4-4
- revert BuildRequires
* Sat May 20 2017 Led <ledest@gmail.com> 3.2.4-3
- update BuildRequires
* Sat Feb 25 2017 Led <ledest@gmail.com> 3.2.4-2
- move docs to doc subpackage
- move parse transformer to devel subpackage
* Thu Oct 20 2016 Led <ledest@gmail.com> 3.2.4-1
- 3.2.4
* Sun Oct 09 2016 Led <ledest@gmail.com> 3.2.3-1
- 3.2.3
- git 81eaef0
* Thu Aug 11 2016 Led <ledest@gmail.com> 3.2.1-1
- 3.2.1
* Sun May 30 2016 Led <ledest@gmail.com> 3.2.0-2
- git 154dfe6
* Sat Apr 09 2016 Led <ledest@gmail.com> 3.2.0-1
- 3.2.0
- remove patches:
+ Export-configure_sink-2-for-runtime-sink-config.patch
- add patches:
+ lager-3.2.0-filtermap.patch
* Mon Apr 04 2016 Led <ledest@gmail.com> 3.1.0-1
- 3.1.0
- update BuildRequires
- add patches:
+ Export-configure_sink-2-for-runtime-sink-config.patch
* Mon Feb 15 2016 Led <ledest@gmail.com> 3.0.3-1
- 3.0.3
* Sat Dec 05 2015 Led <ledest@gmail.com> 3.0.2-1
- 3.0.2
- remove patches:
+ lager-3.0.1-git.patch
- add patches:
+ 0001-Forward-port-292-to-3.x-branch.patch
* Sun Oct 11 2015 Led <ledest@gmail.com> 3.0.1-2
- fix BuildRequires
* Sun Oct 11 2015 Led <ledest@gmail.com> 3.0.1-1
- 3.0.1
* Sat Jul 25 2015 Led <ledest@gmail.com> 3.0.0-3
- ignore requires of lager_default_tracer module
* Sat Jul 25 2015 Led <ledest@gmail.com> 3.0.0-2
- fix URL
* Sat Jul 25 2015 Led <ledest@gmail.com> 3.0.0-1
- initial build