Accepting request 129614 from devel:languages:ruby

- add update-alternatives for ruby provided binaries

- expand ruby19 gemspecs as provides automatically (forwarded request 129585 from coolo)

OBS-URL: https://build.opensuse.org/request/show/129614
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ruby?expand=0&rev=37
This commit is contained in:
Stephan Kulow 2012-08-04 07:33:27 +00:00 committed by Git OBS Bridge
commit 5e3c0b0fb0
3 changed files with 43 additions and 5 deletions

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
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
- remove rubygem-requires - rpm does it correctly
-------------------------------------------------------------------
Thu Jul 26 07:36:15 UTC 2012 - coolo@suse.com

View File

@ -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}

View File

@ -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)