Blame rabbitmq-server.spec

Hubert Plociniczak cc9fdf
%define debug_package %{nil}
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
Name: rabbitmq-server
dc263f
Version: 2.8.7
852053
Release: 2%{?dist}
Hubert Plociniczak cc9fdf
License: MPLv1.1
Hubert Plociniczak cc9fdf
Group: Development/Libraries
Hubert Plociniczak cc9fdf
Source: http://www.rabbitmq.com/releases/rabbitmq-server/v%{version}/%{name}-%{version}.tar.gz
Hubert Plociniczak cc9fdf
Source1: rabbitmq-server.init
Hubert Plociniczak cc9fdf
Source2: rabbitmq-script-wrapper
Hubert Plociniczak cc9fdf
Source3: rabbitmq-server.logrotate
Hubert Plociniczak 359031
Source4: rabbitmq-server.ocf
f44ad9
Source5: rabbitmq-server.tmpfiles
c6cfba
Source6: rabbitmq-server.service
Hubert Plociniczak cc9fdf
URL: http://www.rabbitmq.com/
Hubert Plociniczak 7d96b2
BuildArch: noarch
e827fe
BuildRequires: erlang >= R12B-3, python-simplejson, xmlto, libxslt, python, zip
c6cfba
%if 0%{?fedora} > 17
c6cfba
BuildRequires:  systemd-units
c6cfba
%endif
Hubert Plociniczak 7d96b2
Requires: erlang >= R12B-3, logrotate
Hubert Plociniczak cc9fdf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{_arch}-root
Hubert Plociniczak cc9fdf
Summary: The RabbitMQ server
c6cfba
#Requires(post): chkconfig initscripts
c6cfba
#Requires(pre): chkconfig initscripts
c6cfba
#Initscripts
c6cfba
%if 0%{?fedora} > 16
c6cfba
# Users and groups
c6cfba
Requires(pre): shadow-utils
c6cfba
Requires(post): systemd-units
c6cfba
Requires(preun): systemd-units
c6cfba
Requires(postun): systemd-units
c6cfba
%else
c6cfba
Requires(post): chkconfig
c6cfba
Requires(preun):chkconfig
c6cfba
Requires(preun):initscripts
c6cfba
%endif
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
%description
Hubert Plociniczak cc9fdf
RabbitMQ is an implementation of AMQP, the emerging standard for high
Hubert Plociniczak cc9fdf
performance enterprise messaging. The RabbitMQ server is a robust and
Hubert Plociniczak cc9fdf
scalable implementation of an AMQP broker.
Hubert Plociniczak cc9fdf
Hubert Plociniczak 7d96b2
# We want to install into /usr/lib, even on 64-bit platforms
Hubert Plociniczak 7d96b2
%define _rabbit_libdir %{_exec_prefix}/lib/rabbitmq
Hubert Plociniczak 7d96b2
%define _rabbit_erllibdir %{_rabbit_libdir}/lib/rabbitmq_server-%{version}
Hubert Plociniczak cc9fdf
%define _rabbit_wrapper %{_builddir}/`basename %{S:2}`
Hubert Plociniczak 359031
%define _rabbit_server_ocf %{_builddir}/`basename %{S:4}`
hubert 87e711
%define _plugins_state_dir %{_localstatedir}/lib/rabbitmq/plugins
hubert 87e711
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
%define _maindir %{buildroot}%{_rabbit_erllibdir}
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
%prep
Hubert Plociniczak cc9fdf
%setup -q
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
%build
Hubert Plociniczak cc9fdf
cp %{S:2} %{_rabbit_wrapper}
Hubert Plociniczak 359031
cp %{S:4} %{_rabbit_server_ocf}
Hubert Plociniczak 597ff1
make %{?_smp_mflags}
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
%install
Hubert Plociniczak cc9fdf
rm -rf %{buildroot}
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
make install TARGET_DIR=%{_maindir} \
Hubert Plociniczak cc9fdf
             SBIN_DIR=%{buildroot}%{_rabbit_libdir}/bin \
