From 9d8456859a4a270eab92699d2446a59aa7ebb88e635c47e90e801acdd4a5803f Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 26 Jul 2012 09:53:35 +0000 Subject: [PATCH 1/2] - remove rubygem-requires - rpm does it correctly OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby?expand=0&rev=45 --- ruby.changes | 5 +++++ ruby.macros | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ruby.changes b/ruby.changes index 5ba3af2..2c54260 100644 --- a/ruby.changes +++ b/ruby.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 26 09:53:19 UTC 2012 - coolo@suse.com + +- remove rubygem-requires - rpm does it correctly + ------------------------------------------------------------------- Thu Jul 26 07:36:15 UTC 2012 - coolo@suse.com diff --git a/ruby.macros b/ruby.macros index 451c490..2bdedcd 100644 --- a/ruby.macros +++ b/ruby.macros @@ -21,8 +21,6 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -%rubygems_requires %{rubygems19_requires} - %rb_binary %{rb19_binary} %gem_binary /usr/bin/gem1.9 %rb_arch %{rb19_arch} From 9ab5cd394913bf6bb953ef21c9fb788bce01c7766e2e5762beba8e02a38a2108 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Wed, 1 Aug 2012 18:58:56 +0000 Subject: [PATCH 2/2] Accepting request 129585 from openSUSE:Tools:Unstable - add update-alternatives for ruby provided binaries - expand ruby19 gemspecs as provides automatically OBS-URL: https://build.opensuse.org/request/show/129585 OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby?expand=0&rev=47 --- ruby.changes | 10 ++++++++++ ruby.spec | 31 ++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/ruby.changes b/ruby.changes index 2c54260..c03d2cf 100644 --- a/ruby.changes +++ b/ruby.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Wed Aug 1 13:29:19 UTC 2012 - coolo@suse.com + +- add update-alternatives for ruby provided binaries + +------------------------------------------------------------------- +Wed Aug 1 12:07:35 UTC 2012 - coolo@suse.com + +- expand ruby19 gemspecs as provides automatically + ------------------------------------------------------------------- Thu Jul 26 09:53:19 UTC 2012 - coolo@suse.com diff --git a/ruby.spec b/ruby.spec index 87372df..31bd7d3 100644 --- a/ruby.spec +++ b/ruby.spec @@ -27,10 +27,16 @@ Url: http://www.ruby-lang.org/ Summary: An Interpreted Object-Oriented Scripting Language License: MIT Group: Development/Languages/Ruby -Requires: ruby19 +BuildRequires: ruby-common +BuildRequires: ruby19-devel +BuildRequires: update-alternatives +%requires_eq ruby19 Provides: rubygems = 1.8.15 Obsoletes: rubygems < 1.8.15 Requires: ruby-common >= 1.0 +Requires: update-alternatives + +%{expand:%(rpm -ql ruby19 | fgrep .gemspec | /usr/bin/ruby1.9 /usr/lib/rpm/rubygemsdeps.rb --provides | sed -e 's,^,Provides:,')} %description Ruby is an interpreted scripting language for quick and easy @@ -84,13 +90,32 @@ mkdir -p $RPM_BUILD_ROOT%_libdir ln -s %_libdir/libruby1.9.so $RPM_BUILD_ROOT%_libdir/libruby.so install -D -m 0644 %{S:0} $RPM_BUILD_ROOT/etc/rpm/macros.ruby install -D -m 0644 %{S:2} $RPM_BUILD_ROOT/etc/gemrc -export NO_BRP_STALE_LINK_ERROR=yes + +%post +for bin in erb gem irb rake rdoc ri ruby testrb; do + /usr/sbin/update-alternatives --install \ + %{_bindir}/$bin $bin %{_bindir}/$bin"1.9" 19 +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"1.9" + done +fi %files %defattr(-,root,root) %config /etc/gemrc %config /etc/rpm/macros.ruby -%{_bindir}/* +%ghost %{_bindir}/erb +%ghost %{_bindir}/gem +%ghost %{_bindir}/irb +%ghost %{_bindir}/rake +%ghost %{_bindir}/rdoc +%ghost %{_bindir}/ri +%ghost %{_bindir}/ruby +%ghost %{_bindir}/testrb %files devel %defattr(-,root,root)