File erlang-cf.spec of Package erlang-cf

%define bname cf
Name:           erlang-%bname
Version:        0.2.2
Release:        2
Summary:        Colored output for Erlang/OTP io and io_lib
License:        MIT
Group:          Development/Tools/Other

# wget --content-disposition
Source:         cf-0.2.2.tar.gz

Provides:       erlang-%bname = %version-%release

%if 0%{?suse_version}
BuildRequires:  rpm-macros-erlang rpm-build-erlang
BuildRequires:  erlang-rpm-macros
BuildRequires:  erlang-rebar >= 2.6.1

cf is a helper library for termial colour printing extending the Erlang/OTP
io:format syntax to add colours.

# avoid error on Fedora 25: error: Empty %files file /home/abuild/rpmbuild/BUILD/erlware_commons/debugfiles.list
%global debug_package %{nil}

%setup -q -n %bname-%version
sed -i \
	-e "/^%%%%/s/\`/'/g" \
	-e '/^%%%%/s/</\&lt;/g' \
	-e '/^%%%%/s/>/\&gt;/g' \

erl -noshell -eval '
{ok, L} = file:consult("rebar.config"),
                lists:map(fun(E) -> io_lib:format("~p.~n", [E]) end,
                          [{erl_opts, [slim, inline, no_debug_info|proplists:delete(debug_info, proplists:get_value(erl_opts, L, []))]},
                           {edoc_opts, [{preprocess, true}|proplists:get_value(edoc_opts, L, [])]}
                           |lists:foldl(fun proplists:delete/2, L, [deps, edoc_opts, erl_opts])])),
for c in compile doc; do
	rebar -C %bname.rebar.config $c -v

install -d -m 0755 %buildroot%_erllibdir/%bname-%version/ebin
install -p -m 0644 ebin/* %buildroot%_erllibdir/%bname-%version/ebin/
install -d -m 0755 %buildroot%_erllibdir/%bname-%version/doc
install -p -m 0644 doc/*.{css,html,png} %buildroot%_erllibdir/%bname-%version/doc/
install -d -m 0755 %buildroot%_docdir/%name
ln -sf %_erllibdir/%bname-%version/doc %buildroot%_docdir/%name/html
install -p -m 0644 *.md %buildroot%_docdir/%name/

%doc %_docdir/%name

* Thu May 25 2017 Timotheus Pokorra <> 0.2.2-2
- fix for Fedora 25, there is no debugging information

* Sun Nov  6 2016 Jeroen van Meeuwen <> 0.2.2-1
- Update to 0.2.2

* Tue Mar 29 2016 Led <> 0.2.0-2
- clean up BuildRequires

* Thu Dec 24 2015 Led <> 0.2.0-1
- initial build