Hubert Plociniczak cc9fdf
             MAN_DIR=%{buildroot}%{_mandir}
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
mkdir -p %{buildroot}%{_localstatedir}/lib/rabbitmq/mnesia
Hubert Plociniczak cc9fdf
mkdir -p %{buildroot}%{_localstatedir}/log/rabbitmq
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
#Copy all necessary lib files etc.
c6cfba
%if 0%{?fedora} > 17
dc263f
install -p -D -m 0755 %{S:6} %{buildroot}%{_unitdir}/%{name}.service
c6cfba
%else
Hubert Plociniczak cc9fdf
install -p -D -m 0755 %{S:1} %{buildroot}%{_initrddir}/rabbitmq-server
c6cfba
%endif
Hubert Plociniczak cc9fdf
install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot}%{_sbindir}/rabbitmqctl
Hubert Plociniczak cc9fdf
install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot}%{_sbindir}/rabbitmq-server
Hubert Plociniczak 7d96b2
install -p -D -m 0755 %{_rabbit_server_ocf} %{buildroot}%{_exec_prefix}/lib/ocf/resource.d/rabbitmq/rabbitmq-server
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
install -p -D -m 0644 %{S:3} %{buildroot}%{_sysconfdir}/logrotate.d/rabbitmq-server
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
mkdir -p %{buildroot}%{_sysconfdir}/rabbitmq
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
rm %{_maindir}/LICENSE %{_maindir}/LICENSE-MPL-RabbitMQ %{_maindir}/INSTALL
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
#Build the list of files
Hubert Plociniczak 7d96b2
rm -f %{_builddir}/%{name}.files
379717
echo '%defattr(-,root,root, -)' >> %{_builddir}/%{name}.files
Hubert Plociniczak cc9fdf
(cd %{buildroot}; \
Hubert Plociniczak cc9fdf
    find . -type f ! -regex '\.%{_sysconfdir}.*' \
Hubert Plociniczak cc9fdf
        ! -regex '\.\(%{_rabbit_erllibdir}\|%{_rabbit_libdir}\).*' \
Hubert Plociniczak 7d96b2
        | sed -e 's/^\.//' >> %{_builddir}/%{name}.files)
Hubert Plociniczak cc9fdf
f44ad9
install -d %{buildroot}%{_localstatedir}/run/rabbitmq
f44ad9
%if 0%{?fedora} > 14
f44ad9
install -D -p -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf
f44ad9
%endif
f44ad9
c6cfba
rm -rf %{buildroot}%{_rabbit_erllibdir}/LICENSE-*
c6cfba
Hubert Plociniczak cc9fdf
%pre
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
if [ $1 -gt 1 ]; then
Hubert Plociniczak 1b1224
  # Upgrade - stop previous instance of rabbitmq-server init.d script
Hubert Plociniczak cc9fdf
  /sbin/service rabbitmq-server stop
Hubert Plociniczak cc9fdf
fi
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
# create rabbitmq group
Hubert Plociniczak cc9fdf
if ! getent group rabbitmq >/dev/null; then
Hubert Plociniczak cc9fdf
        groupadd -r rabbitmq
Hubert Plociniczak cc9fdf
fi
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
# create rabbitmq user
Hubert Plociniczak cc9fdf
if ! getent passwd rabbitmq >/dev/null; then
Hubert Plociniczak cc9fdf
        useradd -r -g rabbitmq -d %{_localstatedir}/lib/rabbitmq rabbitmq \
Hubert Plociniczak cc9fdf
            -c "RabbitMQ messaging server"
Hubert Plociniczak cc9fdf
fi
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
%post
c6cfba
%if 0%{?fedora} > 17
c6cfba
if [ $1 -eq 1 ] ; then
c6cfba
    # Initial installation
c6cfba
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
c6cfba
fi
c6cfba
%else
Hubert Plociniczak cc9fdf
/sbin/chkconfig --add %{name}
c6cfba
%endif
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
%preun
c6cfba
%if 0%{?fedora} > 17
c6cfba
if [ $1 -eq 0 ] ; then
c6cfba
    # Package removal, not upgrade
c6cfba
    /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
c6cfba
    /bin/systemctl stop %{name}.service > /dev/null 2>&1 || :
c6cfba
fi
c6cfba
%else
Hubert Plociniczak cc9fdf
if [ $1 = 0 ]; then
Hubert Plociniczak cc9fdf
  #Complete uninstall
c6cfba
  /sbin/service %{name} stop > /dev/null 2>&1
c6cfba
  /sbin/chkconfig --del %{name}
379717
Hubert Plociniczak cc9fdf
  # We do not remove /var/log and /var/lib directories
Hubert Plociniczak cc9fdf
  # Leave rabbitmq user and group
