[DRE-commits] r1258 - in packages-wip/mongrel/trunk/debian: . patches

Filipe Lautert filipe-guest at alioth.debian.org
Mon Jan 8 19:26:37 CET 2007


Author: filipe-guest
Date: 2007-01-08 19:26:36 +0100 (Mon, 08 Jan 2007)
New Revision: 1258

Added:
   packages-wip/mongrel/trunk/debian/docs
   packages-wip/mongrel/trunk/debian/init.d
   packages-wip/mongrel/trunk/debian/mongrel.1
   packages-wip/mongrel/trunk/debian/mongrel.postinst
   packages-wip/mongrel/trunk/debian/watch
Modified:
   packages-wip/mongrel/trunk/debian/changelog
   packages-wip/mongrel/trunk/debian/control
   packages-wip/mongrel/trunk/debian/copyright
   packages-wip/mongrel/trunk/debian/patches/01_add_shebang.dpatch
   packages-wip/mongrel/trunk/debian/rules
Log:
  * Merged gwolf tree and Jens tree.
  * Aplied patch to init.d, so now it suports multiple environments.
  * Removed insconsistent patchs.
  * Updated copyright information.
  * Added examples and doc to docs file.
  * Created watch file for rubygems files.



Modified: packages-wip/mongrel/trunk/debian/changelog
===================================================================
--- packages-wip/mongrel/trunk/debian/changelog	2007-01-08 07:06:13 UTC (rev 1257)
+++ packages-wip/mongrel/trunk/debian/changelog	2007-01-08 18:26:36 UTC (rev 1258)
@@ -1,3 +1,14 @@
+mongrel (1.0~rc1-1) experimental; urgency=low
+
+  * Merged gwolf tree and Jens tree.
+  * Aplied patch to init.d, so now it suports multiple environments.
+  * Removed insconsistent patchs.
+  * Updated copyright information.
+  * Added examples and doc to docs file.
+  * Created watch file for rubygems files.
+
+ -- Filipe Lautert <filipe at icewall.org>  Mon,  8 Jan 2007 15:55:15 -0200
+
 mongrel (0.3.13.4-1) experimental; urgency=low
 
   * Initial Release.

Modified: packages-wip/mongrel/trunk/debian/control
===================================================================
--- packages-wip/mongrel/trunk/debian/control	2007-01-08 07:06:13 UTC (rev 1257)
+++ packages-wip/mongrel/trunk/debian/control	2007-01-08 18:26:36 UTC (rev 1258)
@@ -1,13 +1,14 @@
 Source: mongrel
 Section: web
 Priority: optional
-Maintainer: Gunnar Wolf <gwolf at debian.org>
-Build-Depends: debhelper (>= 4.0.0), ruby1.8, ruby1.8-dev, dpatch
+Maintainer: Filipe Lautert <filipe at icewall.org>, Gunnar Wolf <gwolf at debian.org>, Jens Kraemer <jk at jkraemer.net>
+Build-Depends: debhelper (>= 4.0.0), ruby1.8 (>=1.8.4), ruby1.8-dev (>=1.8.4), dpatch
+Build-Conflicts: gcc-3.3 (<< 1:3.3.2-0pre1)
 Standards-Version: 3.7.2
 
 Package: mongrel
 Architecture: any
-Depends: ruby1.8
+Depends: ${shlibs:Depends}, ${misc:Depends}, ruby1.8 (>=1.8.4), libgems-ruby1.8
 Recommends: rails
 Description: A small fast HTTP library and server that runs Rails, Camping, and Nitro apps
  Mongrel is a fast HTTP library and server for Ruby that is intended

Modified: packages-wip/mongrel/trunk/debian/copyright
===================================================================
--- packages-wip/mongrel/trunk/debian/copyright	2007-01-08 07:06:13 UTC (rev 1257)
+++ packages-wip/mongrel/trunk/debian/copyright	2007-01-08 18:26:36 UTC (rev 1258)
@@ -5,9 +5,61 @@
 
 It was downloaded from http://rubyforge.org/projects/mongrel/
 
-Copyright Holder: Zed Shaw <zedshaw at zedshaw.com>
+Upstream Author: Zed Shaw <zedshaw at zedshaw.com>
 
-License:
 
-Mongrel is licensed under the GPL license. On Debian systems, the GPL
-can be found at /usr/share/common-licenses/GPL
+Copyright (c) 2006-2007 Zed Shaw <zedshaw at zedshaw.com>
+
+Mongrel Web Server (Mongrel) is copyrighted free software by Zed A. Shaw  
+You can redistribute it and/or modify it under either the terms of the 
+GPL or the conditions below:
+
+1. You may make and give away verbatim copies of the source form of the
+   software without restriction, provided that you duplicate all of the
+   original copyright notices and associated disclaimers.
+
+2. You may modify your copy of the software in any way, provided that
+   you do at least ONE of the following:
+
+a) place your modifications in the Public Domain or otherwise make them
+Freely Available, such as by posting said modifications to Usenet or an
+equivalent medium, or by allowing the author to include your
+modifications in the software.
+
+b) use the modified software only within your corporation or
+   organization.
+
+c) rename any non-standard executables so the names do not conflict with
+standard executables, which must also be provided.
+
+d) make other distribution arrangements with the author.
+
+3. You may distribute the software in object code or executable
+   form, provided that you do at least ONE of the following:
+
+a) distribute the executables and library files of the software,
+together with instructions (in the manual page or equivalent) on where
+to get the original distribution.
+
+b) accompany the distribution with the machine-readable source of the
+software.
+
+c) give non-standard executables non-standard names, with
+   instructions on where to get the original software distribution.
+
+d) make other distribution arrangements with the author.
+
+4. You may modify and include the part of the software into any other
+   software (possibly commercial).  But some files in the distribution
+   are not written by the author, so that they are not under this terms.
+
+5. The scripts and library files supplied as input to or produced as 
+   output from the software do not automatically fall under the
+   copyright of the software, but belong to whomever generated them, 
+   and may be sold commercially, and may be aggregated with this
+   software.
+
+6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE.

Added: packages-wip/mongrel/trunk/debian/docs
===================================================================
--- packages-wip/mongrel/trunk/debian/docs	2007-01-08 07:06:13 UTC (rev 1257)
+++ packages-wip/mongrel/trunk/debian/docs	2007-01-08 18:26:36 UTC (rev 1258)
@@ -0,0 +1,3 @@
+README
+doc/
+examples/

