ruby/gem_install.sh
Stephan Kulow 53dbe04f09 Accepting request 128957 from openSUSE:Tools:Unstable
- map the != operator to > - which might be wrong in 50% of all cases

- require a patched rpm in case rpm does not have magic hooks

- move the option parsing to a shell script that is able to do it
  rightly (rpm macros are just *BAD*)

- make the rubygemdeps a ruby script much more clever about gemspecs

- Another take on %gem_install, the version w/o passing parameters
  seemed to be wrong

- avoid *.gemspec, we get problems if we there are two

- remove too relaxing permissions from unpacked archive

- add a provides for ruby-macros

- Fix %gem_unpack:
  Fetch Gemspec from gem metadata for gems that don't package Gemspecs
  but generate them programatically

OBS-URL: https://build.opensuse.org/request/show/128957
OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby?expand=0&rev=42
2012-07-26 07:25:42 +00:00

46 lines
1.1 KiB
Bash

#! /bin/bash
# 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=
while [ $# -gt 0 ]
do
case $1 in
--default-gem) defaultgem=$2 ; shift;;
--gem-binary) gem_binary="$2" ; shift;;
--build-root) otheropts="$otheropts $1=$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")
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
bins=`ls -1 *1.9 2> /dev/null`
if test -n "$bins"; then
for bin in $bins; do
mv -v $bin $(echo "$bin" | sed -e 's,1.9$,,')
done
fi
fi