Blob Blame History Raw
%global erlang_minver R12B-3
# We want to install into /usr/lib, even on 64-bit platforms
%global _rabbit_libdir %{_exec_prefix}/lib/rabbitmq


Name: rabbitmq-server
Version: 3.6.5
Release: 1%{?dist}
License: MPLv1.1
Group: Development/Libraries
Source0: http://www.rabbitmq.com/releases/rabbitmq-server/v%{version}/%{name}-%{version}.tar.xz
# curl -O https://raw.githubusercontent.com/rabbitmq/rabbitmq-server/231e90c/scripts/rabbitmq-script-wrapper
# sed -i -e "s, @STDOUT_STDERR_REDIRECTION@,,g" rabbitmq-script-wrapper
# sed -i -e "s,@SU_RABBITMQ_SH_C@,su rabbitmq -s /bin/sh -c,g" rabbitmq-script-wrapper
Source2: rabbitmq-script-wrapper
# curl -O https://raw.githubusercontent.com/lemenkov/rabbitmq-server/cdfc661/packaging/RPMS/Fedora/rabbitmq-server.logrotate
Source3: rabbitmq-server.logrotate
Source5: rabbitmq-server.tmpfiles
Patch1: rabbitmq-server-0001-Remove-excessive-sd_notify-code.patch
Patch2: rabbitmq-server-0002-Add-systemd-notification-support.patch
Patch3: rabbitmq-server-0003-Revert-Distinct-exit-codes-for-CLI-utilities.patch
Patch4: rabbitmq-server-0004-Allow-guest-login-from-non-loopback-connections.patch
Patch5: rabbitmq-server-0005-Avoid-RPC-roundtrips-in-list-commands.patch
Patch6: rabbitmq-server-0006-rabbit_prelaunch-must-use-RABBITMQ_SERVER_ERL_ARGS.patch
Patch101: rabbitmq-common-0001-Avoid-RPC-roundtrips-while-listing-items.patch
Patch102: rabbitmq-common-0002-Use-proto_dist-from-command-line.patch

URL: http://www.rabbitmq.com/
BuildArch: noarch
BuildRequires: erlang >= %{erlang_minver}, python-simplejson, xmlto, libxslt, python, zip
BuildRequires: rsync
BuildRequires: systemd
Requires: logrotate
Requires: erlang-erts%{?_isa} >= %{erlang_minver}
Requires: erlang-kernel%{?_isa} >= %{erlang_minver}
Requires: erlang-eldap%{?_isa} >= %{erlang_minver}
Requires: erlang-mnesia%{?_isa} >= %{erlang_minver}
Requires: erlang-os_mon%{?_isa} >= %{erlang_minver}
Requires: erlang-public_key%{?_isa} >= %{erlang_minver}
Requires: erlang-sasl%{?_isa} >= %{erlang_minver}
Requires: erlang-sd_notify%{?_isa}
Requires: erlang-ssl%{?_isa} >= %{erlang_minver}
Requires: erlang-stdlib%{?_isa} >= %{erlang_minver}
Requires: erlang-tools%{?_isa} >= %{erlang_minver}
Requires: erlang-xmerl%{?_isa} >= %{erlang_minver}
Summary: The RabbitMQ server
# Users and groups
Requires(pre): shadow-utils
Requires(pre): systemd
Requires(post): systemd
Requires(preun): systemd

%description
RabbitMQ is an implementation of AMQP, the emerging standard for high
performance enterprise messaging. The RabbitMQ server is a robust and
scalable implementation of an AMQP broker.

%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1

cd deps/rabbit_common
%patch101 -p1
%patch102 -p1
cd ../..

# We have to remove it until common_test subpackage lands RHOS
rm -f \
	deps/amqp_client/src/rabbit_ct_client_helpers.erl \
	deps/rabbit_common/src/rabbit_ct_broker_helpers.erl \
	deps/rabbit_common/src/rabbit_ct_helpers.erl

%build
#USE_SPECS="true" USE_PROPER_QC="false" make %{?_smp_mflags}
make %{?_smp_mflags}


%install
make install \
	DESTDIR=%{buildroot} \
	PREFIX=%{_prefix} \
	RMQ_ROOTDIR=%{_rabbit_libdir}

make install-man \
	DESTDIR=%{buildroot} \
	PREFIX=%{_prefix} \
	RMQ_ROOTDIR=%{_rabbit_libdir}

