# # Pkgfile template for gem ports # # Version 1 GEMNAME=${GEMNAME:-$name} build_template() { if [ -z "$GEMNAME" ]; then echo "Variable 'GEMNAME' not set" exit -1 fi sitelibdir=$(ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]') export GEMSDIR=${sitelibdir/site_ruby/gems} mkdir -p $PKG/$GEMSDIR gem install $SRC/$GEMNAME -v $version -l -i $PKG/$GEMSDIR if [ -d $PKG/$GEMSDIR/bin ]; then for b in $PKG/$GEMSDIR/bin/* ; do install -D -m 755 $b $PKG/usr/bin/$(basename $b) done fi if [ "$GEMS_KEEP_DOC" != "yes" ]; then rm -rf $PKG$GEMSDIR/doc/ fi } build() { build_template }