Blob Blame History Raw
Name: rabbitmq-server
Version: 3.1.5
Release: 5%{?dist}
License: MPLv1.1
Group: Development/Libraries
Source: http://www.rabbitmq.com/releases/rabbitmq-server/v%{version}/%{name}-%{version}.tar.gz
Source1: rabbitmq-server.init
Source2: rabbitmq-script-wrapper
Source3: rabbitmq-server.logrotate
Source4: rabbitmq-server.ocf
Source5: rabbitmq-server.tmpfiles
Source6: rabbitmq-server.service
URL: http://www.rabbitmq.com/
BuildArch: noarch
BuildRequires: erlang >= R12B-3, python-simplejson, xmlto, libxslt, python, zip
%if 0%{?fedora}
BuildRequires:  systemd
%endif
Requires: erlang >= R12B-3, logrotate
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{_arch}-root
Summary: The RabbitMQ server
# Users and groups
Requires(pre): shadow-utils
#Requires(post): chkconfig initscripts
#Requires(pre): chkconfig initscripts
#Initscripts
%if 0%{?fedora}
Requires(pre): systemd
Requires(post): systemd
Requires(preun): systemd
%else
Requires(pre): initscripts
Requires(post): chkconfig
Requires(preun):chkconfig
Requires(preun):initscripts
%endif

# https://bugzilla.redhat.com/show_bug.cgi?id=998682
# https://bugzilla.redhat.com/show_bug.cgi?id=1032595#c8
Patch0: rabbitmq-probe-ephemeral-port.patch

%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.

# We want to install into /usr/lib, even on 64-bit platforms
%global _rabbit_libdir %{_exec_prefix}/lib/rabbitmq
%global _rabbit_erllibdir %{_rabbit_libdir}/lib/rabbitmq_server-%{version}
%global _rabbit_wrapper %{_builddir}/%{buildsubdir}/`basename %{S:2}`
%global _rabbit_server_ocf %{_builddir}/%{buildsubdir}/`basename %{S:4}`
%global _plugins_state_dir %{_localstatedir}/lib/rabbitmq/plugins


%global _maindir %{buildroot}%{_rabbit_erllibdir}

%prep
%setup -q
%patch0 -p1

%build
cp %{S:2} %{_rabbit_wrapper}
cp %{S:4} %{_rabbit_server_ocf}
#USE_SPECS="true" USE_PROPER_QC="false" make %{?_smp_mflags}
make %{?_smp_mflags}

%install
rm -rf %{buildroot}

make install TARGET_DIR=%{_maindir} \
             SBIN_DIR=%{buildroot}%{_rabbit_libdir}/bin \
             MAN_DIR=%{buildroot}%{_mandir}

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

#Copy all necessary lib files etc.
%if 0%{?el5}%{?el6}
install -p -D -m 0755 %{S:1} %{buildroot}%{_initrddir}/rabbitmq-server
%else
install -p -D -m 0644 %{S:6} %{buildroot}%{_unitdir}/%{name}.service
%endif
install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot}%{_sbindir}/rabbitmqctl
install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot}%{_sbindir}/rabbitmq-server
install -p -D -m 0755 %{_rabbit_server_ocf} %{buildroot}%{_exec_prefix}/lib/ocf/resource.d/rabbitmq/rabbitmq-server

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

mkdir -p %{buildroot}%{_sysconfdir}/rabbitmq

rm %{_maindir}/LICENSE %{_maindir}/LICENSE-MPL-RabbitMQ %{_maindir}/INSTALL

#Build the list of files
rm -f %{_builddir}/%{buildsubdir}/%{name}.files
echo '%defattr(-,root,root, -)' >> %{_builddir}/%{buildsubdir}/%{name}.files
(cd %{buildroot}; \
    find . -type f ! -regex '\.%{_sysconfdir}.*' \
        ! -regex '\.\(%{_rabbit_erllibdir}\|%{_rabbit_libdir}\).*' \
        | sed -e 's/^\.//' >> %{_builddir}/%{buildsubdir}/%{name}.files)

install -d %{buildroot}%{_localstatedir}/run/rabbitmq
%if 0%{?fedora} > 14
install -D -p -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf
%endif

rm -rf %{buildroot}%{_rabbit_erllibdir}/LICENSE-*

%pre

if [ $1 -gt 1 ]; then
  # Upgrade - stop previous instance of rabbitmq-server
%if 0%{?el5}%{?el6}
  /sbin/service rabbitmq-server stop
%else
  systemctl stop %{name}.service
%endif
fi

# 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 \
            -c "RabbitMQ messaging server"
fi

%post
%if 0%{?el5}%{?el6}
/sbin/chkconfig --add %{name}
%else
%systemd_post %{name}.service
%endif

%preun
# We do not remove /var/log and /var/lib directories
# Leave rabbitmq user and group
%if 0%{?el5}%{?el6}
if [ $1 = 0 ]; then
  #Complete uninstall
  /sbin/service %{name} stop > /dev/null 2>&1
  /sbin/chkconfig --del %{name}
fi
%else
%systemd_preun %{name}.service
%endif

# Clean out plugin activation state, both on uninstall and upgrade
rm -rf %{_plugins_state_dir}
for ext in rel script boot ; do
    rm -f %{_rabbit_erllibdir}/ebin/rabbit.$ext
done

%if 0%{?fedora} > 17
%triggerun -- %{name} < 2.8.4
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply opensips
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||:

# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del %{name} >/dev/null 2>&1 || :
/bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
%endif

%files -f %{name}.files
%attr(0750, rabbitmq, rabbitmq) %dir %{_localstatedir}/lib/rabbitmq
%attr(0750, rabbitmq, rabbitmq) %dir %{_localstatedir}/log/rabbitmq
%dir %{_sysconfdir}/rabbitmq
%{_rabbit_erllibdir}
%{_rabbit_libdir}/bin
%if 0%{?el5}%{?el6}
%{_initrddir}/%{name}
%else
%{_unitdir}/%{name}.service
%endif
%config(noreplace) %{_sysconfdir}/logrotate.d/rabbitmq-server
%if 0%{?fedora}
%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf
%endif
%dir %attr(755, rabbitmq, rabbitmq) %{_localstatedir}/run/rabbitmq
%doc LICENSE LICENSE-*

%clean
rm -rf %{buildroot}

%changelog
* 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