File rabbitmq-management.spec of Package rabbitmq-management

%define bname rabbitmq_management
Name: rabbitmq-management
Summary: RabbitMQ Management Plugin
Version: 3.6.16
Release: 2
License: MPL-1.1
Group: Development/Tools/Other
URL: https://github.com/rabbitmq/%name
Source: %name-%version.tar.xz
#Patch0: %name-%version-git.patch
Patch1: 0001-rabbit_mgmt_sup-replace-webmachine_log-add_handler-2.patch
Patch2: 0002-clean-up-workarounds-for-Erlang-OTP-18.patch
Provides: %bname = %version-%release
Provides: erlang-%bname = %version-%release
Provides: %bname-devel = %version-%release
Provides: erlang-%bname-devel = %version-%release
BuildArch: noarch
Requires: rabbitmq-server >= 3.6.13
BuildRequires: erlang-rabbitmq_management_agent >= 3.6.16-2

BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: erlang erlang-otp-base
BuildRequires: erlang-amqp_client-devel >= 3.6.13
BuildRequires: erlang-rabbit_common-devel >= 3.6.13
BuildRequires: erlang-rabbitmq_management_agent-devel >= 3.6.13

%description
RabbitMQ Management Plugin provides a management UI and HTTP API for RabbitMQ.


%package -n rabbitmqadmin
Summary: RabbitMQ Management command line tool
Group: System/Management
Conflicts: rabbitmq-management < 3.6.12-3

%description -n rabbitmqadmin
RabbitMQ Management command line tool.


%prep
%setup -q -n %name-%version
#patch0 -p1
%patch1 -p1
%patch2 -p1
sed -i 's/exometer_slide:/rabbitmq_&/g' src/rabbit_mgmt_db.erl src/rabbit_mgmt_stats.erl
sed -i '/^DEPS/s/^/LOCAL_/' Makefile
sed -i -r '/^(BUILD|TEST)_DEPS/s/^/#/' Makefile
sed -i -r '1s|#!/usr/bin/env .*$|#!%__python|' bin/rabbitmqadmin


%build
make %{?_smp_mflags} V=1 RABBITMQ_VERSION="%version" ERL_COMPILER_OPTIONS='[inline]'


%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/
cp -r priv %buildroot%_otplibdir/%bname-%version/
install -d -m 0755 %buildroot%_bindir
install -p -m 0755 bin/* %buildroot%_bindir/


%files
%defattr(-,root,root)
%doc *.md
%_otplibdir/*


%files -n rabbitmqadmin
%defattr(-,root,root)
%_bindir/*


%changelog
* Sun Jul 15 2018 Led <ledest@gmail.com> 3.6.16-2
- replace exometer_slide to rabbitmq_exometer_slide

* Sun Jul 15 2018 Led <ledest@gmail.com> 3.6.16-1
- 3.6.16
- update patches:
  + 0002-clean-up-workarounds-for-Erlang-OTP-18.patch

* Wed Jan 17 2018 Led <ledest@gmail.com> 3.6.15-1
- 3.6.15

* Wed Dec 13 2017 Led <ledest@gmail.com> 3.6.14-2
- git 26037a4

* Wed Nov 07 2017 Led <ledest@gmail.com> 3.6.14-1
- 3.6.14
- update patches:
  + 0002-clean-up-workarounds-for-Erlang-OTP-18.patch

* Sun Oct 29 2017 Led <ledest@gmail.com> 3.6.12-3
- move rabbitmqadmin subpackage

* Tue Sep 12 2017 Led <ledest@gmail.com> 3.6.12-2
- git 42dfe08

* Tue Sep 12 2017 Led <ledest@gmail.com> 3.6.12-1
- 3.6.12

* Fri Aug 18 2017 Led <ledest@gmail.com> 3.6.11-1
- 3.6.11
- update patches:
  + 0002-clean-up-workarounds-for-Erlang-OTP-18.patch

* Fri Jun 02 2017 Led <ledest@gmail.com> 3.6.10-2
- git 5b1f4de

* Fri May 26 2017 Led <ledest@gmail.com> 3.6.10-1
- 3.6.10

* Sun Apr 30 2017 Led <ledest@gmail.com> 3.6.9-9
- update patches:
  + 0002-clean-up-workarounds-for-Erlang-OTP-18.patch

* Sun Apr 30 2017 Led <ledest@gmail.com> 3.6.9-8
- add patches:
  + 0002-clean-up-workarounds-for-Erlang-OTP-18.patch

* Fri Apr 28 2017 Led <ledest@gmail.com> 3.6.9-7
- add patches:
  + 0001-rabbit_mgmt_sup-replace-webmachine_log-add_handler-2.patch

* Wed Apr 26 2017 Led <ledest@gmail.com> 3.6.9-6
- revert 'add symlink of .app to plugins directory'

* Wed Apr 26 2017 Led <ledest@gmail.com> 3.6.9-5
- add requires rabbitmq-server
- add symlink of .app to plugins directory

* Mon Apr 24 2017 Led <ledest@gmail.com> 3.6.9-4
- Makefile: replace DEPS to LOCAL_DEPS

* Mon Apr 24 2017 Led <ledest@gmail.com> 3.6.9-3
- fix rabbitmq_management.app

* Fri Apr 14 2017 Led <ledest@gmail.com> 3.6.9-2
- git cef7884

* Wed Mar 29 2017 Led <ledest@gmail.com> 3.6.9-1
- 3.6.9

* Tue Mar 28 2017 Led <ledest@gmail.com> 3.6.8-2
- git 2d6b2dc

* Sun Mar 19 2017 Led <ledest@gmail.com> 3.6.8-1
- 3.6.8

* Mon Dec 26 2016 Led <ledest@gmail.com> 3.6.6-1
- initial build
openSUSE Build Service is sponsored by