LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File rabbitmq-server.spec of Package rabbitmq-server (Project home:Ledest:erlang)

%define bname rabbit
Name: rabbitmq-server
Summary: Open source multi-protocol messaging broker
Version: 3.6.16
Release: 6
License: MPL-1.1
Group: Development/Tools/Other
URL: https://github.com/rabbitmq/%name
Source0: %name-%version.tar.xz
Source1: %name-release-%version.tar.xz
Patch0: %name-%version-git.patch
Patch1: 0001-clean-up-workarounds-for-Erlang-OTP-18.patch
Patch4: %name-3.6.12-fix-include.patch
Patch5: %name-3.6.3-erl_opts.patch
Patch6: %name-3.6.11-plugins.patch
Patch10: %name-release-%version-git.patch
Patch11: %name-release-3.6.12-service.patch
Patch12: %name-release-3.6.6-tmpfiles.patch
Provides: %bname = %version-%release
Provides: erlang-%bname = %version-%release
Requires: logrotate
Requires: erlang >= %(rpm -q --qf '%%{epoch}:%%{version}' erlang | sed 's/^(none)://')
Requires: epmd
%systemd_requires
BuildArch: noarch

BuildRequires: rpm-macros-erlang rpm-build-erlang
BuildRequires: erlang erlang-kernel-devel erlang-public_key-devel
BuildRequires: rabbitmq-codegen >= 3.6.7
BuildRequires: erlang-rabbit_common-devel >= 3.6.11
BuildRequires: erlang-ranch
BuildRequires: xmlto

%define plugins_dir %_otplibdir

%description
%summary.


%package devel
Summary: RabbitMQ Server devel
Group: Development/Tools/Other

%description devel
%summary.


%prep
%setup -q -n %name-%version -a 1
%patch0 -p1
%patch1 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
cd %name-release-*
%patch10 -p1
%patch11 -p1
%patch12 -p1
sed -i '/^DEPS/s/^/#/' Makefile
cd - >/dev/null
sed -i -r '/^DEPS/s/^(DEPS[[:blank:]]*)=/LOCAL_\1+=/' Makefile
%ifdef plugins_dir
# set default plugins dir
sed -i '/-plugins_dist_dir/s|RABBITMQ_PLUGINS_DIR|{&:-%_otplibdir}|' scripts/rabbitmq-plugins
sed -i '/plugins_dir/s|RABBITMQ_PLUGINS_DIR|{&:-%plugins_dir}|' scripts/rabbitmq-server
%endif


%build
make %{?_smp_mflags} UPSTREAM_RMQ_COMPONENTS_MK=$PWD/rabbitmq-components.mk RABBITMQ_VERSION="%version" ERL_COMPILER_OPTIONS='[inline,nowarn_deprecated_function,nowarn_export_all]' V=1 all docs
make -C %name-release-* %{?_smp_mflags} UPSTREAM_RMQ_COMPONENTS_MK=$PWD/rabbitmq-components.mk RABBITMQ_VERSION="%version" V=1 all docs


%install
for i in ebin include; do
	install -d -m 0755 %buildroot%_otplibdir/%bname-%version/$i
	install -p -m 0644 $i/* %buildroot%_otplibdir/%bname-%version/$i/
done
for i in 1 5; do
	install -d -m 0755 %buildroot%_mandir/man$i
	install -p -m 0644 docs/*.$i %buildroot%_mandir/man$i/
done
install -d -m 0755 %buildroot%_otplibdir/%bname-%version/bin
ls scripts/%{bname}* | grep -v '\.bat$' | xargs -I '{}' install -p -m 0755 '{}' %buildroot%_otplibdir/%bname-%version/bin/
install -d -m 0755 %buildroot%_otpdir/bin
for i in %buildroot%_otplibdir/%bname-%version/bin/*; do
	ln -sf %_otplibdir/%bname-%version/bin/$(basename $i) %buildroot%_otpdir/bin/
done
install -d -m 0755 %buildroot%_sbindir
for i in rabbitmq{-{env,plugins,server},ctl}; do
	ln -s %_otpdir/bin/$(basename $i) %buildroot%_sbindir/
done
install -d -m 0755 %buildroot%_localstatedir/{lib/rabbitmq/mnesia,log/rabbitmq}
install -d -m 0755 %buildroot%_sysconfdir/rabbitmq
install -d -m 0755 %buildroot%_unitdir
install -p -m 0644 %name-release-*/packaging/RPMS/Fedora/*.service %buildroot%_unitdir/
install -pD -m 0644 %name-release-*/packaging/RPMS/Fedora/%name.logrotate %buildroot%_sysconfdir/logrotate.d/%name
install -pD -m 0644 %name-release-*/packaging/RPMS/Fedora/%name.tmpfiles %buildroot%_prefix/lib/tmpfiles.d/%name.conf
ln -sf service %buildroot%_sbindir/rc%name
install -d -m 0755 %buildroot%_rundir
install -pD -m 0644 %name-release-*/README.md %buildroot%_docdir/%name/README.release.md
install -p -m 0644 *.md %buildroot%_docdir/%name/
ln -sf .. %buildroot%_otplibdir/%bname-%version/plugins

