ruby/ruby.spec

136 lines
3.7 KiB
RPMSpec
Raw Normal View History

#
# spec file for package ruby
#
# Copyright (c) 2013 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: ruby
Version: 2.0
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: ruby.macros
Source2: gemrc
Provides: /usr/bin/ruby
Url: http://www.ruby-lang.org/
Summary: An Interpreted Object-Oriented Scripting Language
License: MIT
Group: Development/Languages/Ruby
BuildRequires: ruby-common
BuildRequires: ruby20-devel
BuildRequires: update-alternatives
#!BuildIgnore: ruby ruby-devel
#!BuildIgnore: rubygems
%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:,')}
%description
Ruby is an interpreted scripting language for quick and easy
object-oriented programming. It has many features for processing text
files and performing system management tasks (as in Perl). It is
simple, straight-forward, and extensible.
* Ruby features:
- Simple Syntax
- *Normal* Object-Oriented features (class, method calls, for
example)
- *Advanced* Object-Oriented features(Mix-in, Singleton-method, for
example)
- Operator Overloading
- Exception Handling
- Iterators and Closures
- Garbage Collection
- Dynamic Loading of Object Files (on some architectures)
- Highly Portable (works on many UNIX machines; DOS, Windows, Mac,
BeOS, and more)
%package devel
Summary: Development files to link against Ruby
Group: Development/Languages/Ruby
Requires: %{name}
Requires: ruby20-devel
Provides: rubygems_with_buildroot_patch
%description devel
Development files to link against Ruby.
%prep
%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)
%_libdir/libruby.so
%changelog