summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <a3li@gentoo.org>2011-06-12 17:13:51 +0000
committerAlex Legler <a3li@gentoo.org>2011-06-12 17:13:51 +0000
commitd2e527e25fde24c97b9978139f052510bfb068e6 (patch)
tree9be171312640a5d24f5fccdbbd23de87cb9fa9af /www-servers/thin
parentVersion bump to the latest. Drop 1.5.0. (diff)
downloadgentoo-2-d2e527e25fde24c97b9978139f052510bfb068e6.tar.gz
gentoo-2-d2e527e25fde24c97b9978139f052510bfb068e6.tar.bz2
gentoo-2-d2e527e25fde24c97b9978139f052510bfb068e6.zip
Version bump. The package now installs init scripts and works with more rspec versions.
(Portage version: 2.2.0_alpha39/cvs/Linux x86_64)
Diffstat (limited to 'www-servers/thin')
-rw-r--r--www-servers/thin/ChangeLog11
-rw-r--r--www-servers/thin/files/thin.confd20
-rw-r--r--www-servers/thin/files/thin.initd63
-rw-r--r--www-servers/thin/thin-1.2.11.ebuild78
4 files changed, 170 insertions, 2 deletions
diff --git a/www-servers/thin/ChangeLog b/www-servers/thin/ChangeLog
index f17a864d953b..50032f0edb7b 100644
--- a/www-servers/thin/ChangeLog
+++ b/www-servers/thin/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for www-servers/thin
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/www-servers/thin/ChangeLog,v 1.16 2010/08/13 23:38:19 flameeyes Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/thin/ChangeLog,v 1.17 2011/06/12 17:13:51 a3li Exp $
+
+*thin-1.2.11 (12 Jun 2011)
+
+ 12 Jun 2011; Alex Legler <a3li@gentoo.org> +thin-1.2.11.ebuild,
+ +files/thin.confd, +files/thin.initd:
+ Version bump. The package now installs init scripts and works with more rspec
+ versions.
13 Aug 2010; Diego E. Pettenò <flameeyes@gentoo.org>
thin-1.2.5-r1.ebuild:
diff --git a/www-servers/thin/files/thin.confd b/www-servers/thin/files/thin.confd
new file mode 100644
index 000000000000..ca517d6fe36c
--- /dev/null
+++ b/www-servers/thin/files/thin.confd
@@ -0,0 +1,20 @@
+# /etc/conf.d/thin: Configuration for /etc/init.d/thin*
+# Copy this file to /etc/conf.d/thin.SERVERNAME for server specific options.
+
+# Set the configuration file location.
+# In start-all mode (/etc/init.d/thin), this must point to the directory where
+# all the thin configurations are located.
+# When starting a specific server (/etc/init.d/thin.SERVER), point to the exact
+# location of the .yml configuration file.
+# CONFIG="/etc/thin/${SVCNAME#*.}.yml"
+
+# Disable looking for a configuration file.
+# You can use THIN_OPTS instead for setting command line options.
+# NOCONFIG=0
+
+# Set the Ruby interpreter to use.
+# RUBY="/usr/bin/ruby"
+
+# Set command line options to pass to thin.
+# In specific server mode, '--tag SERVER_NAME' is automatically appended.
+# THIN_OPTS=
diff --git a/www-servers/thin/files/thin.initd b/www-servers/thin/files/thin.initd
new file mode 100644
index 000000000000..35dfee6ee718
--- /dev/null
+++ b/www-servers/thin/files/thin.initd
@@ -0,0 +1,63 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/thin/files/thin.initd,v 1.1 2011/06/12 17:13:51 a3li Exp $
+
+SERVER=${SVCNAME#*.}
+if [ ${SERVER} != thin ]; then
+ CONFIG=${CONFIG:-/etc/thin/${SERVER}.yml}
+else
+ CONFIG=${CONFIG:-/etc/thin/}
+fi
+NOCONFIG=${NOCONFIG:-0}
+RUBY=${RUBY:-/usr/bin/ruby}
+THIN_OPTS=${THIN_OPTS:-}
+
+depend() {
+ need net localmount
+}
+
+checkconfig() {
+ [ ${SERVER} = thin -o ${NOCONFIG} != 0 ] && return 0
+
+ if [ ! -f ${CONFIG} ]; then
+ eerror "Unable to find the server configuration."
+ eerror "Please set the CONFIG variable in /etc/conf.d/${SVCNAME} or"
+ eerror "set NOCONFIG there to 1 to disable looking for a config file."
+ return 1
+ fi
+}
+
+buildargs() {
+ if [ ${NOCONFIG} = 0 -a ${SERVER} != thin ]; then
+ echo -n "-C ${CONFIG} "
+ fi
+
+ echo -n "${THIN_OPTS}"
+}
+
+action() {
+ checkconfig || return 1
+
+ if [ ${SERVER} = thin ]; then
+ ebegin "$2 all thin servers in ${CONFIG}"
+ ${RUBY} /usr/bin/thin $1 $(buildargs) --all ${CONFIG}
+ eend $?
+ else
+ ebegin "$2 thin server ${SERVER}"
+ ${RUBY} /usr/bin/thin $(buildargs) --tag ${SERVER} $1
+ eend $?
+ fi
+}
+
+start() {
+ action start 'Starting'
+}
+
+stop() {
+ action stop 'Stopping'
+}
+
+restart() {
+ action restart 'Restarting'
+}
diff --git a/www-servers/thin/thin-1.2.11.ebuild b/www-servers/thin/thin-1.2.11.ebuild
new file mode 100644
index 000000000000..89d123cf2952
--- /dev/null
+++ b/www-servers/thin/thin-1.2.11.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/thin/thin-1.2.11.ebuild,v 1.1 2011/06/12 17:13:51 a3li Exp $
+
+EAPI=2
+
+USE_RUBY="ruby18 ree18"
+
+RUBY_FAKEGEM_TASK_TEST="spec"
+
+inherit ruby-fakegem
+
+DESCRIPTION="A fast and very simple Ruby web server"
+HOMEPAGE="http://code.macournoyer.com/thin/"
+
+LICENSE="Ruby"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+DEPEND="${DEPEND}
+ dev-util/ragel"
+RDEPEND="${RDEPEND}"
+
+# The runtime dependencies are used at build-time as well since the
+# Rakefile loads thin!
+mydeps=">=dev-ruby/daemons-1.0.9
+ >=dev-ruby/rack-1.0.0
+ >=dev-ruby/eventmachine-0.12.6
+ virtual/ruby-ssl"
+
+ruby_add_rdepend "${mydeps}"
+ruby_add_bdepend "${mydeps}
+ dev-ruby/rake-compiler
+ test? ( dev-ruby/rspec:0 )"
+
+all_ruby_prepare() {
+ # Fix Ragel-based parser generation (uses a *very* old syntax that
+ # is not supported in Gentoo)
+ sed -i -e 's: | rlgen-cd::' Rakefile || die
+
+ # Fix specs' dependencies so that the extension is not rebuilt
+ # when running tests
+ sed -i -e '/:spec =>/s:^:#:' tasks/spec.rake || die
+
+ # Fix rspec version to allow newer 1.x versions
+ sed -i -e '/gem "rspec"/ s/1.2.9/1.0/' tasks/spec.rake || die
+
+ # Disable a test that is known for freezing the testsuite,
+ # reported upstream.
+ sed -i \
+ -e '/should force kill process in pid file/,/^ end/ s:^:#:' \
+ spec/daemonizing_spec.rb || die
+ rm spec/server/robustness_spec.rb || die
+
+ # nasty but too complex to fix up for now :(
+ use test || rm tasks/spec.rake
+}
+
+each_ruby_compile() {
+ ${RUBY} -S rake compile || die "rake compile failed"
+}
+
+all_ruby_install() {
+ all_fakegem_install
+
+ keepdir /etc/thin
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+
+ einfo
+ elog "Thin is now shipped with init scripts."
+ elog "The default script (/etc/init.d/thin) will start all servers that have"
+ elog "configuration files in /etc/thin/. You can symlink the init script to"
+ elog "files of the format 'thin.SERVER' to be able to start individual servers."
+ elog "See /etc/conf.d/thin for more configuration options."
+ einfo
+}