File rabbitmq-management.spec of Package rabbitmq-management

%define bname rabbitmq_management
Name: rabbitmq-management
Summary: RabbitMQ Management Plugin
Version: 3.7.27
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
Patch11: rabbitmq-management-3.6.16-23.patch
Provides: %bname = %version-%release
Provides: erlang-%bname = %version-%release
BuildArch: noarch
Requires: erlang >= 1:19
Requires: rabbitmq-server >= 3.7.10
Requires: erlang-cowboy >= 2.0.0
Requires: erlang-rabbitmq_management_agent >= 3.7.10

BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: erlang >= 1:19
BuildRequires: erlang-otp-base >= 1:19
BuildRequires: erlang-kernel-devel >= 1:19
BuildRequires: erlang-amqp_client-devel >= 3.7.10
BuildRequires: erlang-rabbit_common-devel >= 3.7.10
BuildRequires: erlang-lager-devel
BuildRequires: erlang-rabbitmq_management_agent-devel >= 3.7.10
BuildRequires: erlang-otpbp-devel >= 4.18.0

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


%package devel
Summary: Headers of %name
Group: Development/Tools/Other
Provides: erlang-%bname-devel = %version-%release
Provides: %bname-devel = %version-%release
Conflicts: %name < 3.6.16-6

%description devel
RabbitMQ Management Plugin provides a management UI and HTTP API for RabbitMQ.
This package contains headers of %name.


%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
#patch -p1 -P0
%patch -p1 -P11
sed -i 's/exometer_slide:/rabbit_mgmt_&/g' \
	src/rabbit_mgmt_db.erl src/rabbit_mgmt_stats.erl \
	test/rabbit_mgmt_stats_SUITE.erl test/rabbit_mgmt_test_db_SUITE.erl test/stats_SUITE.erl
sed -i 's/webmachine/rabbit_web_&/g' src/rabbit_mgmt_sup.erl
sed -i -r -e '/^DEPS/s/^/LOCAL_/' Makefile -e '/^(BUILD|TEST)_DEPS/s/^/#/' Makefile
sed -i -r '1s|#!/usr/bin/env .*$|#!%__python|' bin/rabbitmqadmin
%define rc_dir %(erl -noshell -eval 'io:put_chars(code:lib_dir(rabbit_common)).' -s init stop)
sed -i '/^include erlang.mk/i include %rc_dir/mk/rabbitmq-build.mk' Makefile


%build
make %{?_smp_mflags} V=1 RABBITMQ_VERSION="%version" \
%if %_otp_release > 23
	ERL_COMPILER_OPTIONS='[inline,{parse_transform,otpbp_pt}]'
%else
	ERL_COMPILER_OPTIONS='[inline]'
%endif


%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 README*
%_otplibdir/*
%exclude %_otplibdir/%bname-*/include
%exclude %_otplibdir/%bname-*/ebin/rabbit_mgmt_extension.beam


%files devel
%defattr(-,root,root)
%dir %_otplibdir/*
%dir %_otplibdir/%bname-*/ebin
%_otplibdir/%bname-*/include
%_otplibdir/%bname-*/ebin/rabbit_mgmt_extension.beam


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


%changelog
* Fri May 10 2024 Led <ledest@gmail.com> 3.7.27-2
- fix changelog

* Sat Apr 27 2024 Led <ledest@gmail.com> 3.7.27-1
- 3.7.27

* Fri Apr 26 2024 Led <ledest@gmail.com> 3.7.16-1
- 3.7.16

* Fri Apr 26 2024 Led <ledest@gmail.com> 3.7.15-1
- 3.7.15

* Fri Apr 26 2024 Led <ledest@gmail.com> 3.7.14-1
- 3.7.14

* Fri Apr 26 2024 Led <ledest@gmail.com> 3.7.13-1
- 3.7.13

* Fri Apr 26 2024 Led <ledest@gmail.com> 3.7.12-1
- 3.7.12

* Mon Aug 07 2023 Led <ledest@gmail.com> 3.7.11-1
- 3.7.11
- remove patches:
  + 0001-Do-not-use-time_compat.patch
  + 0002-Use-rand-directly-in-master-because-we-require-Erlan.patch
  + 0001-rabbit_mgmt_sup-replace-webmachine_log-add_handler-2.patch

* Mon Aug 07 2023 Led <ledest@gmail.com> 3.6.16-7
- move rabbit_mgmt_extension pure behaviuur module to devel subpackage

* Mon Aug 07 2023 Led <ledest@gmail.com> 3.6.16-6
- remove patches:
  + 0002-clean-up-workarounds-for-Erlang-OTP-18.patch
- add patches:
  + 0001-Do-not-use-time_compat.patch
  + 0002-Use-rand-directly-in-master-because-we-require-Erlan.patch
- move includes to separate subpackage
- clean up docs
- update Requires and BuildRequires

* Sun Jul 09 2023 Led <ledest@gmail.com> 3.6.16-5
- build with/for cowboy1

* Sun Aug 07 2022 Led <ledest@gmail.com> 3.6.16-4
- fix build via otpbp

* Sun Aug 16 2020 Led <ledest@gmail.com> 3.6.16-3
- add patches:
  + rabbitmq-management-3.6.16-23.patch
- fix build on Erlang/OTP 23

* 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