From 83bf4211067eab29284e1a4d2d405270abd5cd4209fd5bb4e37516e61fd814ce Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Mon, 6 Jan 2014 08:27:21 +0000 Subject: [PATCH] - move update-alternative usage to main package OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby?expand=0&rev=67 --- ruby.changes | 5 +++++ ruby.spec | 38 +------------------------------------- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/ruby.changes b/ruby.changes index 505e088..deaf62e 100644 --- a/ruby.changes +++ b/ruby.changes @@ -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 diff --git a/ruby.spec b/ruby.spec index cb0cdc3..a30b449 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1,7 +1,7 @@ # # 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 # remain the property of their copyright owners, unless otherwise agreed @@ -35,7 +35,6 @@ BuildRequires: update-alternatives %requires_ge ruby20 Provides: 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:,')} @@ -83,50 +82,15 @@ Development files to link against Ruby. %build %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 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: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 %defattr(-,root,root) %config /etc/gemrc %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 %defattr(-,root,root)