Added: packages-wip/mongrel/trunk/debian/init.d
===================================================================
--- packages-wip/mongrel/trunk/debian/init.d	2007-01-08 07:06:13 UTC (rev 1257)
+++ packages-wip/mongrel/trunk/debian/init.d	2007-01-08 18:26:36 UTC (rev 1258)
@@ -0,0 +1,162 @@
+#! /bin/sh
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DESC="mongrel servers"
+NAME=mongrel
+DAEMON=/usr/bin/mongrel_rails
+SCRIPTNAME=/etc/init.d/$NAME
+
+test -x $DAEMON || exit 0
+
+# configuration 
+# don't change here, override in /etc/default/mongrel instead
+USER=www-data
+CONFIG_BASE=/etc/mongrel/sites-enabled
+PEN=/usr/bin/pen
+
+# Read config file if it is present.
+if [ -r /etc/default/mongrel ]
+then
+  . /etc/default/mongrel
+fi
+
+set -e
+
+
+# run the given command ($2, {start|stop|reload}) for the given app ($1)
+for_app() {
+  #reset all variables that can be used on the configuration file
+  for i in "dir port servers proxy_port env additional_pen_opts pen_status_file"; do
+    unset $i
+  done
+
+  echo -n $1
+  . $CONFIG_BASE/$1
+
+  if [ -z "$dir" -o -z "$port" -o -z "$servers" ]; then
+    echo " -> Error: incomplete configuration file. Variables 'dir', 'port' and 'servers' must be set."
+    return
+  fi
+
+  if [ "$2" != "reload" -a -n "$proxy_port" ]; then
+    start_stop_proxy $1 $2
+  fi
+
+  if [ -z $env ]; then
+  	env="production"
+  fi
+
+  DAEMON_OPTS="start -e $env -a 127.0.0.1 -c $dir"
+  last_port=$(( $port + $servers - 1 ))
+  case "$2" in
+    start|reload)
+      for p in `seq $port $last_port`; do
+        pidfile="/var/run/$NAME.$1.$p.pid"
+        case "$2" in
+          start)
+            start-stop-daemon --start --background --chuid $USER --make-pidfile --pidfile $pidfile --exec $DAEMON -- $DAEMON_OPTS -p $p
+          ;;
+          reload)
+            SIGUSR2=12
+            start-stop-daemon --stop --signal $SIGUSR2 --quiet --pidfile $pidfile  || echo "couldn't reload process $pidfile"
+          ;;
+        esac
+      done
+      ;;
+    stop)
+      for pidfile in `ls /var/run/$NAME.$1.*.pid`; do
+        (start-stop-daemon --stop --quiet --pidfile $pidfile || kill -9 `cat $pidfile` || echo "couldn't kill process $pidfile (`cat $pidfile`), removing pid file anyway") && rm -f $pidfile
+      done
+      ;;
+  esac
+  echo "."
+}
+
+# run the given command ('stop' or 'start') for each app configured
+# in /etc/mongrel_cluster
+each_app() {
+  for app in `ls $CONFIG_BASE/`; do
+    for_app $app $1
+  done
+}
+
+# runs given command ($1) for the given app ($2) or all apps, 
+# if $2 is not given
+run_command() {
+  if [ -z "$2" ]; then
+    # no site given
+    each_app $1
+  else
+    for_app $2 $1
+  fi
+}
+
+# start/stop the pen proxy for a given application:
+#
+# start_stop_proxy myapp start
+#
+# pen will be running as user nobody
+start_stop_proxy() {
+  if [ ! -x $PEN ]; then
+    echo "pen not available, skipping proxy"
+    return
+  fi
+  pidfile="/var/run/pen.$proxy_port.pid"
+
+  case "$2" in
+    start)
+      PEN_OPTS="$additional_pen_opts -fr $proxy_port "
+      if [ "x$pen_status_file" != "x" ]; then
+        PEN_OPTS="-w $dir/public/$pen_status_file $PEN_OPTS"
+      fi
+      last_port=$(( $port + $servers - 1 ))
+      for p in `seq $port $last_port`; do
+        PEN_OPTS="$PEN_OPTS localhost:$p"
+      done
+      start-stop-daemon --start --quiet --pidfile $pidfile --chuid nobody --background --make-pidfile --exec $PEN -- $PEN_OPTS || echo "couldnt start pen"
+      ;;
+    stop)
+      if [ -f $pidfile ]; then
+        start-stop-daemon --stop --quiet --oknodo --pidfile $pidfile 
+      fi
+      ;;
+  esac
+}
+
+
+case "$1" in
+  start)
+  echo "Starting $DESC: $NAME"
+  run_command 'start' $2
+  echo "."
+  ;;
+  stop)
+  echo "Stopping $DESC: $NAME"
+  run_command 'stop' $2  
+  echo "."
+  ;;
+  reload)
+  echo "Reloading $DESC: $NAME"
+  run_command 'reload' $2  
+  echo "."
+  ;;
+  restart|force-reload)
+  #
+  #  If the "reload" option is implemented, move the "force-reload"
+  #  option to the "reload" entry above. If not, "force-reload" is
+  #  just the same as "restart".
+  #
+  echo "Restarting $DESC: $NAME"
+  run_command 'stop' $2
+  sleep 1
+  run_command 'start' $2
+  echo "."
+  ;;
+  *)
+  # echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2
+  echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2
+  exit 1
+  ;;
+esac
+
+exit 0

