File turtle.spec of Package turtle
%define bname turtle
Name: %bname
Version: 1.9.4
Release: 8
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
Patch3: %bname-%version-fix-vsn.patch
Patch11: 0011-turtle-add-consume-3.patch
Patch12: 0012-turtle-update-consume-2-consume-3.patch
Patch13: 0013-turtle_subscriber-add-no_ack-support.patch
Patch14: 0014-turtle_subscriber-add-missed-clause-to-handle_comman.patch
Patch15: 0015-turtle_subscriber-remove-warning-in-handle_commands-.patch
Patch21: 0021-no_ack-reimplemented-as-new-simple-mode.patch
Patch22: 0022-turtle_subscriber-stylistic-changes.patch
Patch23: 0023-turtle_service-update-mode_ok-1-for-simple-mode.patch
Patch24: 0024-turtle_subscriber-shrink-handle_message-4-format_amq.patch
Patch25: 0025-turtle_subscriber-shrink-handle_message-5.patch
Patch26: 0026-turtle_subscriber-add-no_ack-workaround-to-mode-1.patch
Patch27: 0027-turtle_subscriber-add-missed-clause-to-handle_comman.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 -F1
%patch2 -p1
%patch3 -p1
%patch -p1 -P 11 -P 12 -P 13 -P 14 -P 15
%patch -p1 -P 21 -P 22 -P 23 -P 24 -P 25 -P 26 -P 27
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:foldl(fun({K, _} = T, A) -> lists:keystore(K, 1, A, T) end, L,
[{applications, lists:delete(uuid, proplists:get_value(applications, L, []))},
{env, [{connection_config, []}]}])]),
[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
* Fri Jan 25 2019 Led <ledest@gmail.com> 1.9.4-8
- add patches:
+ 0027-turtle_subscriber-add-missed-clause-to-handle_comman.patch
* Fri Jan 25 2019 Led <ledest@gmail.com> 1.9.4-7
- add patches:
+ 0021-no_ack-reimplemented-as-new-simple-mode.patch
+ 0022-turtle_subscriber-stylistic-changes.patch
+ 0023-turtle_service-update-mode_ok-1-for-simple-mode.patch
+ 0024-turtle_subscriber-shrink-handle_message-4-format_amq.patch
+ 0025-turtle_subscriber-shrink-handle_message-5.patch
+ 0026-turtle_subscriber-add-no_ack-workaround-to-mode-1.patch
* Tue Nov 27 2018 Led <ledest@gmail.com> 1.9.4-6
- clean up connection_config list in app env
* Thu Nov 22 2018 Led <ledest@gmail.com> 1.9.4-5
- add patches:
+ 0014-turtle_subscriber-add-missed-clause-to-handle_comman.patch
+ 0015-turtle_subscriber-remove-warning-in-handle_commands-.patch
* Thu Nov 08 2018 Led <ledest@gmail.com> 1.9.4-4
- add patches:
+ turtle-1.9.4-fix-vsn.patch
* Thu Nov 08 2018 Led <ledest@gmail.com> 1.9.4-3
- fix changelog
* Sun Nov 04 2018 Led <ledest@gmail.com> 1.9.4-2
- add patches:
+ 0011-turtle-add-consume-3.patch
+ 0012-turtle-update-consume-2-consume-3.patch
+ 0013-turtle_subscriber-add-no_ack-support.patch
* Sun Nov 04 2018 Led <ledest@gmail.com> 1.9.4-1
- 1.9.4
* Sun Nov 04 2018 Led <ledest@gmail.com> 1.9.3-1
- 1.9.3
* Sun Nov 04 2018 Led <ledest@gmail.com> 1.9.2-1
- 1.9.2
* 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