%if %_otp_release < 19
%add_erlang_req_beam_skiplist lg
%endif


%pre
%_sbindir/groupadd -r rabbitmq >/dev/null 2>&1 ||:
%_sbindir/useradd -g rabbitmq -s /bin/false -r -c "RabbitMQ messaging server" -d %_localstatedir/lib/rabbitmq rabbitmq >/dev/null 2>&1 ||:
%service_add_pre %name.service

%post
%tmpfiles_create %_tmpfilesdir/%name.conf
%fillup_only %name
%service_add_post %name.service

%preun
%service_del_preun %name.service

%postun
%service_del_postun %name.service


%files
%defattr(-,root,root)
%doc %_docdir/%name
%_otpdir/bin/*
%_otplibdir/*
%exclude %_otplibdir/%bname-*/include
%_man1dir/*
%_man5dir/*
%_sbindir/*
%_unitdir/*
%config(noreplace) %_sysconfdir/logrotate.d/*
%_tmpfilesdir
%attr(0755, rabbitmq, rabbitmq) %dir %_localstatedir/lib/rabbitmq
%attr(0750, rabbitmq, rabbitmq) %dir %_localstatedir/lib/rabbitmq/mnesia
%attr(0755, rabbitmq, rabbitmq) %dir %_localstatedir/log/rabbitmq
%dir %_sysconfdir/rabbitmq
%ghost %dir %_rundir/rabbitmq


%files devel
%defattr(-,root,root)
%dir %_otplibdir/%bname-*
%dir %_otplibdir/%bname-*/include


%changelog
* Thu May 16 2019 Led <ledest@gmail.com> 3.6.16-6
- git d5ab079

* Thu May 16 2019 Led <ledest@gmail.com> 3.6.16-5
- update Requires

* Tue Jan 29 2019 Led <ledest@gmail.com> 3.6.16-4
- update patches:
  + 0001-clean-up-workarounds-for-Erlang-OTP-18.patch

* Tue Jan 29 2019 Led <ledest@gmail.com> 3.6.16-3
- git 1db4373

* Fri Nov 09 2018 Led <ledest@gmail.com> 3.6.16-2
- add lg to erlang_req_beam_skiplist for Erlang/OTP < 19

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

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

* Thu Nov 23 2017 Led <ledest@gmail.com> 3.6.14-2
- git 85fcede

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

* Fri Oct 13 2017 Led <ledest@gmail.com> 3.6.12-8
- clean up spec

* Wed Oct 11 2017 Led <ledest@gmail.com> 3.6.12-7
- git 3f96e9b

* Sat Sep 30 2017 Led <ledest@gmail.com> 3.6.12-6
- git 2ccd971
- update patches:
  + 0001-clean-up-workarounds-for-Erlang-OTP-18.patch
  + rabbitmq-server-3.6.12-fix-include.patch

* Sat Sep 23 2017 Led <ledest@gmail.com> 3.6.12-5
- git 879d183
- update patches:
  + rabbitmq-server-release-3.6.12-service.patch

* Sat Sep 16 2017 Led <ledest@gmail.com> 3.6.12-4
- git 833a9da

* Wed Sep 13 2017 Led <ledest@gmail.com> 3.6.12-3
- git a85db6f

* Thu Sep 12 2017 Led <ledest@gmail.com> 3.6.12-2
- clean up spec

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

* Fri Aug 25 2017 Led <ledest@gmail.com> 3.6.11-4
- git f2afe31

* Fri Aug 18 2017 Led <ledest@gmail.com> 3.6.11-3
- update symlink for plugins

* Fri Aug 18 2017 Led <ledest@gmail.com> 3.6.11-2
- add symlink for plugins

* Fri Aug 18 2017 Led <ledest@gmail.com> 3.6.11-1
- 3.6.11
- update patches:
  + rabbitmq-server-3.6.11-fix-include.patch
  + rabbitmq-server-3.6.11-plugins.patch
  + 0001-clean-up-workarounds-for-Erlang-OTP-18.patch
  + rabbitmq-server-release-3.6.11-service.patch

