summaryrefslogtreecommitdiffstats
path: root/ruby
diff options
context:
space:
mode:
author Andrew Clemons <andrew.clemons@gmail.com>2016-07-30 07:03:04 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2016-07-30 07:06:40 +0700
commit5d0aa4b4cb6f70014bc645c0a2747bfd8259e407 (patch)
treeb0d67e5b154f8d642b7f223a2bc0691272398197 /ruby
parentcbbc1e448b687e7c5f1facb61844ea45de64917b (diff)
downloadslackbuilds-5d0aa4b4cb6f70014bc645c0a2747bfd8259e407.tar.gz
slackbuilds-5d0aa4b4cb6f70014bc645c0a2747bfd8259e407.tar.xz
ruby/rbenv: Added (Groom your app's Ruby environment).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'ruby')
-rw-r--r--ruby/rbenv/README5
-rw-r--r--ruby/rbenv/dylib-patch.diff12
-rw-r--r--ruby/rbenv/rbenv.SlackBuild132
-rw-r--r--ruby/rbenv/rbenv.info10
-rw-r--r--ruby/rbenv/slack-desc19
5 files changed, 178 insertions, 0 deletions
diff --git a/ruby/rbenv/README b/ruby/rbenv/README
new file mode 100644
index 0000000000..e929145599
--- /dev/null
+++ b/ruby/rbenv/README
@@ -0,0 +1,5 @@
+rbenv - Groom your app's Ruby environment
+
+Use rbenv to pick a Ruby version for your application and guarantee that your
+development environment matches production. Put rbenv to work with Bundler for
+painless Ruby upgrades and bulletproof deployments.
diff --git a/ruby/rbenv/dylib-patch.diff b/ruby/rbenv/dylib-patch.diff
new file mode 100644
index 0000000000..dc60b42452
--- /dev/null
+++ b/ruby/rbenv/dylib-patch.diff
@@ -0,0 +1,12 @@
+diff -Naur rbenv-1.0.0.orig/libexec/rbenv rbenv-1.0.0/libexec/rbenv
+--- rbenv-1.0.0.orig/libexec/rbenv 2015-12-25 07:12:47.000000000 +1300
++++ rbenv-1.0.0/libexec/rbenv 2016-04-02 14:50:55.733994971 +1300
+@@ -20,7 +20,7 @@
+ exit 1
+ }
+
+-if enable -f "${BASH_SOURCE%/*}"/../libexec/rbenv-realpath.dylib realpath 2>/dev/null; then
++if enable -f /usr/lib/rbenv/libexec/rbenv-realpath.dylib realpath 2>/dev/null; then
+ abs_dirname() {
+ local path="$(realpath "$1")"
+ echo "${path%/*}"
diff --git a/ruby/rbenv/rbenv.SlackBuild b/ruby/rbenv/rbenv.SlackBuild
new file mode 100644
index 0000000000..12afc67d68
--- /dev/null
+++ b/ruby/rbenv/rbenv.SlackBuild
@@ -0,0 +1,132 @@
+#!/bin/sh
+
+# Slackware build script for rbenv
+
+# Copyright 2016 Andrew Clemons, Wellington New Zealand
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+PRGNAM=rbenv
+VERSION=${VERSION:-1.0.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+
+if [ -e "$CWD/$PRGNAM-$VERSION.tar.gz" ] ; then
+ tar xvf "$CWD/$PRGNAM-$VERSION.tar.gz"
+elif [ -e "$CWD/v$VERSION.tar.gz" ] ; then
+ tar xvf "$CWD/v$VERSION.tar.gz"
+else
+ echo "Source tarball not found - checked $PRGNAM-$VERSION.tar.gz and v$VERSION.tar.gz"
+ exit 2
+fi
+
+cd $PRGNAM-$VERSION
+
+# fix finding native lib when rbenv is symlinked to /usr/bin
+patch -p1 < $CWD/dylib-patch.diff
+
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+cd src
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure
+
+make
+
+cd ..
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/lib/rbenv
+mv completions libexec rbenv.d $PKG/usr/lib/rbenv
+
+mkdir -p $PKG/usr/bin
+ln -s /usr/lib/rbenv/libexec/rbenv $PKG/usr/bin/
+
+# add rbenv to path
+mkdir -p $PKG/etc/profile.d/
+cat << "EOF" > $PKG/etc/profile.d/rbenv.csh
+#!/bin/csh
+
+# see caveats for csh here
+# https://github.com/rbenv/rbenv/issues/820
+
+setenv PATH "$(rbenv root)/shims:${PATH}"
+EOF
+
+cat << "EOF" > $PKG/etc/profile.d/rbenv.sh
+#!/bin/sh
+eval "$(rbenv init -)"
+EOF
+
+chmod 0755 $PKG/etc/profile.d/*
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a README.md LICENSE $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+
diff --git a/ruby/rbenv/rbenv.info b/ruby/rbenv/rbenv.info
new file mode 100644
index 0000000000..fcb9399e25
--- /dev/null
+++ b/ruby/rbenv/rbenv.info
@@ -0,0 +1,10 @@
+PRGNAM="rbenv"
+VERSION="1.0.0"
+HOMEPAGE="https://github.com/rbenv/rbenv"
+DOWNLOAD="https://github.com/rbenv/rbenv/archive/v1.0.0.tar.gz"
+MD5SUM="0c0e8d5b612f424c8c907249e9ad05c5"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Andrew Clemons"
+EMAIL="andrew.clemons@gmail.com"
diff --git a/ruby/rbenv/slack-desc b/ruby/rbenv/slack-desc
new file mode 100644
index 0000000000..1fbc818748
--- /dev/null
+++ b/ruby/rbenv/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+rbenv: rbenv (Groom your app's Ruby environment)
+rbenv:
+rbenv: Use rbenv to pick a Ruby version for your application and guarantee
+rbenv: that your development environment matches production. Put rbenv to
+rbenv: work with Bundler for painless Ruby upgrades and bulletproof
+rbenv: deployments.
+rbenv:
+rbenv:
+rbenv: https://github.com/rbenv/rbenv
+rbenv:
+rbenv: