- move update-alternative usage to main package

OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby?expand=0&rev=67
This commit is contained in:
Stephan Kulow 2014-01-06 08:27:21 +00:00 committed by Git OBS Bridge
parent 20f847f4ae
commit 83bf421106
2 changed files with 6 additions and 37 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Jan 6 08:25:55 UTC 2014 - coolo@suse.com
- move update-alternative usage to main package
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Aug 19 11:15:25 UTC 2013 - jmassaguerpla@suse.com Mon Aug 19 11:15:25 UTC 2013 - jmassaguerpla@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package ruby # spec file for package ruby
# #
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -35,7 +35,6 @@ BuildRequires: update-alternatives
%requires_ge ruby20 %requires_ge ruby20
Provides: rubygems = 1.8.15 Provides: rubygems = 1.8.15
Obsoletes: rubygems < 1.8.15 Obsoletes: rubygems < 1.8.15
Requires: update-alternatives
%{expand:%(rpm -ql ruby20 | fgrep .gemspec | /usr/bin/ruby2.0 /usr/lib/rpm/rubygemsdeps.rb --provides | sed -e 's,^,Provides:,')} %{expand:%(rpm -ql ruby20 | fgrep .gemspec | /usr/bin/ruby2.0 /usr/lib/rpm/rubygemsdeps.rb --provides | sed -e 's,^,Provides:,')}
@ -83,50 +82,15 @@ Development files to link against Ruby.
%build %build
%install %install
mkdir -p %{buildroot}%_bindir %{buildroot}%{_sysconfdir}/alternatives
for bin in erb gem irb rake rdoc ri ruby testrb; do
# dummy
touch %{buildroot}%{_sysconfdir}/alternatives/$bin
ln -s %{_sysconfdir}/alternatives/$bin %{buildroot}%_bindir/$bin
done
mkdir -p %{buildroot}%_libdir mkdir -p %{buildroot}%_libdir
ln -s %_libdir/libruby2.0.so %{buildroot}%_libdir/libruby.so ln -s %_libdir/libruby2.0.so %{buildroot}%_libdir/libruby.so
install -D -m 0644 %{S:0} %{buildroot}/etc/rpm/macros.ruby install -D -m 0644 %{S:0} %{buildroot}/etc/rpm/macros.ruby
install -D -m 0644 %{S:2} %{buildroot}/etc/gemrc install -D -m 0644 %{S:2} %{buildroot}/etc/gemrc
%post
for bin in erb gem irb rake rdoc ri ruby testrb; do
/usr/sbin/update-alternatives --install \
%{_bindir}/$bin $bin %{_bindir}/$bin"2.0" 20
done
%preun
if [ "$1" = 0 ] ; then
for bin in erb gem irb rake rdoc ri ruby testrb; do
/usr/sbin/update-alternatives --remove $bin %{_bindir}/$bin"2.0"
done
fi
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%config /etc/gemrc %config /etc/gemrc
%config /etc/rpm/macros.ruby %config /etc/rpm/macros.ruby
%ghost %_sysconfdir/alternatives/erb
%{_bindir}/erb
%ghost %_sysconfdir/alternatives/gem
%{_bindir}/gem
%ghost %_sysconfdir/alternatives/irb
%{_bindir}/irb
%ghost %_sysconfdir/alternatives/rake
%{_bindir}/rake
%ghost %_sysconfdir/alternatives/rdoc
%{_bindir}/rdoc
%ghost %_sysconfdir/alternatives/ri
%{_bindir}/ri
%ghost %_sysconfdir/alternatives/ruby
%{_bindir}/ruby
%ghost %_sysconfdir/alternatives/testrb
%{_bindir}/testrb
%files devel %files devel
%defattr(-,root,root) %defattr(-,root,root)