Hubert Plociniczak cc9fdf
fi
c6cfba
%endif
Hubert Plociniczak cc9fdf
Hubert Plociniczak 7d96b2
# Clean out plugin activation state, both on uninstall and upgrade
hubert 87e711
rm -rf %{_plugins_state_dir}
Hubert Plociniczak 7d96b2
for ext in rel script boot ; do
Hubert Plociniczak 7d96b2
    rm -f %{_rabbit_erllibdir}/ebin/rabbit.$ext
Hubert Plociniczak 7d96b2
done
Hubert Plociniczak 7d96b2
c6cfba
%if 0%{?fedora} > 17
c6cfba
%triggerun -- %{name} < 2.8.4
c6cfba
# Save the current service runlevel info
c6cfba
# User must manually run systemd-sysv-convert --apply opensips
c6cfba
# to migrate them to systemd targets
c6cfba
/usr/bin/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||:
c6cfba
c6cfba
# Run these because the SysV package being removed won't do them
c6cfba
/sbin/chkconfig --del %{name} >/dev/null 2>&1 || :
c6cfba
/bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
c6cfba
%endif
c6cfba
Hubert Plociniczak 7d96b2
%files -f ../%{name}.files
Hubert Plociniczak cc9fdf
%defattr(-,root,root,-)
Hubert Plociniczak cc9fdf
%attr(0750, rabbitmq, rabbitmq) %dir %{_localstatedir}/lib/rabbitmq
Hubert Plociniczak cc9fdf
%attr(0750, rabbitmq, rabbitmq) %dir %{_localstatedir}/log/rabbitmq
Hubert Plociniczak cc9fdf
%dir %{_sysconfdir}/rabbitmq
Hubert Plociniczak cc9fdf
%{_rabbit_erllibdir}
f44ad9
%{_rabbit_libdir}/bin
c6cfba
%if 0%{?fedora} > 17
c6cfba
%{_unitdir}/%{name}.service
c6cfba
%else
c6cfba
%{_initrddir}/%{name}
c6cfba
%endif
Hubert Plociniczak cc9fdf
%config(noreplace) %{_sysconfdir}/logrotate.d/rabbitmq-server
f44ad9
%if 0%{?fedora} > 14
f44ad9
%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf
f44ad9
%endif
f44ad9
%dir %attr(755, rabbitmq, rabbitmq) %{_localstatedir}/run/rabbitmq
c6cfba
%doc LICENSE LICENSE-*
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
%clean
Hubert Plociniczak cc9fdf
rm -rf %{buildroot}
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
%changelog
852053
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.7-2
852053
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
852053
dc263f
* Tue Oct 02 2012 Peter Lemenkov <lemenkov@gmail.com> - 2.8.7-1
dc263f
- New Upstream Release - 2.8.7
dc263f
435586
* Sat Aug 18 2012 Peter Lemenkov <lemenkov@gmail.com> - 2.8.5-1
435586
- New Upstream Release - 2.8.5
435586
0b59af
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.4-2
0b59af
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
0b59af
c6cfba
* Thu Jul 12 2012 Peter Lemenkov <lemenkov@gmail.com> - 2.8.4-1
c6cfba
- New Upstream Release - 2.8.4
c6cfba
24de19
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.1-2
24de19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
24de19
f44ad9
* Tue Nov 08 2011 Peter Lemenkov <lemenkov@gmail.com> - 2.6.1-1
f44ad9
- New Upstream Release - 2.6.1
f44ad9
- Fixed rhbz #738067 (service cannot start - rabbitmq-multi missing)
f44ad9
379717
* Mon Sep 12 2011 Peter Lemenkov <lemenkov@gmail.com> - 2.6.0-1
379717
- New Upstream Release - 2.6.0
379717
063877
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-2
063877
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
063877
Hubert Plociniczak 359031
* Sat Jan 15 2011 Hubert Plociniczak <hubert.plociniczak@gmail.com> 2.2.0-1
Hubert Plociniczak 359031
- New Upstream Release
Hubert Plociniczak 359031
Hubert Plociniczak f810d2
* Mon Nov 1 2010 Hubert Plociniczak <hubert.plociniczak@gmail.com> 2.1.1-1
Hubert Plociniczak f810d2
- New Upstream Release
Hubert Plociniczak f810d2
Hubert Plociniczak 4795a5
* Tue Oct 5 2010 Hubert Plociniczak <hubert.plociniczak@gmail.com> 2.1.0-1
Hubert Plociniczak 4795a5
- New Upstream Release
Hubert Plociniczak 4795a5
- Added python as a build dependency
Hubert Plociniczak 4795a5
hubert 87e711
* Mon Aug 23 2010 Mike Bridgen <mikeb@rabbitmq.com> 2.0.0-1
hubert 87e711
- New Upstream Release
hubert 87e711
Hubert Plociniczak 7d96b2
* Mon Jun 28 2010 Hubert Plociniczak <hubert@lshift.net> 1.8.0-1
Hubert Plociniczak 7d96b2
- New Upstream Release
Hubert Plociniczak 7d96b2
- Backported fix for bug 22871, fixes issues with erlang >= R14A
Hubert Plociniczak 7d96b2
Hubert Plociniczak 1b1224
* Mon Feb 15 2010 Matthew Sackman <matthew@lshift.net> 1.7.2-1
Hubert Plociniczak 1b1224
- New Upstream Release
Hubert Plociniczak 1b1224
Hubert Plociniczak 1b1224
* Fri Jan 22 2010 Matthew Sackman <matthew@lshift.net> 1.7.1-1
Hubert Plociniczak 1b1224
- New Upstream Release
Hubert Plociniczak 1b1224
Hubert Plociniczak 597ff1
* Mon Oct 5 2009 David Wragg <dpw@lshift.net> 1.7.0-1
Hubert Plociniczak 597ff1
- New upstream release
Hubert Plociniczak 597ff1
Jesse Keating aea8b0
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.0-2
Jesse Keating aea8b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
Jesse Keating aea8b0
Hubert Plociniczak 69d917
* Wed Jun 17 2009 Matthias Radestock <matthias@lshift.net> 1.6.0-1
Hubert Plociniczak 69d917
- New upstream release
Hubert Plociniczak 69d917
Hubert Plociniczak 735745
* Tue May 26 2009 Hubert Plociniczak <hubert@lshift.net> 1.5.5-2
Hubert Plociniczak 735745
- Include dist macro in the release number
Hubert Plociniczak 735745
Hubert Plociniczak cc9fdf
* Tue May 19 2009 Matthias Radestock <matthias@lshift.net> 1.5.5-1
Hubert Plociniczak cc9fdf
- Maintenance release for the 1.5.x series
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Mon Apr 6 2009 Matthias Radestock <matthias@lshift.net> 1.5.4-1
Hubert Plociniczak cc9fdf
- Maintenance release for the 1.5.x series
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Tue Feb 24 2009 Tony Garnock-Jones <tonyg@lshift.net> 1.5.3-1
Hubert Plociniczak cc9fdf
- Maintenance release for the 1.5.x series
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Mon Feb 23 2009 Tony Garnock-Jones <tonyg@lshift.net> 1.5.2-1
Hubert Plociniczak cc9fdf
- Maintenance release for the 1.5.x series
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Mon Jan 19 2009 Ben Hood <0x6e6562@gmail.com> 1.5.1-1
Hubert Plociniczak cc9fdf
- Maintenance release for the 1.5.x series
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Wed Dec 17 2008 Matthias Radestock <matthias@lshift.net> 1.5.0-1
Hubert Plociniczak cc9fdf
- New upstream release
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Thu Jul 24 2008 Tony Garnock-Jones <tonyg@lshift.net> 1.4.0-1
Hubert Plociniczak cc9fdf
- New upstream release
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Mon Mar 3 2008 Adrien Pierard <adrian@lshift.net> 1.3.0-1
Hubert Plociniczak cc9fdf
- New upstream release
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Wed Sep 26 2007 Simon MacMullen <simon@lshift.net> 1.2.0-1
Hubert Plociniczak cc9fdf
- New upstream release
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Wed Aug 29 2007 Simon MacMullen <simon@lshift.net> 1.1.1-1
Hubert Plociniczak cc9fdf
- New upstream release
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Mon Jul 30 2007 Simon MacMullen <simon@lshift.net> 1.1.0-1.alpha
Hubert Plociniczak cc9fdf
- New upstream release
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Tue Jun 12 2007 Hubert Plociniczak <hubert@lshift.net> 1.0.0-1.20070607
Hubert Plociniczak cc9fdf
- Building from source tarball, added starting script, stopping
Hubert Plociniczak cc9fdf
Hubert Plociniczak cc9fdf
* Mon May 21 2007 Hubert Plociniczak <hubert@lshift.net> 1.0.0-1.alpha
Hubert Plociniczak cc9fdf
- Initial build of server library of RabbitMQ package