mkdir -p %{buildroot}%{_localstatedir}/lib/rabbitmq/mnesia
mkdir -p %{buildroot}%{_localstatedir}/log/rabbitmq

#Copy all necessary lib files etc.
install -p -D -m 0644 docs/rabbitmq-server.service.example %{buildroot}%{_unitdir}/%{name}.service
install -p -D -m 0755 %{S:2} %{buildroot}%{_sbindir}/rabbitmqctl
install -p -D -m 0755 %{S:2} %{buildroot}%{_sbindir}/rabbitmq-server
install -p -D -m 0755 %{S:2} %{buildroot}%{_sbindir}/rabbitmq-plugins

# Make necessary symlinks
mkdir -p %{buildroot}%{_rabbit_libdir}/bin
for app in rabbitmq-defaults rabbitmq-env rabbitmq-plugins rabbitmq-server rabbitmqctl ; do
	ln -s %{_rabbit_libdir}/lib/rabbitmq_server-%{version}/sbin/${app} %{buildroot}%{_rabbit_libdir}/bin/${app}
done

install -p -D -m 0755 scripts/rabbitmq-server.ocf %{buildroot}%{_exec_prefix}/lib/ocf/resource.d/rabbitmq/rabbitmq-server
install -p -D -m 0755 scripts/rabbitmq-server-ha.ocf %{buildroot}%{_exec_prefix}/lib/ocf/resource.d/rabbitmq/rabbitmq-server-ha

install -p -D -m 0644 %{S:3} %{buildroot}%{_sysconfdir}/logrotate.d/rabbitmq-server

install -p -D -m 0644 docs/rabbitmq.config.example %{buildroot}%{_sysconfdir}/rabbitmq/rabbitmq.config

rm %{buildroot}%{_rabbit_libdir}/lib/rabbitmq_server-%{version}/{LICENSE,LICENSE-*,INSTALL}

install -d %{buildroot}%{_localstatedir}/run/rabbitmq
install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf


%check
#make check


%pre
# create rabbitmq group
if ! getent group rabbitmq >/dev/null; then
        groupadd -r rabbitmq
fi

# create rabbitmq user
if ! getent passwd rabbitmq >/dev/null; then
        useradd -r -g rabbitmq -d %{_localstatedir}/lib/rabbitmq rabbitmq \
            -s /sbin/nologin -c "RabbitMQ messaging server"
fi


%post
%systemd_post %{name}.service
/bin/systemctl daemon-reload


%preun
# We do not remove /var/log and /var/lib directories
# Leave rabbitmq user and group
%systemd_preun %{name}.service

# Clean out plugin activation state, both on uninstall and upgrade
rm -rf %{_localstatedir}/lib/rabbitmq/plugins
for ext in rel script boot ; do
    rm -f %{_rabbit_libdir}/lib/rabbitmq_server-%{version}/ebin/rabbit.$ext
done


%postun
%systemd_postun_with_restart %{name}.service

# Fix root:root ownership for config-files (recursively)
%triggerun -- %{name} < 3.5.7-3
/usr/bin/chown -R rabbitmq:rabbitmq %{_sysconfdir}/rabbitmq

%files
%dir %attr(0755, rabbitmq, rabbitmq) %{_sysconfdir}/rabbitmq
%config(noreplace) %attr(0644, rabbitmq, rabbitmq) %{_sysconfdir}/rabbitmq/rabbitmq.config
%config(noreplace) %{_sysconfdir}/logrotate.d/rabbitmq-server
%{_sbindir}/rabbitmqctl
%{_sbindir}/rabbitmq-server
%{_sbindir}/rabbitmq-plugins
%{_rabbit_libdir}/
%{_unitdir}/%{name}.service
# FIXME this should add dependency on "/usr/lib/ocf/resource.d/" owner
%dir /usr/lib/ocf/resource.d/rabbitmq/
/usr/lib/ocf/resource.d/rabbitmq/rabbitmq-server
/usr/lib/ocf/resource.d/rabbitmq/rabbitmq-server-ha
%{_tmpfilesdir}/%{name}.conf
%dir %attr(0750, rabbitmq, rabbitmq) %{_localstatedir}/lib/rabbitmq
%dir %attr(0750, rabbitmq, rabbitmq) %{_localstatedir}/log/rabbitmq
%dir %attr(0755, rabbitmq, rabbitmq) %{_localstatedir}/run/rabbitmq
%doc LICENSE LICENSE-* docs/rabbitmq.config.example
%{_mandir}/man1/rabbitmq-plugins.1*
%{_mandir}/man1/rabbitmq-server.1*
%{_mandir}/man1/rabbitmqctl.1*
%{_mandir}/man5/rabbitmq-env.conf.5*


