aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibaut Notteboom <thibaut.notteboom@gmail.com>2015-03-31 04:47:02 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-04-03 20:50:13 +0700
commit72aaed5ad37ea8f2d1e4a5d8529c022912de25c4 (patch)
tree077753231bc9b0785d70fd55180d2cd75c48b537
parent384de9faf3ce7f81ea1faa232f06d04a97b4a9d9 (diff)
ruby/passenger: Added (A web server and application server).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--ruby/passenger/README9
-rw-r--r--ruby/passenger/doinst.sh14
-rw-r--r--ruby/passenger/mod_passenger.conf37
-rw-r--r--ruby/passenger/passenger.SlackBuild133
-rw-r--r--ruby/passenger/passenger.info10
-rw-r--r--ruby/passenger/slack-desc19
6 files changed, 222 insertions, 0 deletions
diff --git a/ruby/passenger/README b/ruby/passenger/README
new file mode 100644
index 0000000000000..095600a4130b8
--- /dev/null
+++ b/ruby/passenger/README
@@ -0,0 +1,9 @@
+Phusion Passenger is a web server and application server, designed to
+be fast, robust and lightweight. It takes a lot of complexity out of
+deploying web apps, adds powerful enterprise-grade features that are
+useful in production, and makes administration much easier and less
+complex.
+
+Phusion Passenger supports Ruby, Python and Node.js.
+
+node is an optional dependency (autodetected).
diff --git a/ruby/passenger/doinst.sh b/ruby/passenger/doinst.sh
new file mode 100644
index 0000000000000..debc570bd7380
--- /dev/null
+++ b/ruby/passenger/doinst.sh
@@ -0,0 +1,14 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/httpd/extra/mod_passenger.conf.new
diff --git a/ruby/passenger/mod_passenger.conf b/ruby/passenger/mod_passenger.conf
new file mode 100644
index 0000000000000..f87c3a11bccc2
--- /dev/null
+++ b/ruby/passenger/mod_passenger.conf
@@ -0,0 +1,37 @@
+#
+# mod_passenger
+#
+
+LoadModule passenger_module @baselibdir@/httpd/modules/mod_passenger.so
+<IfModule mod_passenger.c>
+ PassengerRoot @passengerdir@
+ PassengerDefaultRuby /usr/bin/ruby
+</IfModule>
+
+#
+# Deploying a web application: an example
+#
+# Suppose you have a web application in /somewhere. Add a virtual host to your
+# Apache configuration file and set its DocumentRoot to /somewhere/public:
+#
+
+#<VirtualHost *:80>
+# ServerName www.yourhost.com
+# # !!! Be sure to point DocumentRoot to 'public'!
+# DocumentRoot /somewhere/public
+# <Directory /somewhere/public>
+# # This relaxes Apache security settings.
+# AllowOverride all
+# # MultiViews must be turned off.
+# Options -MultiViews
+#
+# Require all granted
+# </Directory>
+#</VirtualHost>
+
+#
+# And that's it! You may also want to check the Users Guide for security and
+# optimization tips, troubleshooting and other useful information:
+#
+# https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html
+#
diff --git a/ruby/passenger/passenger.SlackBuild b/ruby/passenger/passenger.SlackBuild
new file mode 100644
index 0000000000000..8ab64af1a6348
--- /dev/null
+++ b/ruby/passenger/passenger.SlackBuild
@@ -0,0 +1,133 @@
+#!/bin/sh
+
+# Slackware build script for passenger
+
+# Copyright 2015 Thibaut Notteboom, Paris, FRANCE
+# 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=passenger
+VERSION=${VERSION:-5.0.5}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -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
+
+DESTDIR=$( ruby -r rbconfig -e '
+include RbConfig
+printf("%s/%s/gems/%s\n",
+ CONFIG["libdir"],
+ CONFIG["RUBY_INSTALL_NAME"],
+ CONFIG["ruby_version"]
+ )
+')
+
+gem specification $CWD/$PRGNAM-$VERSION.gem | \
+ ruby -r yaml -r rbconfig -e '
+c = RbConfig::CONFIG
+path = sprintf("%s/%s/gems/%s",
+ c["libdir"],
+ c["RUBY_INSTALL_NAME"],
+ c["ruby_version"])
+sys_gemspecs = Dir.glob(path + "/specifications/*").map {|g| gs = Gem::Specification.load(g); gs.name }
+obj = Gem::Specification.from_yaml($stdin)
+obj.dependencies.each {|dep|
+ if not(dep.type == :runtime)
+ next
+ end
+ if not(sys_gemspecs.include?(dep.name))
+ $stderr.write("WARNING: #{dep.name} gem not found\n")
+ sleep 0.5
+ end
+
+}'
+
+gem install \
+ --local \
+ --no-update-sources \
+ --ignore-dependencies \
+ --backtrace \
+ --install-dir $PKG/$DESTDIR \
+ --bindir $PKG/usr/bin \
+ $CWD/$PRGNAM-$VERSION.gem
+
+$PKG/$DESTDIR/gems/passenger-${VERSION}/bin/passenger-install-apache2-module --auto
+
+mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/httpd/modules
+install -m 755 $PKG/$DESTDIR/gems/passenger-${VERSION}/buildout/apache2/mod_passenger.so \
+ $PKG/usr/lib${LIBDIRSUFFIX}/httpd/modules/mod_passenger.so
+
+mkdir -p $PKG/etc/httpd/extra
+sed -e "s%@baselibdir@%lib${LIBDIRSUFFIX}%" \
+ -e "s%@passengerdir@%${DESTDIR}/gems/passenger-${VERSION}%" \
+ $CWD/mod_passenger.conf > $PKG/etc/httpd/extra/mod_passenger.conf.new
+
+mkdir -p $PKG/usr/man/{man1,man8}
+cp $PKG/$DESTDIR/gems/passenger-${VERSION}/man/*.1 $PKG/usr/man/man1
+cp $PKG/$DESTDIR/gems/passenger-${VERSION}/man/*.8 $PKG/usr/man/man8
+
+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
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+tar -x -O --file=$CWD/$PRGNAM-$VERSION.gem data.tar.gz \
+ | tar -xz -C $PKG/usr/doc/$PRGNAM-$VERSION --file=- \
+ CHANGELOG CONTRIBUTING.md CONTRIBUTORS doc/ INSTALL.md LICENSE README.md
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/ruby/passenger/passenger.info b/ruby/passenger/passenger.info
new file mode 100644
index 0000000000000..1c8b6e3e8fd5b
--- /dev/null
+++ b/ruby/passenger/passenger.info
@@ -0,0 +1,10 @@
+PRGNAM="passenger"
+VERSION="5.0.5"
+HOMEPAGE="https://www.phusionpassenger.com"
+DOWNLOAD="https://rubygems.org/downloads/passenger-5.0.5.gem"
+MD5SUM="5eeaeb837b141adef6e8798b3e93287e"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="rubygem-rack"
+MAINTAINER="Thibaut Notteboom"
+EMAIL="thibaut.notteboom@gmail.com"
diff --git a/ruby/passenger/slack-desc b/ruby/passenger/slack-desc
new file mode 100644
index 0000000000000..d6b6cef5d9712
--- /dev/null
+++ b/ruby/passenger/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------------------------------------------------------|
+passenger: passenger (A web server and application server for your web apps)
+passenger:
+passenger: Phusion Passenger is a web server and application server, designed to
+passenger: be fast, robust and lightweight. It takes a lot of complexity out of
+passenger: deploying web apps, adds powerful enterprise-grade features that are
+passenger: useful in production, and makes administration much easier and less
+passenger: complex.
+passenger:
+passenger: Phusion Passenger supports Ruby, Python and Node.js.
+passenger:
+passenger: https://www.phusionpassenger.com/