[DRE-commits] [SCM] ruby-thin.git branch, master, updated. upstream/1.2.11-31-g9a7644c

Ryan Niebur ryanryan52 at gmail.com
Tue Jan 10 09:42:20 UTC 2012


The following commit has been merged in the master branch:
commit 9c4ef5113cc768acac2647b584806468b3ccd516
Author: Ryan Niebur <ryanryan52 at gmail.com>
Date:   Tue Jan 10 01:24:24 2012 -0800

    convert to include only one thin script, which can ran under different interpreters using the -S flag: ruby1.9.1 -S thin start

diff --git a/debian/changelog b/debian/changelog
index 741c217..481c790 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,8 +10,10 @@ thin (1.3.1-1) UNRELEASED; urgency=low
   * update my e-mail address
   * install copies of thin script for each supported interpreter
   * Updated to newer upstream release (Closes: #653332)
+  * convert to include only one thin script, which can ran under
+    different interpreters using the -S flag: ruby1.9.1 -S thin start
 
- -- Ryan Niebur <ryan at debian.org>  Sun, 08 Jan 2012 02:32:16 -0800
+ -- Ryan Niebur <ryan at debian.org>  Tue, 10 Jan 2012 01:23:44 -0800
 
 thin (1.2.4-1.1) unstable; urgency=high
 
diff --git a/debian/clean b/debian/clean
index 5c0b0e7..0bbc2f8 100644
--- a/debian/clean
+++ b/debian/clean
@@ -1,2 +1 @@
-debian/thin1.8.1
-debian/thin1.8.init
+debian/thin.init
diff --git a/debian/control b/debian/control
index 949031c..174c523 100644
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,7 @@ XB-Ruby-Versions: ${ruby:Versions}
 Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter, ruby-rack (>= 1.0.0), ruby-eventmachine (>= 0.12.10), ruby-daemons (>= 1.0.9)
 Replaces: thin1.8 (<< 1.2.4)
 Breaks: thin1.8 (<< 1.2.4)
-Provides: thin, thin1.8
+Provides: thin1.8
 Description: fast and very simple Ruby web server
  Thin is a Ruby web server that glues together 3 of the best Ruby
  libraries in web history:
diff --git a/debian/gen_init.rb b/debian/gen_init.rb
index 0fc8329..9c3905a 100644
--- a/debian/gen_init.rb
+++ b/debian/gen_init.rb
@@ -1,14 +1,19 @@
 #!/usr/bin/ruby -w
 
 require 'erb'
-
+require 'gem2deb/dh_ruby'
+require 'ftools'
 class Command
   def self.script
     "/usr/bin/thin"
   end
 end
 INITD_PATH="/etc/init.d/thin"
-config_files_path="/etc/thin"
+rubies = {}
+Gem2Deb::DhRuby::SUPPORTED_RUBY_VERSIONS.each{|x,y| x = x.sub(/^ruby/, ""); rubies[x] = y;}
+rubies.keys.each do |x|
+  File.makedirs(File.join("debian", "thin", "etc", "thin" + x))
+end
 File.open(File.dirname(__FILE__) + '/thin.init', 'w') do |f|
   f << ERB.new(File.read("lib/thin/controllers/service.sh.erb")).result(binding)
 end
diff --git a/debian/patches/dont-allow-install b/debian/patches/dont-allow-install
index e3d5729..390978c 100644
--- a/debian/patches/dont-allow-install
+++ b/debian/patches/dont-allow-install
@@ -1,7 +1,9 @@
 # remove the code to install thin's init script ("thin install"), the Debian package does that.
 
---- a/lib/thin/controllers/service.rb
-+++ b/lib/thin/controllers/service.rb
+Index: ruby-thin/lib/thin/controllers/service.rb
+===================================================================
+--- ruby-thin.orig/lib/thin/controllers/service.rb	2012-01-10 00:56:06.000000000 -0800
++++ ruby-thin/lib/thin/controllers/service.rb	2012-01-10 01:06:12.000000000 -0800
 @@ -32,30 +32,7 @@
        end
      
diff --git a/debian/patches/fix-init-script b/debian/patches/fix-init-script
index 88a6745..249f261 100644
--- a/debian/patches/fix-init-script
+++ b/debian/patches/fix-init-script
@@ -1,7 +1,9 @@
 # (better) lsb compliance
 
---- a/lib/thin/controllers/service.sh.erb
-+++ b/lib/thin/controllers/service.sh.erb
+Index: ruby-thin/lib/thin/controllers/service.sh.erb
+===================================================================
+--- ruby-thin.orig/lib/thin/controllers/service.sh.erb	2012-01-10 01:15:50.000000000 -0800
++++ ruby-thin/lib/thin/controllers/service.sh.erb	2012-01-10 01:17:56.000000000 -0800
 @@ -4,7 +4,7 @@
  # Required-Start:    $local_fs $remote_fs
  # Required-Stop:     $local_fs $remote_fs
@@ -11,12 +13,37 @@
  # Short-Description: thin initscript
  # Description:       thin
  ### END INIT INFO
-@@ -27,7 +27,7 @@ case "$1" in
+@@ -15,20 +15,28 @@
+ 
+ DAEMON=<%= Command.script %>
+ SCRIPT_NAME=<%= INITD_PATH %>
+-CONFIG_PATH=<%= config_files_path %>
+ 
+ # Exit if the package is not installed
+ [ -x "$DAEMON" ] || exit 0
+ 
++run_action() {
++        ACTION="$1"
++	<% rubies.each do |etcname, path| %>
++	if [ -x <%= path %> ]; then
++	    <%= path %> $DAEMON $ACTION --all <%= "/etc/thin" + etcname %>
++	fi
++	<% end %>
++}
++
+ case "$1" in
+   start)
+-	$DAEMON start --all $CONFIG_PATH
++	run_action start
+ 	;;
    stop)
- 	$DAEMON stop --all $CONFIG_PATH
+-	$DAEMON stop --all $CONFIG_PATH
++	run_action stop
  	;;
 -  restart)
+-	$DAEMON restart --all $CONFIG_PATH
 +  restart|force-reload|reload)
- 	$DAEMON restart --all $CONFIG_PATH
++	run_action restart
  	;;
    *)
+ 	echo "Usage: $SCRIPT_NAME {start|stop|restart}" >&2
diff --git a/debian/patches/fix_require_path_for_thin_parser.patch b/debian/patches/fix_require_path_for_thin_parser.patch
index 592ffe0..188cf42 100644
--- a/debian/patches/fix_require_path_for_thin_parser.patch
+++ b/debian/patches/fix_require_path_for_thin_parser.patch
@@ -4,10 +4,10 @@ Subject: Fix require path for thin_parser due to Debian installation path
 
 Author: Laurent Arnoud <laurent at spkdev.net>
 Forwarded: not-needed
-Index: thin/lib/thin.rb
+Index: ruby-thin/lib/thin.rb
 ===================================================================
---- thin.orig/lib/thin.rb	2012-01-08 02:44:52.000000000 -0800
-+++ thin/lib/thin.rb	2012-01-08 02:46:18.000000000 -0800
+--- ruby-thin.orig/lib/thin.rb	2012-01-10 00:56:06.000000000 -0800
++++ ruby-thin/lib/thin.rb	2012-01-10 01:06:12.000000000 -0800
 @@ -6,6 +6,7 @@
  require 'openssl'
  require 'eventmachine'
diff --git a/debian/rules b/debian/rules
index 8dbbd3e..212a84d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,12 +11,9 @@
 # If you need to specify the .gemspec (eg there is more than one)
 #export DH_RUBY_GEMSPEC=gem.gemspec
 
-RUBY_VERSIONS=$(shell ruby -r gem2deb/dh_ruby -e 'puts Gem2Deb::DhRuby::SUPPORTED_RUBY_VERSIONS.keys.map{|x| x.sub(/^ruby/, "")}')
-
 %:
 	dh $@ --buildsystem=ruby --with ruby
 
 override_dh_install:
 	ruby ./debian/gen_init.rb
-	for i in $(RUBY_VERSIONS); do cp debian/thin/usr/bin/thin debian/thin/usr/bin/thin$$i; sed -i "1 s/ruby/ruby$$i/g" debian/thin/usr/bin/thin$$i; done
 	dh_install
diff --git a/debian/thin.links b/debian/thin.links
deleted file mode 100644
index ea3f074..0000000
--- a/debian/thin.links
+++ /dev/null
@@ -1,4 +0,0 @@
-/usr/share/man/man1/thin1.8.1.gz /usr/share/man/man1/thin.1.gz
-/usr/bin/thin1.8 /usr/bin/thin
-/etc/init.d/thin1.8 /etc/init.d/thin
-/etc/thin1.8 /etc/thin

-- 
ruby-thin.git



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