# # spec file for package rabbitmq-server # # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # 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/ # %define _rabbit_erllibdir %{_libdir}/rabbitmq/lib/rabbitmq_server-%{version} %define _rabbit_libdir %{_libdir}/rabbitmq # norootforbuild Name: rabbitmq-server Version: 2.7.1 Release: 1 License: MPL-1.1 Summary: The RabbitMQ Server Url: http://www.rabbitmq.com/ Group: System/Daemons Provides: AMQP-server Requires: erlang, logrotate Requires(post): /sbin/chkconfig Requires(pre): pwdutils /sbin/service Requires(preun): /sbin/chkconfig /sbin/service Requires: %insserv_prereq %fillup_prereq BuildRequires: erlang, python, zip, unzip, libxslt, xmlto %if 0%{?suse_version} < 1110 BuildRequires: python-simplejson %endif %if 0%{?suse_version} > 1020 BuildRequires: fdupes %endif 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-asroot-script-wrapper Source5: rabbitmq-server.sysconfig Source6: rabbitmq-server.rpmlintrc Patch0: no-nmap.patch Patch1: no-remove-common.patch BuildRequires: erlang-src BuildRequires: fdupes BuildRequires: libxslt BuildRequires: python BuildRequires: python-simplejson BuildRequires: unzip BuildRequires: xmlto BuildRequires: zip Requires: erlang Requires: logrotate Requires(pre): %fillup_prereq Requires(pre): %insserv_prereq Requires(pre): pwdutils BuildRoot: %{_tmppath}/%{name}-%{version}-build # 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 License: MPL-1.1 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 License: MPL-1.1 Summary: RabbitMQ AMQP language bindings for Erlang Group: Development/Libraries/Other Requires: erlang %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 %patch0 %patch1 %build make all # %{?_smp_mflags} %install make install \ TARGET_DIR=%{buildroot}%{_rabbit_erllibdir} \ SBIN_DIR=%{buildroot}%{_rabbit_libdir}/bin \ MAN_DIR=%{buildroot}%{_mandir} # Install init scripts install -p -D -m 0755 %{SOURCE1} %{buildroot}%{_initddir}/rabbitmq-server mkdir -p %{buildroot}%{_sbindir} 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 # Install wrapper scripts %define _rabbit_wrapper %{_builddir}/`basename %{SOURCE2}` %define _rabbit_asroot_wrapper %{_builddir}/`basename %{SOURCE4}` cp %{SOURCE2} %{_rabbit_wrapper} sed -i 's|/usr/lib/|%{_libdir}/|' %{_rabbit_wrapper} cp %{SOURCE4} %{_rabbit_asroot_wrapper} sed -i 's|/usr/lib/|%{_libdir}/|' %{_rabbit_asroot_wrapper} 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_wrapper} %{buildroot}%{_sbindir}/rabbitmq-multi install -p -D -m 0755 %{_rabbit_asroot_wrapper} %{buildroot}%{_sbindir}/rabbitmq-activate-plugins install -p -D -m 0755 %{_rabbit_asroot_wrapper} %{buildroot}%{_sbindir}/rabbitmq-deactivate-plugins # 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 # Build the list of files rm -f %{_builddir}/filelist.%{name}.rpm echo '%defattr(-,root,root, -)' >> %{_builddir}/filelist.%{name}.rpm (cd %{buildroot}; \ find . -type f ! -regex '\.%{_sysconfdir}.*' \ ! -regex '\.\(%{_rabbit_erllibdir}\|%{_rabbit_libdir}\).*' \ | sed -e 's/^\.//' >> %{_builddir}/filelist.%{name}.rpm) # Create hardlinks for duplicate files %fdupes %{buildroot} %clean rm -rf %{buildroot} %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 "user for RabbitMQ messaging server" rabbitmq exit 0 %post %fillup_and_insserv rabbitmq-server %preun %stop_on_removal rabbitmq-server %postun %restart_on_update rabbitmq-server %insserv_cleanup %files -f ../filelist.%{name}.rpm %defattr(-,root,root,-) %attr(0750, rabbitmq, rabbitmq) %dir %{_localstatedir}/lib/rabbitmq %attr(0750, rabbitmq, rabbitmq) %dir %{_localstatedir}/log/rabbitmq %dir %{_sysconfdir}/rabbitmq %dir %{_rabbit_libdir} %{_rabbit_libdir}/bin %dir %{_rabbit_libdir}/lib %{_rabbit_erllibdir} %{_initddir}/rabbitmq-server %{_sbindir}/rcrabbitmq-server %config(noreplace) %{_sysconfdir}/logrotate.d/rabbitmq-server %doc LICENSE* README %dir %{_rabbit_erllibdir}/plugins %exclude %{_rabbit_erllibdir}/plugins/* %exclude %{_libdir}/erlang/lib/amqp_client*/* %exclude %{_libdir}/erlang/lib/rabbit_common*/* %files plugins %defattr(-,root,root) %{_rabbit_erllibdir}/plugins/ %files -n erlang-rabbitmq-client %defattr(-,root,root) %{_libdir}/erlang/lib/amqp_client*/ %{_libdir}/erlang/lib/rabbit_common*/ %changelog