Accepting request 913862 from home:fusionfuture:branches:network:messaging:amqp
- Separate autocomplete files into individual packages. OBS-URL: https://build.opensuse.org/request/show/913862 OBS-URL: https://build.opensuse.org/package/show/network:messaging:amqp/rabbitmq-server?expand=0&rev=167
This commit is contained in:
parent
9718db1b4a
commit
9b4e48e9d8
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 23 14:20:39 UTC 2021 - Fusion Future <qydwhotmail@gmail.com>
|
||||
|
||||
- Separate autocomplete files into individual packages.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Aug 22 01:05:26 UTC 2021 - Fusion Future <qydwhotmail@gmail.com>
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
%define _rabbit_server_ocf scripts/rabbitmq-server.ocf
|
||||
%define _plugins_state_dir %{_localstatedir}/lib/rabbitmq/plugins
|
||||
%define _rabbit_server_ha_ocf scripts/rabbitmq-server-ha.ocf
|
||||
%define _rabbitmqctl_autocomplete scripts/rabbitmqctl-autocomplete.sh
|
||||
%define _rabbitmqctl_autocomplete scripts/bash_autocomplete.sh
|
||||
%define _rabbitmq_user rabbitmq
|
||||
%define _rabbitmq_group rabbitmq
|
||||
|
||||
@ -43,7 +43,7 @@ Name: rabbitmq-server
|
||||
Version: 3.9.4
|
||||
Release: 0
|
||||
Summary: A message broker supporting AMQP, STOMP and MQTT
|
||||
License: MPLv2.0
|
||||
License: MPL-2.0
|
||||
Group: System/Daemons
|
||||
URL: http://www.rabbitmq.com/
|
||||
Source: https://github.com/rabbitmq/rabbitmq-server/releases/download/v%{version}/rabbitmq-server-%{version}.tar.xz
|
||||
@ -105,6 +105,28 @@ standard for messaging.
|
||||
|
||||
This package includes the RabbitMQ AMQP language bindings for Erlang.
|
||||
|
||||
%package bash-completion
|
||||
Summary: Bash completion for %{name}
|
||||
Group: System/Shells
|
||||
Requires: %{name} = %{version}
|
||||
Requires: bash-completion
|
||||
Supplements: (%{name} and bash-completion)
|
||||
BuildArch: noarch
|
||||
|
||||
%description bash-completion
|
||||
Optional dependency offering bash completion for %{name}.
|
||||
|
||||
%package zsh-completion
|
||||
Summary: Zsh completion for %{name}
|
||||
Group: System/Shells
|
||||
Requires: %{name} = %{version}
|
||||
Requires: zsh
|
||||
Supplements: (%{name} and zsh)
|
||||
BuildArch: noarch
|
||||
|
||||
%description zsh-completion
|
||||
Optional dependency offering zsh completion for %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
cp %{SOURCE8} .
|
||||
@ -130,13 +152,12 @@ sed -i 's/\/var//' %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf
|
||||
|
||||
# Install wrapper scripts
|
||||
sed \
|
||||
-e 's|@RABBITMQ_USER@|%{_rabbitmq_user}|' -e 's|@RABBITMQ_GROUP@|%{_rabbitmq_group}|' \
|
||||
< scripts/rabbitmq-script-wrapper \
|
||||
> %{buildroot}%{_sbindir}/rabbitmqctl
|
||||
-e 's|@RABBITMQ_USER@|%{_rabbitmq_user}|' -e 's|@RABBITMQ_GROUP@|%{_rabbitmq_group}|' \
|
||||
< scripts/rabbitmq-script-wrapper \
|
||||
> %{buildroot}%{_sbindir}/rabbitmqctl
|
||||
chmod 0755 %{buildroot}%{_sbindir}/rabbitmqctl
|
||||
for script in rabbitmq-server rabbitmq-plugins rabbitmq-diagnostics rabbitmq-queues rabbitmq-upgrade rabbitmq-streams; do \
|
||||
cp -a %{buildroot}%{_sbindir}/rabbitmqctl \
|
||||
%{buildroot}%{_sbindir}/$script; \
|
||||
cp -a %{buildroot}%{_sbindir}/rabbitmqctl %{buildroot}%{_sbindir}/$script
|
||||
done
|
||||
|
||||
install -p -D -m 0755 %{_rabbit_server_ocf} %{buildroot}%{_exec_prefix}/lib/ocf/resource.d/rabbitmq/rabbitmq-server
|
||||
@ -152,13 +173,15 @@ install -p -D -m 0644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/rabbitmq/rabbitmq-e
|
||||
install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/rabbitmq-server
|
||||
|
||||
# Install autocomplete scripts
|
||||
install -p -D -m 0644 %{_rabbitmqctl_autocomplete} %{buildroot}%{_sysconfdir}/profile.d/rabbitmqctl-autocomplete.sh
|
||||
install -p -D -m 0644 scripts/zsh_autocomplete.sh %{buildroot}%{_datarootdir}/zsh/site-functions/_enable_rabbitmqctl_completion
|
||||
for script in rabbitmqctl rabbitmq-plugins rabbitmq-diagnostics; do
|
||||
install -p -D -m 0644 %{_rabbitmqctl_autocomplete} %{buildroot}%{_datadir}/bash-completion/completions/$script
|
||||
done
|
||||
install -p -D -m 0644 scripts/zsh_autocomplete.sh %{buildroot}%{_datadir}/zsh/site-functions/_enable_rabbitmqctl_completion
|
||||
|
||||
# Install Erlang client
|
||||
mkdir -p %{buildroot}%{_libdir}/erlang/lib
|
||||
for i in amqp_client rabbit_common ; do
|
||||
cp -r %{buildroot}%{_rabbit_erllibdir}/plugins/$i* -d %{buildroot}%{_libdir}/erlang/lib/
|
||||
cp -r %{buildroot}%{_rabbit_erllibdir}/plugins/$i* -d %{buildroot}%{_libdir}/erlang/lib/
|
||||
done
|
||||
|
||||
# Create other necessary directories for RabbitMQ server
|
||||
@ -167,8 +190,9 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/rabbitmq/mnesia
|
||||
mkdir -p %{buildroot}%{_localstatedir}/log/rabbitmq
|
||||
|
||||
# Create hardlinks for duplicate files
|
||||
%fdupes %{buildroot}/%{_datarootdir}
|
||||
%fdupes %{buildroot}/%{_datadir}
|
||||
%fdupes %{buildroot}/%{_libdir}
|
||||
%fdupes %{buildroot}/%{_sbindir}
|
||||
|
||||
%pre
|
||||
getent group %{_rabbitmq_group} >/dev/null || groupadd -r %{_rabbitmq_group}
|
||||
@ -182,12 +206,6 @@ getent passwd %{_rabbitmq_user} >/dev/null || useradd -r -g %{_rabbitmq_group} \
|
||||
%service_add_post %{name}.service
|
||||
systemd-tmpfiles --create --clean /usr/lib/tmpfiles.d/rabbitmq-server.conf
|
||||
|
||||
if [ -n "$ZSH_VERSION" ]; then
|
||||
echo "Z Shell detected.
|
||||
to enable rabbitmqctl autocompletion add the following to your .zshrc file:
|
||||
autoload _enable_rabbitmqctl_completion; _enable_rabbitmqctl_completion"
|
||||
fi
|
||||
|
||||
%preun
|
||||
# Clean out plugin activation state, both on uninstall and upgrade
|
||||
rm -rf %{_plugins_state_dir}
|
||||
@ -224,9 +242,6 @@ done
|
||||
%{_sbindir}/rabbitmq-diagnostics
|
||||
%{_sbindir}/rabbitmq-streams
|
||||
|
||||
%{_sysconfdir}/profile.d/rabbitmqctl-autocomplete.sh
|
||||
%{_datarootdir}/zsh/site-functions/_enable_rabbitmqctl_completion
|
||||
|
||||
%ghost %dir /run/rabbitmq
|
||||
#
|
||||
%dir /usr/lib/ocf/
|
||||
@ -245,4 +260,10 @@ done
|
||||
%{_libdir}/erlang/lib/amqp_client*/
|
||||
%{_libdir}/erlang/lib/rabbit_common*/
|
||||
|
||||
%files bash-completion
|
||||
%{_datadir}/bash-completion/completions/rabbitmq*
|
||||
|
||||
%files zsh-completion
|
||||
%{_datadir}/zsh/site-functions/_enable_rabbitmqctl_completion
|
||||
|
||||
%changelog
|
||||
|
Loading…
Reference in New Issue
Block a user