%changelog
* Tue Aug 23 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.5-1
- Ver. 3.6.5

* Mon Jul 25 2016 John Eckersberg <eck@redhat.com> - 3.6.3-6
- Install rabbitmq-server-ha agent

* Fri Jul 22 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.3-5
- Don't die while retrieving status from faulty node

* Sun Jul 17 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.3-4
- Fixed rabbitmq-server script to use RABBITMQ_SERVER_ERL_ARGS everywhere

* Sun Jul 17 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.3-3
- Improve proto_dist usage patch

* Fri Jul 15 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.3-2
- Avoid RPC roundtrips in list commands
- Use proto_dist from config instead of always using default (inet_tcp)

* Thu Jul  7 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.3-1
- Ver. 3.6.3

* Wed Jun 29 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.2-4
- Fixed crash during slave promotion

* Thu May 26 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.2-3
- Use empty list for non-allowed user names for loopback connection

* Wed May 25 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.2-2
- Keep error codes the same with ver. 3.3.5

* Mon May 23 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.2-1
- Ver. 3.6.2

* Wed Apr  6 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.1-2
- Fix start up failure

* Thu Mar 24 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.6.1-1
- Ver. 3.6.1

* Tue Feb  2 2016 Peter Lemenkov <lemenkov@gmail.com> - 3.5.7-4
- Remove compatibility triggerun scriptlet
- Don't wait for slave stop messages forever (patches #2, #3)
- Drop dependency on syslog.target - this seems to be a leftover
- Require epmd@0.0.0.0 to run. This is a default value. User should override it
  if necessary. This fixes rhbz #1302368

* Wed Dec 16 2015 Peter Lemenkov <lemenkov@gmail.com> - 3.5.7-3
- Mark configs as owned by rabbitmq user/group
- No need to mark tmpfiles-file as config
- Various config cleanups

* Wed Dec 16 2015 Peter Lemenkov <lemenkov@gmail.com> - 3.5.7-2
- Kill support for SysV branches (no more love for EL5 and EL6). Well keep
  scriptlet for upgrading from pre-2.8.4 versions for a while.

* Tue Dec 15 2015 Peter Lemenkov <lemenkov@gmail.com> - 3.5.7-1
- New upstream release - 3.5.7

* Fri Dec 11 2015 Peter Lemenkov <lemenkov@gmail.com> - 3.5.6-5
- Updated out-of-tarball scripts

* Fri Oct 23 2015 Peter Lemenkov <lemenkov@gmail.com> - 3.5.6-4
- Added help subcommand for the scripts

