File turtle.spec of Package turtle
%define bname turtle
Name: %bname
Version: 1.9.1
Release: 4
Summary: A wrapper on the RabbitMQ Erlang Client
License: Apache-2.0
Group: Development/Tools/Other
URL: https://github.com/shopgun/%bname
Source: %bname-%version.tar.xz
Patch1: remove-turtle_time.patch
Patch2: turtle_janitor-replace-maps-take-2-for-comatibility-.patch
BuildArch: noarch
Provides: erlang-%bname = %version-%release
BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: rebar >= 2.6.1-7
BuildRequires: erlang-lager-devel >= 2
BuildRequires: erlang-amqp_client-devel >= 3.6.10
%if 0
# check
BuildRequires: epmd erlang-common_test gproc exometer_core rabbitmq-server
%endif
%description
The turtle application is built to be a wrapper around the RabbitMQ standard
Erlang driver. The purpose is to enable faster implementation and use of RabbitMQ
by factoring out common tasks into a specific application targeted toward ease of
use.
The secondary purpose is to make the Erlang client better behaving toward an OTP
setup. The official client makes lots of assumptions which are not always true in
an OTP setting.
%package doc
Summary: %bname documentation
Group: Documentation/HTML
Conflicts: %name < 1.9.1-1
%description doc
The turtle application is built to be a wrapper around the RabbitMQ standard
Erlang driver. The purpose is to enable faster implementation and use of RabbitMQ
by factoring out common tasks into a specific application targeted toward ease of
use.
The secondary purpose is to make the Erlang client better behaving toward an OTP
setup. The official client makes lots of assumptions which are not always true in
an OTP setting.
This package contains documentation in HTML format.
%prep
%setup -q -n %bname-%version
%patch1 -p1
%patch2 -p1
erl -noshell -eval '
{ok, [{application, %bname, L}]} = file:consult("src/%bname.app.src"),
file:write_file("src/%bname.app.src",
io_lib:format("{application, %bname, ~101p}.~n",
[lists:keystore(applications, 1, L,
{applications, lists:delete(uuid, proplists:get_value(applications, L, []))})]),
[raw]),
init:stop().'
%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="[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/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/
%if 0
%check
install -d -m 0755 test/rabbit/mnesia test/rabbit/log
export RABBITMQ_MNESIA_BASE="$PWD/test/rabbit/mnesia" RABBITMQ_LOG_BASE="$PWD/test/rabbit/log"
%_sbindir/rabbitmqctl shutdown 2>/dev/null ||:
%_sbindir/rabbitmq-server -detached
ERL_COMPILER_OPTIONS="[inline,verbose]" rebar -C %bname.rebar.config ct && rc=0 || rc=1
%_sbindir/rabbitmqctl shutdown ||:
exit $rc
%endif
%files
%defattr(-,root,root)
%_otplibdir/*
%exclude %_otplibdir/%bname-*/doc
%files doc
%defattr(-,root,root)
%doc %_docdir/%name
%doc %dir %_otplibdir/%bname-*
%doc %_otplibdir/%bname-*/doc
%changelog
* Sun Feb 25 2018 Led <ledest@gmail.com> 1.9.1-4
- fix Group
* Sun Feb 25 2018 Led <ledest@gmail.com> 1.9.1-3
- disable %%check
* Thu Feb 15 2018 Led <ledest@gmail.com> 1.9.1-2
- fix summary and description
* Thu Dec 14 2017 Led <ledest@gmail.com> 1.9.1-1
- 1.9.1
- mode docs to separate subpackage
* Tue Oct 17 2017 Led <ledest@gmail.com> 1.9.0-6
- add patches:
+ turtle_janitor-replace-maps-take-2-for-comatibility-.patch
- update %%check
* Tue Oct 17 2017 Led <ledest@gmail.com> 1.9.0-5
- update %%check
* Thu Oct 12 2017 Led <ledest@gmail.com> 1.9.0-4
- update %%check
* Thu Oct 12 2017 Led <ledest@gmail.com> 1.9.0-3
- enable %%check
* Sun Sep 17 2017 Led <ledest@gmail.com> 1.9.0-2
- add patches:
+ remove-turtle_time.patch
* Fri Sep 15 2017 Led <ledest@gmail.com> 1.9.0-1
- initial build