2012-01-26 16:50:48 +01:00
#
# spec file for package rabbitmq-server
#
2017-02-06 16:30:49 +01:00
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
2012-01-26 16:50:48 +01:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
2017-04-05 13:33:01 +02:00
2017-03-01 22:44:48 +01:00
%bcond_without split_plugins
2012-04-13 09:33:03 +02:00
2012-01-26 16:50:48 +01:00
%define _rabbit_erllibdir %{_libdir}/rabbitmq/lib/rabbitmq_server-%{version}
%define _rabbit_libdir %{_libdir}/rabbitmq
2012-04-13 09:33:03 +02:00
%if %{undefined _initddir}
%define _initddir %{_sysconfdir}/init.d
%endif
2017-02-13 13:36:52 +01:00
%define _make_args DESTDIR="%{buildroot}" PREFIX="%{_prefix}" RMQ_ROOTDIR=%{_rabbit_libdir} RMQ_ERLAPP_DIR=%{_rabbit_erllibdir} MAN_INSTALL_PATH="%{_mandir}" DOC_INSTALL_DIR=%{buildroot}/%{_docdir} VERSION=%{version} V=1
2012-01-26 16:50:48 +01:00
Name : rabbitmq-server
2017-02-13 13:36:52 +01:00
Version : 3.6.6
2012-02-14 12:34:45 +01:00
Release : 0
2012-01-26 16:50:48 +01:00
Summary : The RabbitMQ Server
2012-04-13 09:33:03 +02:00
License : MPL-1.1
2012-01-26 16:50:48 +01:00
Group : System/Daemons
2012-04-13 09:33:03 +02:00
Url : http://www.rabbitmq.com/
2017-02-13 13:36:52 +01:00
Source : http://www.rabbitmq.com/releases/rabbitmq-server/v%{version} /rabbitmq-server-%{version} .tar.xz
2012-01-26 16:50:48 +01:00
Source1 : rabbitmq-server.init
2012-12-14 14:33:31 +01:00
# This comes from: http://hg.rabbitmq.com/rabbitmq-server/raw-file/2da625c0a436/packaging/common/rabbitmq-script-wrapper
2012-01-26 16:50:48 +01:00
Source2 : rabbitmq-script-wrapper
Source3 : rabbitmq-server.logrotate
2017-04-05 13:33:01 +02:00
Source4 : rabbitmq-env.conf
2012-01-26 16:50:48 +01:00
Source5 : rabbitmq-server.sysconfig
2013-04-04 11:48:47 +02:00
Source6 : rabbitmq-server.service
2013-04-25 11:45:59 +02:00
Source7 : rabbitmq-server.tmpfiles.d.conf
2017-02-06 17:06:05 +01:00
Source8 : README.SUSE
2017-02-13 13:36:52 +01:00
Source9 : rabbitmq.config.example
2017-04-05 13:33:01 +02:00
# PATCH-FIX-UPSTREAM pull-request-20.patch https://github.com/rabbitmq/rabbitmq-server-release/pull/20 -- minor fixes to rabbitmq-server.ocf
Patch0 : pull-request-20.patch
# PATCH-FIX-UPSTREAM pull-request-21.patch https://github.com/rabbitmq/rabbitmq-server-release/pull/21 -- ulimit improvements for ocf files
Patch1 : pull-request-21.patch
# PATCH-FIX-UPSTREAM pull-request-24.patch https://github.com/rabbitmq/rabbitmq-server-release/pull/24 -- allow specifying vhost to use in rabbitmq-server-ha.ocf
Patch2 : pull-request-24.patch
# PATCH-FIX-UPSTREAM pull-request-25.patch https://github.com/rabbitmq/rabbitmq-server-release/pull/25 -- fix rabbitmq-server-ha.ocf to not hardcode resource name
Patch3 : pull-request-25.patch
2012-02-14 12:34:45 +01:00
BuildRequires : erlang
2012-01-26 16:50:48 +01:00
BuildRequires : erlang-src
BuildRequires : fdupes
BuildRequires : libxslt
2012-04-13 09:33:03 +02:00
# require python json module
BuildRequires : python >= 2.6
2013-07-03 17:28:58 +02:00
BuildRequires : python-xml
2017-02-13 13:36:52 +01:00
BuildRequires : rsync
2012-01-26 16:50:48 +01:00
BuildRequires : unzip
BuildRequires : xmlto
2017-02-13 13:36:52 +01:00
BuildRequires : xz
2017-03-01 22:44:48 +01:00
BuildRequires : zip
2012-01-26 16:50:48 +01:00
Requires : erlang
2017-02-06 17:06:05 +01:00
Requires : erlang-epmd
2012-01-26 16:50:48 +01:00
Requires : logrotate
2012-02-14 12:34:45 +01:00
Provides : AMQP-server
BuildRoot : %{_tmppath} /%{name} -%{version} -build
Requires(pre) : pwdutils
2012-01-26 16:50:48 +01:00
Requires(pre) : %fillup_prereq
Requires(pre) : %insserv_prereq
2013-04-04 11:48:47 +02:00
%if 0%{?suse_version} > 1140
BuildRequires : systemd
2015-06-25 14:20:14 +02:00
%{?systemd_requires}
%define have_systemd 1
Requires : erlang-sd_notify
2014-07-21 17:25:42 +02:00
%else
Requires : %fillup_prereq
Requires : %insserv_prereq
2013-04-04 11:48:47 +02:00
%endif
2012-01-26 16:50:48 +01:00
# Do not use noarch since the Erlang packaging does not really allow that
#BuildArch: noarch
%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.
%package plugins
Summary : Plugins for the RabbitMQ server
Group : System/Daemons
Requires : rabbitmq-server = %{version}
%description plugins
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.
This package includes some plugins for the RabbitMQ server
%package -n erlang-rabbitmq-client
Summary : RabbitMQ AMQP language bindings for Erlang
Group : Development/Libraries/Other
Requires : erlang
2014-01-07 20:37:54 +01:00
Provides : erlang-gen_server2 = %{version}
2012-01-26 16:50:48 +01:00
%description -n erlang-rabbitmq-client
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.
This package includes the RabbitMQ AMQP language bindings for Erlang.
%prep
%setup -q
2017-02-06 17:06:05 +01:00
cp %{SOURCE8} .
2017-04-05 13:33:01 +02:00
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
2012-01-26 16:50:48 +01:00
%build
2017-02-13 13:36:52 +01:00
make all %{_make_args} %{?_smp_mflags}
2012-01-26 16:50:48 +01:00
%install
2017-02-13 13:36:52 +01:00
make install %{_make_args}
2012-01-26 16:50:48 +01:00
2015-04-12 08:02:03 +02:00
mkdir -p %{buildroot} %{_sbindir}
2014-04-30 02:08:45 +02:00
%if 0%{?have_systemd}
install -p -D -m 644 %{SOURCE6} %{buildroot} %{_unitdir} /%{name} .service
2015-04-12 08:02:03 +02:00
ln -s -f %{_sbindir} /service %{buildroot} %{_sbindir} /rc%{name}
2017-02-13 13:36:52 +01:00
install -p -D -m 0644 %{SOURCE7} %{buildroot} /usr/lib/tmpfiles.d/rabbitmq-server.conf
2014-04-30 02:08:45 +02:00
%else
2012-01-26 16:50:48 +01:00
# Install init scripts
install -p -D -m 0755 %{SOURCE1} %{buildroot} %{_initddir} /rabbitmq-server
ln -sf %{_initddir} /rabbitmq-server %{buildroot} %{_sbindir} /rcrabbitmq-server
mkdir -p %{buildroot} %{_localstatedir} /adm/fillup-templates/
install -p -D -m 644 %{SOURCE5} %{buildroot} %{_localstatedir} /adm/fillup-templates/sysconfig.rabbitmq-server
2013-04-04 11:48:47 +02:00
%endif
2012-01-26 16:50:48 +01:00
# Install wrapper scripts
%define _rabbit_wrapper %{_builddir}/`basename %{SOURCE2}`
cp %{SOURCE2} %{_rabbit_wrapper}
2012-05-12 15:40:19 +02:00
sed -i 's|@SU_RABBITMQ_SH_C@|su rabbitmq -s /bin/sh -c|' %{_rabbit_wrapper}
2017-02-13 13:36:52 +01:00
sed -i 's|@RABBITMQ_ROOT@|%{_rabbit_erllibdir}/|' %{_rabbit_wrapper}
2012-01-26 16:50:48 +01:00
install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot} %{_sbindir} /rabbitmqctl
install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot} %{_sbindir} /rabbitmq-server
2012-05-12 15:40:19 +02:00
install -p -D -m 0755 %{_rabbit_wrapper} %{buildroot} %{_sbindir} /rabbitmq-plugins
2017-04-05 13:33:01 +02:00
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
2012-01-26 16:50:48 +01:00
2014-01-23 13:29:49 +01:00
# install config files
2017-02-13 13:36:52 +01:00
install -p -D -m 0644 %{SOURCE9} %{buildroot} /%{_sysconfdir} /rabbitmq/rabbitmq.config
2017-04-05 13:33:01 +02:00
install -p -D -m 0644 %{SOURCE4} %{buildroot} /%{_sysconfdir} /rabbitmq/rabbitmq-env.conf
2014-01-23 13:29:49 +01:00
2012-01-26 16:50:48 +01:00
# Copy all necessary lib files etc.
install -p -D -m 0644 %{SOURCE3} %{buildroot} %{_sysconfdir} /logrotate.d/rabbitmq-server
# Install Erlang client
mkdir -p %{buildroot} %{_libdir} /erlang/lib
for i in amqp_client rabbit_common ; do
unzip %{buildroot} %{_rabbit_erllibdir} /plugins/$i*.ez -d %{buildroot} %{_libdir} /erlang/lib
done
# Create other necessary directories for RabbitMQ server
mkdir -p %{buildroot} %{_sysconfdir} /rabbitmq
mkdir -p %{buildroot} %{_localstatedir} /lib/rabbitmq/mnesia
mkdir -p %{buildroot} %{_localstatedir} /log/rabbitmq
# Create hardlinks for duplicate files
2014-01-23 13:29:49 +01:00
%fdupes %{buildroot} /usr/share
2012-01-26 16:50:48 +01:00
%pre
getent group rabbitmq >/dev/null || groupadd -r rabbitmq
getent passwd rabbitmq >/dev/null || useradd -r -g rabbitmq \
-d %{_localstatedir} /lib/rabbitmq \
-s /sbin/nologin \
-c " u s e r f o r R a b b i t M Q m e s s a g i n g s e r v e r " rabbitmq
2013-04-04 11:48:47 +02:00
%if 0%{?have_systemd}
%service_add_pre %{name} .service
%endif
2012-01-26 16:50:48 +01:00
%post
2013-04-04 11:48:47 +02:00
%if 0%{?have_systemd}
%service_add_post %{name} .service
2013-04-25 11:45:59 +02:00
systemd-tmpfiles --create --clean /usr/lib/tmpfiles.d/rabbitmq-server.conf
2014-04-30 02:08:45 +02:00
%else
%fillup_and_insserv rabbitmq-server
2013-04-04 11:48:47 +02:00
%endif
2012-01-26 16:50:48 +01:00
%preun
2013-04-04 11:48:47 +02:00
%if 0%{?have_systemd}
%service_del_preun %{name} .service
2014-04-30 02:08:45 +02:00
%else
2015-01-21 17:50:54 +01:00
%stop_on_removal rabbitmq-server
2013-04-04 11:48:47 +02:00
%endif
2012-01-26 16:50:48 +01:00
%postun
2013-04-04 11:48:47 +02:00
%if 0%{?have_systemd}
%service_del_postun %{name} .service
2014-04-30 02:08:45 +02:00
%else
%restart_on_update rabbitmq-server
%insserv_cleanup
2013-04-04 11:48:47 +02:00
%endif
2012-01-26 16:50:48 +01:00
2017-03-01 22:44:48 +01:00
%files
2012-01-26 16:50:48 +01:00
%defattr (-,root,root,-)
2017-03-01 22:44:48 +01:00
%config (noreplace) %{_sysconfdir} /logrotate.d/rabbitmq-server
%config (noreplace) %{_sysconfdir} /rabbitmq/
%{_rabbit_libdir}
%if %{with split_plugins}
%exclude %{_rabbit_erllibdir} /plugins/rabbitmq_*
%endif
#
2013-04-04 11:48:47 +02:00
%if 0%{?have_systemd}
%{_unitdir} /%{name} .service
2013-04-25 11:45:59 +02:00
/usr/lib/tmpfiles.d/rabbitmq-server.conf
2014-04-30 02:08:45 +02:00
%else
%{_initddir} /rabbitmq-server
2017-03-01 22:44:48 +01:00
%dir %attr (0755, rabbitmq, rabbitmq) %{_localstatedir} /run/rabbitmq
2013-04-04 11:48:47 +02:00
%endif
2017-03-01 22:44:48 +01:00
#
%attr (0750, rabbitmq, rabbitmq) %dir %{_localstatedir} /lib/rabbitmq
%attr (0750, rabbitmq, rabbitmq) %dir %{_localstatedir} /log/rabbitmq
#
%{_sbindir} /rabbitmq-plugins
%{_sbindir} /rabbitmq-server
%{_sbindir} /rabbitmqctl
2015-04-12 08:02:03 +02:00
%{_sbindir} /rcrabbitmq-server
2017-03-01 22:44:48 +01:00
#
%dir /usr/lib/ocf/
%dir /usr/lib/ocf/resource.d/
/usr/lib/ocf/resource.d/rabbitmq/
#
2017-02-13 13:36:52 +01:00
%doc LICENSE* README* CODE_OF_CONDUCT.md CONTRIBUTING.md
2012-01-26 16:50:48 +01:00
2017-03-01 22:44:48 +01:00
%if %{with split_plugins}
2012-01-26 16:50:48 +01:00
%files plugins
%defattr (-,root,root)
2017-03-01 22:44:48 +01:00
%{_rabbit_erllibdir} /plugins/rabbitmq_*
%endif
2012-01-26 16:50:48 +01:00
%files -n erlang-rabbitmq-client
%defattr (-,root,root)
%{_libdir} /erlang/lib/amqp_client*/
%{_libdir} /erlang/lib/rabbit_common*/
%changelog