SHA256
1
0
forked from pool/ruby
ruby/gem_install.sh
Klaus Kämpf 9594841e44 Accepting request 220747 from openSUSE:Factory:Staging:H
- readd old macros - for now at least
- generate provides for embedded rubygems
- merged ruby-common
- new package split - only single Ruby version installable
  ruby - binary
  libruby2_1-2_0 - ruby runtime library
  ruby-stdlib - ruby standard library
  ruby-doc - ruby documentation
  ruby-devel - ruby development
- revert the ruby split (ruby - ruby21)
  rename ruby21 to ruby, integrate 'ruby' and 'ruby-common'
- remove part of rubygems1.5 patch that modify mkmf which is
  already fixed upstream
- fix rb_arch in spec: append -gnu
- fix native gem builds: create gem native extensions dir
- initial version for ruby 2.1.0 - changes to Ruby 2.0:
  VM (method cache)
  RGenGC (See ko1’s RubyKaigi presentation and RubyConf 2013 presentation)
  refinements #8481 #8571
  syntax changes
  Rational/Complex Literal #8430
  def’s return value #3753
  Bignum
  use GMP #8796
  String#scrub #8414
  Socket.getifaddrs #8368
  RDoc 4.1.0 and RubyGems 2.2.0
  “literal”.freeze is now optimized #9042
  add Exception#cause #8257
  update libraries like BigDecimal, JSON, NKF, Rake, RubyGems, and RDoc

OBS-URL: https://build.opensuse.org/request/show/220747
OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby?expand=0&rev=70
2014-02-03 20:16:17 +00:00

66 lines
1.8 KiB
Bash

#! /bin/bash
set -e
# options may be followed by one colon to indicate they have a required argument
if ! options=$(getopt -o dEf -l ignore-dependencies,force,no-rdoc,rdoc,no-ri,ri,env-shebang,no-env-shebang,default-gem:,build-root:,gem-binary: -- "$@")
then
# something went wrong, getopt will put out an error message for us
exit 1
fi
eval set -- "$options"
gem_binary=gem
defaultgem=
gemfile=
otheropts=
buildroot=
while [ $# -gt 0 ]
do
case $1 in
--default-gem) defaultgem=$2 ; shift;;
--gem-binary) gem_binary="$2" ; shift;;
--build-root) otheropts="$otheropts $1=$2"; buildroot=$2; shift;;
(--) ;;
(-*) otheropts="$otheropts $1";;
(*) gemfile=$1; otheropts="$otheropts $1"; break;;
esac
shift
done
if [ "x$gemfile" = "x" ] ; then
gemfile=$(find . -maxdepth 2 -type f -name "$defaultgem")
# if still empty, we pick the sources
if [ "x$gemfile" = "x" ] ; then
gemfile=$(find $RPM_SOURCE_DIR -name "$defaultgem")
fi
otheropts="$otheropts $gemfile"
fi
set -x
$gem_binary install --verbose --local $otheropts
if test -d $RPM_BUILD_ROOT/usr/bin; then
cd $RPM_BUILD_ROOT/usr/bin
# backward compat
bins=`ls -1 *1.9 *2.0 2> /dev/null` || true
if test -n "$bins"; then
for bin in $bins; do
mv -v $bin $(echo "$bin" | sed -e 's,2.0$,,; s,1.9$,,')
done
fi
fi
if [ -d "$buildroot" ]; then
find $buildroot -type f -perm /u+x | while read file; do
# TODO: scripts in ruby/1.9.1 should call ruby1.9 for consistency
sed -i -e 's,^#!/usr/bin/env ruby,#!/usr/bin/ruby,; s,^#! *[^ ]*/ruby,#!/usr/bin/ruby,' "$file"
done
# some windows made gems are broken
find $buildroot -type d | xargs ls -ld || :
find $buildroot -type f | xargs ls -l || :
chmod -R u+w $buildroot
chmod -R o-w $buildroot
fi