* Fri May 26 2017 Led <ledest@gmail.com> 3.6.10-3
- revert BuildRequires

* Fri May 26 2017 Led <ledest@gmail.com> 3.6.10-2
- update BuildRequires

* Thu May 25 2017 Led <ledest@gmail.com> 3.6.10-1
- 3.6.10
- remove patches:
  + 0001-Makefile-Fix-malformed-manpages.patch
  + 0002-scripts-rabbitmq-server-Work-around-signal-handling-.patch
- update patches:
  + 0001-clean-up-workarounds-for-Erlang-OTP-18.patch
  + rabbitmq-server-3.6.10-fix-include.patch

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

* Sun Apr 30 2017 Led <ledest@gmail.com> 3.6.9-10
- add patches:
  + 0001-Makefile-Fix-malformed-manpages.patch
  + 0002-scripts-rabbitmq-server-Work-around-signal-handling-.patch

* Wed Apr 26 2017 Led <ledest@gmail.com> 3.6.9-9
- add devel subpackage
- add rabbitmq-common subpackage

* Wed Apr 26 2017 Led <ledest@gmail.com> 3.6.9-8
- add patches:
  + rabbitmq-server-3.6.9-plugins.patch
- add default RABBITMQ_PLUGINS_DIR to rabbitmq-plugins and rabbitmq-server scrips

* Wed Apr 26 2017 Led <ledest@gmail.com> 3.6.9-7
- add plugins directory

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

* Mon Apr 10 2017 Led <ledest@gmail.com> 3.6.9-5
- git f0da426

* Thu Apr 06 2017 Led <ledest@gmail.com> 3.6.9-4
- git 0b03088

* Fri Mar 31 2017 Led <ledest@gmail.com> 3.6.9-3
- git 53c050a

* Thu Mar 30 2017 Led <ledest@gmail.com> 3.6.9-2
- git d2eb76a

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

* Tue Mar 28 2017 Led <ledest@gmail.com> 3.6.8-3
- release git f66087e
- add README.release.md

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

* Sun Mar 19 2017 Led <ledest@gmail.com> 3.6.8-1
- 3.6.8
- update patches:
  + rabbitmq-server-3.6.8-fix-include.patch

* Sun Mar 12 2017 Led <ledest@gmail.com> 3.6.6-8
- add patches:
  + rabbitmq-server-release-3.6.6-service.patch
  + rabbitmq-server-release-3.6.6-tmpfiles.patch

* Wed Mar 01 2017 Led <ledest@gmail.com> 3.6.6-7
- add Requires erlang and epmd

* Sun Dec 18 2016 Led <ledest@gmail.com> 3.6.6-6
- simplify post scripts

* Sun Dec 18 2016 Led <ledest@gmail.com> 3.6.6-5
- add workarounds to post scripts

* Mon Dec 04 2016 Led <ledest@gmail.com> 3.6.6-4
- add EL7 compatable post scripts
- add nowarn_export_all compile option

* Thu Dec 01 2016 Led <ledest@gmail.com> 3.6.6-3
- add rabbitmq-server-release sources
- add postscripts
- add systemd files
- add logrotate config

* Wed Nov 30 2016 Led <ledest@gmail.com> 3.6.6-2
- add rabbitmq-env to %%_sbindir

* Sat Nov 26 2016 Led <ledest@gmail.com> 3.6.6-1
- 3.6.6

* Mon Aug 08 2016 Led <ledest@gmail.com> 3.6.5-2
- add patches:
  + 0001-fix-loop-in-flow-control-state.patch
  + 0002-add-resume-after-flow.patch

* Mon Aug 08 2016 Led <ledest@gmail.com> 3.6.5-1
- 3.6.5

* Sun Jul 24 2016 Led <ledest@gmail.com> 3.6.3-1
- 3.6.3
- add patches:
  + rabbitmq-server-3.6.3-erl_opts.patch

* Fri Jul 15 2016 Led <ledest@gmail.com> 3.6.2-5
- fix BuildRequires

* Fri Jul 15 2016 Led <ledest@gmail.com> 3.6.2-4
- add nowarn_deprecated_function compile option

* Wed Jun 15 2016 Led <ledest@gmail.com> 3.6.2-3
- add vsn to app file

* Mon Jun 13 2016 Led <ledest@gmail.com> 3.6.2-2
- add init and logrotate script

* Sun Jun 12 2016 Led <ledest@gmail.com> 3.6.2-1
- initial build