Added: packages-wip/mongrel/trunk/debian/mongrel.1
===================================================================
--- packages-wip/mongrel/trunk/debian/mongrel.1	2007-01-08 07:06:13 UTC (rev 1257)
+++ packages-wip/mongrel/trunk/debian/mongrel.1	2007-01-08 18:26:36 UTC (rev 1258)
@@ -0,0 +1,48 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH MONGREL 1 "Juni 28, 2006"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+/etc/init.d/mongrel \- init script for Mongrel
+.SH SYNOPSIS
+.B /etc/init.d/mongrel
+.RI {start | stop | reload | restart} 
+[application_name]
+.SH DESCRIPTION
+\fB/etc/init.d/mongrel\fP can control any number of Rails applications running under the Mongrel webserver. Pen will be used to balance load between multiple Mongrel processes. 
+.SH CONFIGURATION
+Each application is configured with a file located in (or symlinked to)
+\fB/etc/mongrel/sites-enabled\fP. The name of such a file can be given 
+as a second argument to the script, to only apply the stop/start/restart 
+command to this application.
+.PP
+Each config file has to set the following variables:
+.br
+\fBdir\fP        base directory of your Rails application (RAILS_HOME)
+.br
+\fBport\fP       base port for Mongrel to use
+.br
+\fBservers\fP    number of servers to start. Each server will take it's own port, counting upwards from \fBport\fP.
+.br
+\fBproxy_port\fP port for the pen proxy server to listen for inbound connections. You should configure your frontend Web server (e.g. Apache) to forward requests for your application to this port.
+.br
+.PP
+.SH SEE ALSO
+.BR pen (1)
+.br
+.SH AUTHOR
+Mongrel (http://mongrel.rubyforge.org/) was written by Zed Shaw.
+The init script and this man page were written by Jens Krämer <jk at jkraemer.net>.

Added: packages-wip/mongrel/trunk/debian/mongrel.postinst
===================================================================
--- packages-wip/mongrel/trunk/debian/mongrel.postinst	2007-01-08 07:06:13 UTC (rev 1257)
+++ packages-wip/mongrel/trunk/debian/mongrel.postinst	2007-01-08 18:26:36 UTC (rev 1258)
@@ -0,0 +1,12 @@
+#! /bin/sh
+#DEBHELPER#
+
+old_pids=`find /var/run -maxdepth 1 -name mongrel\.\*\.pid | grep -e 'mongrel\.[0-9]\+\.pid$'`
+
+if [ "x$old_pids" != "x" ]; then
+  echo "there are old pid files lying around in /var/run that can be safely removed:"
+  echo $old_pids
+  echo "you can do so like this:"
+  echo "find /var/run -maxdepth 1 -name mongrel\.\*\.pid | grep -e 'mongrel\.[0-9]\+\.pid$' | xargs rm"
+fi
+ 

Modified: packages-wip/mongrel/trunk/debian/patches/01_add_shebang.dpatch
===================================================================
--- packages-wip/mongrel/trunk/debian/patches/01_add_shebang.dpatch	2007-01-08 07:06:13 UTC (rev 1257)
+++ packages-wip/mongrel/trunk/debian/patches/01_add_shebang.dpatch	2007-01-08 18:26:36 UTC (rev 1258)
@@ -13,19 +13,3 @@
  # Copyright (c) 2005 Zed A. Shaw 
  # You can redistribute it and/or modify it under the same terms as Ruby.
  #
-diff -ru mongrel.orig/bin/mongrel_rails_service mongrel/bin/mongrel_rails_service
---- mongrel.orig/bin/mongrel_rails_service	2006-11-17 20:12:40.000000000 -0600
-+++ mongrel/bin/mongrel_rails_service	2006-11-17 20:13:04.000000000 -0600
-@@ -1,3 +1,4 @@
-+#!/usr/bin/ruby
- ###############################################
- # mongrel_rails_service
- #
-diff -ru mongrel.orig/bin/mongrel_rails_svc mongrel/bin/mongrel_rails_svc
---- mongrel.orig/bin/mongrel_rails_svc	2006-11-17 20:12:40.000000000 -0600
-+++ mongrel/bin/mongrel_rails_svc	2006-11-17 20:13:20.000000000 -0600
-@@ -1,3 +1,4 @@
-+#!/usr/bin/ruby
- ###############################################
- # mongrel_rails_svc
- #

Modified: packages-wip/mongrel/trunk/debian/rules
===================================================================
--- packages-wip/mongrel/trunk/debian/rules	2007-01-08 07:06:13 UTC (rev 1257)
+++ packages-wip/mongrel/trunk/debian/rules	2007-01-08 18:26:36 UTC (rev 1258)
@@ -69,9 +69,11 @@
 	dh_testdir
 	dh_testroot
 	dh_installdocs
+	dh_installinit
 	dh_installman debian/mongrel_rails_service.1\
 		debian/mongrel_rails_svc.1\
-		debian/mongrel_rails.1
+		debian/mongrel_rails.1\
+		debian/mongrel.1
 	dh_installchangelogs 
 	dh_link
 	dh_strip

Added: packages-wip/mongrel/trunk/debian/watch
===================================================================
--- packages-wip/mongrel/trunk/debian/watch	2007-01-08 07:06:13 UTC (rev 1257)
+++ packages-wip/mongrel/trunk/debian/watch	2007-01-08 18:26:36 UTC (rev 1258)
@@ -0,0 +1,2 @@
+version=3
+http://mongrel.rubyforge.org/releases/gems/mongrel-([0-9\.]*(-rc.)?)\.gem




More information about the Pkg-ruby-extras-commits mailing list