* Fri Oct  9 2015 Peter Lemenkov <lemenkov@gmail.com> - 3.5.6-3
- Install sample config-file (rhbz#1160810)

* Fri Oct  9 2015 Peter Lemenkov <lemenkov@gmail.com> - 3.5.6-2
- RabbitMQ should use /sbin/nologin as a login shell

* Thu Oct  8 2015 John Eckersberg <eck@redhat.com> - 3.5.6-1
- New upstream release - 3.5.6

* Fri Oct  2 2015 Peter Lemenkov <lemenkov@gmail.com> - 3.5.5-2
- Fix issue with recent systemd Notify access control. See this link for
  further details: https://bodhi.fedoraproject.org/updates/rabbitmq-server-3.5.5-1.fc23#comment-330781

* Thu Sep 24 2015 John Eckersberg <eck@redhat.com> - 3.5.5-1
- New upstream release - 3.5.5

* Thu Sep  3 2015 John Eckersberg <eck@redhat.com> - 3.5.4-3
- Fix service restart on package upgrade (RHBZ#1259564)

* Fri Aug  7 2015 John Eckersberg <eck@redhat.com> - 3.5.4-2
- Update logrotate config to use rabbitmqctl rotate_logs (rhbz#1148444)

* Wed Jul 22 2015 John Eckersberg <eck@redhat.com> - 3.5.4-1
- New upstream release - 3.5.4

* Mon Jul 20 2015 John Eckersberg <eck@redhat.com> - 3.5.4-0.1.rc2
- New upstream release candidate 3.5.4 RC2

* Wed Jul 15 2015 John Eckersberg <eck@redhat.com> - 3.5.4-0.1.rc1
- Fix incorrect NVR for pre-release package

* Tue Jul 14 2015 John Eckersberg <eck@redhat.com> - 3.5.4.rc1-1
- New upstream release candidate 3.5.4 RC1

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.5.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri May 22 2015 John Eckersberg <eck@redhat.com> - 3.5.3-1
- New upstream release - 3.5.3

* Tue May 12 2015 John Eckersberg <eck@redhat.com> - 3.5.2-1
- New upstream release - 3.5.2

* Sat Apr  4 2015 John Eckersberg <eck@redhat.com> - 3.5.1-1
- New upstream release - 3.5.1

* Thu Mar 12 2015 John Eckersberg <eck@redhat.com> - 3.5.0-2
- Add requires on erlang-eldap (RHBZ#1192089)

* Wed Mar 11 2015 John Eckersberg <eck@redhat.com> - 3.5.0-1
- New upstream release - 3.5.0

* Wed Feb 11 2015 John Eckersberg <eck@redhat.com> - 3.4.4-1
- New upstream release - 3.4.4

* Mon Jan 19 2015 Richard W.M. Jones <rjones@redhat.com> - 3.4.3-2
- Move /etc/tmpfiles.d/* to /usr/lib/tmpfiles.d/*
  See: https://bugzilla.redhat.com/show_bug.cgi?id=1180990

* Wed Jan  7 2015 John Eckersberg <eck@redhat.com> - 3.4.3-1
- New upstream release - 3.4.3

* Wed Nov 26 2014 John Eckersberg <eck@redhat.com> - 3.4.2-1
- New upstream release - 3.4.2

* Wed Oct 29 2014 John Eckersberg <eck@redhat.com> - 3.4.1-1
- New upstream release - 3.4.1

* Wed Oct 22 2014 John Eckersberg <eck@redhat.com> - 3.4.0-1
- New upstream release - 3.4.0

* Tue Sep 30 2014 John Eckersberg <eck@redhat.com> - 3.3.5-2
- Add rabbitmq-plugins to default path (#1033305)

* Wed Aug 27 2014 John Eckersberg <jeckersb@redhat.com> - 3.3.5-1
- New upstream release - 3.3.5
- Updated systemd notify support patch to match implementation from
  couchdb (Thanks Peter Lemenkov for the much more concise patch!)

* Wed Jul 02 2014 John Eckersberg <jeckersb@redhat.com> - 3.1.5-9
- Add systemd notify support (RHBZ#1103524)

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.5-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Jun 01 2014 Lon Hohberger <lhh@redhat.com> - 3.1.5-7
- Use specific subpackages of erlang instead of the entire
  metapackage (bz1083637)

* Wed Apr 09 2014 Alan Pevec <apevec@redhat.com> - 3.1.5-6
- Fix failure to start on boot on RHEL7 (#1085418)

* Tue Apr  1 2014 Richard W.M. Jones <rjones@redhat.com> - 3.1.5-5
- Fix race in systemd service startup (RHBZ#1059913).

* Mon Mar 31 2014 Richard W.M. Jones <rjones@redhat.com> - 3.1.5-4
- Use ephemeral port (32768 and up instead of 10000+) (RHBZ#998682).

* Thu Mar 27 2014 Lubomir Rintel <lkundrak@v3.sk> - 3.1.5-3
- Do not clobber a file outside the build hierarchy

* Tue Aug 27 2013 Peter Lemenkov <lemenkov@gmail.com> - 3.1.5-2
- Fix permissoon for *.service file (rhbz #1001472)

* Sat Aug 24 2013 Peter Lemenkov <lemenkov@gmail.com> - 3.1.5-1
- New Upstream Release - 3.1.5 (bugfix release)

* Wed Aug 07 2013 Peter Lemenkov <lemenkov@gmail.com> - 3.1.4-1
- New Upstream Release - 3.1.4 (bugfix release)

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Sat Jun 29 2013 Peter Lemenkov <lemenkov@gmail.com> - 3.1.3-1
- New Upstream Release - 3.1.3 (fixes issue bug in the management plugin)

* Tue Jun 25 2013 Peter Lemenkov <lemenkov@gmail.com> - 3.1.2-1
- New Upstream Release - 3.1.2 (works with Erlang R16B01)

* Sun Mar 17 2013 Peter Lemenkov <lemenkov@gmail.com> - 3.0.4-1
- New Upstream Release - 3.0.4

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Tue Oct 02 2012 Peter Lemenkov <lemenkov@gmail.com> - 2.8.7-1
- New Upstream Release - 2.8.7

* Sat Aug 18 2012 Peter Lemenkov <lemenkov@gmail.com> - 2.8.5-1
- New Upstream Release - 2.8.5

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Jul 12 2012 Peter Lemenkov <lemenkov@gmail.com> - 2.8.4-1
- New Upstream Release - 2.8.4

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Nov 08 2011 Peter Lemenkov <lemenkov@gmail.com> - 2.6.1-1
- New Upstream Release - 2.6.1
- Fixed rhbz #738067 (service cannot start - rabbitmq-multi missing)

* Mon Sep 12 2011 Peter Lemenkov <lemenkov@gmail.com> - 2.6.0-1
- New Upstream Release - 2.6.0

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sat Jan 15 2011 Hubert Plociniczak <hubert.plociniczak@gmail.com> 2.2.0-1
- New Upstream Release

* Mon Nov 1 2010 Hubert Plociniczak <hubert.plociniczak@gmail.com> 2.1.1-1
- New Upstream Release

* Tue Oct 5 2010 Hubert Plociniczak <hubert.plociniczak@gmail.com> 2.1.0-1
- New Upstream Release
- Added python as a build dependency

* Mon Aug 23 2010 Mike Bridgen <mikeb@rabbitmq.com> 2.0.0-1
- New Upstream Release

* Mon Jun 28 2010 Hubert Plociniczak <hubert@lshift.net> 1.8.0-1
- New Upstream Release
- Backported fix for bug 22871, fixes issues with erlang >= R14A

* Mon Feb 15 2010 Matthew Sackman <matthew@lshift.net> 1.7.2-1
- New Upstream Release

* Fri Jan 22 2010 Matthew Sackman <matthew@lshift.net> 1.7.1-1
- New Upstream Release

* Mon Oct 5 2009 David Wragg <dpw@lshift.net> 1.7.0-1
- New upstream release

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Jun 17 2009 Matthias Radestock <matthias@lshift.net> 1.6.0-1
- New upstream release

* Tue May 26 2009 Hubert Plociniczak <hubert@lshift.net> 1.5.5-2
- Include dist macro in the release number

* Tue May 19 2009 Matthias Radestock <matthias@lshift.net> 1.5.5-1
- Maintenance release for the 1.5.x series

* Mon Apr 6 2009 Matthias Radestock <matthias@lshift.net> 1.5.4-1
- Maintenance release for the 1.5.x series

* Tue Feb 24 2009 Tony Garnock-Jones <tonyg@lshift.net> 1.5.3-1
- Maintenance release for the 1.5.x series

* Mon Feb 23 2009 Tony Garnock-Jones <tonyg@lshift.net> 1.5.2-1
- Maintenance release for the 1.5.x series

* Mon Jan 19 2009 Ben Hood <0x6e6562@gmail.com> 1.5.1-1
- Maintenance release for the 1.5.x series

* Wed Dec 17 2008 Matthias Radestock <matthias@lshift.net> 1.5.0-1
- New upstream release

* Thu Jul 24 2008 Tony Garnock-Jones <tonyg@lshift.net> 1.4.0-1
- New upstream release

* Mon Mar 3 2008 Adrien Pierard <adrian@lshift.net> 1.3.0-1
- New upstream release

* Wed Sep 26 2007 Simon MacMullen <simon@lshift.net> 1.2.0-1
- New upstream release

* Wed Aug 29 2007 Simon MacMullen <simon@lshift.net> 1.1.1-1
- New upstream release

* Mon Jul 30 2007 Simon MacMullen <simon@lshift.net> 1.1.0-1.alpha
- New upstream release

* Tue Jun 12 2007 Hubert Plociniczak <hubert@lshift.net> 1.0.0-1.20070607
- Building from source tarball, added starting script, stopping

* Mon May 21 2007 Hubert Plociniczak <hubert@lshift.net> 1.0.0-1.alpha
- Initial build of server library of RabbitMQ package