Accepting request 649814 from home:ojkastl_buildservice:Branch_Virtualization_vagrant

fix bash_completion warning on Factory; link directories from /usr/share/vagrant/ to /usr/lib64/ruby/gems/2.5.0/gems/x.y.z/, to avoid ruby errors due to patch 0007

OBS-URL: https://build.opensuse.org/request/show/649814
OBS-URL: https://build.opensuse.org/package/show/Virtualization:vagrant/vagrant?expand=0&rev=18
This commit is contained in:
Johannes Kastl 2018-11-17 19:28:51 +00:00 committed by Git OBS Bridge
parent 4cdf759238
commit efff136526
2 changed files with 29 additions and 4 deletions

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Fri Nov 9 20:24:19 UTC 2018 - Johannes Kastl <kastl@b1-systems.de>
- link directories from /usr/share/vagrant/ to /usr/lib64/ruby/gems/2.5.0/gems/x.y.z/, to avoid ruby errors due to patch 0007
-------------------------------------------------------------------
Fri Nov 9 20:19:31 UTC 2018 - Johannes Kastl <kastl@b1-systems.de>
- add Requires and BuildRequires for bash-completion to the vagrant-bash-completion subpackage
- move bash-completion file to %{_datadir}/bash-completion/completions/ to avoid warnings
-------------------------------------------------------------------
Fri Nov 9 14:35:42 UTC 2018 - Johannes Kastl <kastl@b1-systems.de>

View File

@ -174,8 +174,10 @@ Summary: Vagrant bash autocompletion
Group: Development/Languages/Ruby
Supplements: packageand(vagrant:bash)
BuildRequires: bash
BuildRequires: bash-completion
Requires: vagrant = %{version}
Requires: bash
Requires: bash-completion
BuildArch: noarch
%description bash-completion
@ -186,10 +188,7 @@ Optional dependency offering bash completion for vagrant
%patch2 -p1
%patch3 -p1
%patch4 -p1
# apply patch on tumbleweed only
%if %suse_version >= 1550
%patch7 -p1
%endif
%patch9 -p1
#
#
@ -258,6 +257,21 @@ sed -i '1 s/^.*$/#!\/bin\/bash/' %{buildroot}%{gem_base}/gems/%{mod_full_name}/.
# change shebang in /etc/bash_completion.d/vagrant.sh
sed -i '1d' %{buildroot}%{_sysconfdir}/bash_completion.d/%{mod_name}.sh
# move file to %{_datadir}/bash-completion/completions/ to avoid warnings
install -d 755 %{buildroot}%{_datadir}/bash-completion/completions/
mv -v %{buildroot}%{_sysconfdir}/bash_completion.d/%{mod_name}.sh %{buildroot}%{_datadir}/bash-completion/completions/
%post
# link directories to avoid the following error:
# /usr/lib64/ruby/2.5.0/pathname.rb:444:in `open': No such file or directory @ dir_initialize - /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.2/plugins (Errno::ENOENT)
ln -s %{_datadir}/%{name}/keys %{gem_base}/gems/%{mod_full_name}/keys
ln -s %{_datadir}/%{name}/plugins %{gem_base}/gems/%{mod_full_name}/plugins
ln -s %{_datadir}/%{name}/templates %{gem_base}/gems/%{mod_full_name}/templates
%postun
rm -f %{gem_base}/gems/%{mod_full_name}/keys
rm -f %{gem_base}/gems/%{mod_full_name}/plugins
rm -f %{gem_base}/gems/%{mod_full_name}/templates
%files
%defattr(-,root,root,-)
@ -283,6 +297,6 @@ sed -i '1d' %{buildroot}%{_sysconfdir}/bash_completion.d/%{mod_name}.sh
%files bash-completion
%defattr(-,root,root,-)
%config %{_sysconfdir}/bash_completion.d/%{mod_name}.sh
%{_datadir}/bash-completion/completions/%{mod_name}.sh
%changelog