File otpbp.spec of Package otpbp
%define bname otpbp
Name: %bname
Version: 0.25.0
Release: 1
Summary: Erlang OTP backports
License: GPL-3.0+
Group: Development/Tools/Other
URL: https://github.com/Ledest/%bname
Source: %bname-%version.tar.xz
BuildArch: noarch
Provides: erlang-%bname = %version-%release
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: rebar >= 2.6.1-7
%description
%summary.
%package devel
Summary: Headers and parse transformer of %bname
Group: Development/Tools/Other
Provides: erlang-%bname-devel = %version-%release
Conflicts: %name < 0.22.0
%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 < 0.22.0
%description doc
Documentation of %bname.
%prep
%setup -q -n %bname-%version
%build
erl -noshell -eval '
{ok, L} = file:consult("rebar.config"),
file:write_file("%bname.rebar.config",
lists:map(fun(E) -> [io_lib:print(E), ".\n"] end,
[{erl_opts, [slim, no_debug_info, inline|proplists:get_value(erl_opts, L, [])]},
{edoc_opts, [{preprocess, true}|proplists:get_value(edoc_opts, L, [])]}
|lists:foldl(fun proplists:delete/2, L, [erl_opts, edoc_opts, deps])])),
halt().'
ln -sf rebar.config.script %bname.rebar.config.script
rebar -C %bname.rebar.config compile -v
rebar -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 TODO %buildroot%_docdir/%name/
%files
%defattr(-,root,root)
%_otplibdir/*
%exclude %_otplibdir/%bname-*/doc
%exclude %_otplibdir/%bname-*/include
%exclude %_otplibdir/%bname-*/ebin/%{bname}_pt.*
%files devel
%defattr(-,root,root)
%dir %_otplibdir/%bname-*
%_otplibdir/%bname-*/include
%_otplibdir/%bname-*/ebin/%{bname}_pt.*
%files doc
%defattr(-,root,root)
%doc %_docdir/%name
%doc %dir %_otplibdir/%bname-*
%doc %_otplibdir/%bname-*/doc
%changelog
* Thu May 04 2017 Led <ledest@gmail.com> 0.25.0-1
- 0.25.0
* Tue Apr 11 2017 Led <ledest@gmail.com> 0.24.0-1
- 0.24.0
* Tue Mar 28 2017 Led <ledest@gmail.com> 0.23.1-1
- 0.23.1
* Sun Mar 12 2017 Led <ledest@gmail.com> 0.23.0-2
- cosmetic fix description
* Sat Mar 11 2017 Led <ledest@gmail.com> 0.23.0-1
- 0.23.0
* Sat Feb 25 2017 Led <ledest@gmail.com> 0.22.1-2
- add Conflicts
* Fri Feb 24 2017 Led <ledest@gmail.com> 0.22.1-1
- 0.22.1
- move docs to doc subpackage
- move parse transformer to devel subpackage
* Wed Feb 01 2017 Led <ledest@gmail.com> 0.20.2-1
- 0.20.2
* Sat Jan 28 2017 Led <ledest@gmail.com> 0.20.1-1
- 0.20.1
* Mon Dec 19 2016 Led <ledest@gmail.com> 0.20.0-1
- 0.20.0
* Sun Dec 04 2016 Led <ledest@gmail.com> 0.19.0-1
- 0.19.0
* Sat Aug 27 2016 Led <ledest@gmail.com> 0.16.7-1
- 0.16.7
* Fri Aug 26 2016 Led <ledest@gmail.com> 0.16.6-1
- 0.16.6
* Wed May 11 2016 Led <ledest@gmail.com> 0.16.5-1
- 0.16.5
* Tue Apr 26 2016 Led <ledest@gmail.com> 0.13.1-2
- fix build docs
* Tue Apr 26 2016 Led <ledest@gmail.com> 0.13.1-1
- 0.13.1
* Tue Mar 22 2016 Led <ledest@gmail.com> 0.12.7-2
- add URL
* Tue Mar 22 2016 Led <ledest@gmail.com> 0.12.7-1
- initial build