about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorevanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9>2007-09-23 14:39:54 +0000
committerevanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9>2007-09-23 14:39:54 +0000
commit5be8e75f987f18de68d31bec0ac2c288acbc0136 (patch)
treed777e4b5ca87ac86e65c6e9f018f0994fada4968
parent21a6e8a7ce038097ed9d66557863e97b4628f0cf (diff)
downloadunicorn-5be8e75f987f18de68d31bec0ac2c288acbc0136.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@609 19e92222-5c0b-0410-8929-a290d50e31e9
-rw-r--r--projects/mongrel_service/CHANGELOG32
-rw-r--r--projects/mongrel_service/LICENSE40
-rw-r--r--projects/mongrel_service/Manifest21
-rw-r--r--projects/mongrel_service/Rakefile236
-rw-r--r--projects/mongrel_service/tools/rakehelp.rb106
5 files changed, 139 insertions, 296 deletions
diff --git a/projects/mongrel_service/CHANGELOG b/projects/mongrel_service/CHANGELOG
index 9806928..9bdd050 100644
--- a/projects/mongrel_service/CHANGELOG
+++ b/projects/mongrel_service/CHANGELOG
@@ -1,26 +1,6 @@
-* SVN *
-    
-    * Properly display package/gem version for mongrel_service. Closes #13823.
-    
-    * Updated ServiceFB to r80 to solve issue when compiling with FB > 0.17.
-    
-* 0.3.2 *
-    
-    * Solved detection of parent process at ServiceFB level
-      (solves the x64 Windows issues).
-    
-    * Upgraded to ServiceFB 'trunk' (but pistoned it, just in case).
-    
-    * Fixed problems with ruby installations outside PATH or inside folders with spaces.
-    
-    * Activate FB pedantic warnings by default (is really useful).
-    
-* 0.3.1 *
-    
-    * Single Service (SingleMongrel) object type implemented.
-    
-    * Updated Rakefile to reflect the new building steps.
-    
-    * Removed SendSignal, too hackish for my taste, replaced with complete FB solution.
-    
-    * Added basic Process monitoring and re-spawning. \ No newline at end of file
+
+v0.3.3. Properly display package/gem version for mongrel_service; Closes #13823. Updated ServiceFB to r80 to solve issue when compiling with FB > 0.17.
+    
+v0.3.2. Solved detection of parent process at ServiceFB level (solves the x64 Windows issues). Upgraded to ServiceFB 'trunk' (but pistoned it, just in case). Fixed problems with ruby installations outside PATH or inside folders with spaces. Activate FB pedantic warnings by default (is really useful).
+    
+v0.3.1. Single Service (SingleMongrel) object type implemented. Updated Rakefile to reflect the new building steps. Removed SendSignal, too hackish for my taste, replaced with complete FB solution. Added basic Process monitoring and re-spawning.
diff --git a/projects/mongrel_service/LICENSE b/projects/mongrel_service/LICENSE
index 789d76e..89f6d7a 100644
--- a/projects/mongrel_service/LICENSE
+++ b/projects/mongrel_service/LICENSE
@@ -1,20 +1,20 @@
-Copyright (c) 2006 Luis Lavena, luislavena@gmail.com
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+Copyright (c) 2006, 2007 Luis Lavena, luislavena@gmail.com
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/projects/mongrel_service/Manifest b/projects/mongrel_service/Manifest
new file mode 100644
index 0000000..c51f20f
--- /dev/null
+++ b/projects/mongrel_service/Manifest
@@ -0,0 +1,21 @@
+bin/mongrel_service.exe
+tools/freebasic.rb
+TODO
+resources/defaults.yaml
+README
+native/process.bi
+native/process.bas
+native/mongrel_service.bi
+native/mongrel_service.bas
+native/_debug.bi
+LICENSE
+lib/ServiceFB/ServiceFB_Utils.bi
+lib/ServiceFB/ServiceFB_Utils.bas
+lib/ServiceFB/ServiceFB.bi
+lib/ServiceFB/ServiceFB.bas
+lib/ServiceFB/_utils_internals.bi
+lib/ServiceFB/_internals.bi
+lib/mongrel_service/init.rb
+COPYING
+CHANGELOG
+Manifest
diff --git a/projects/mongrel_service/Rakefile b/projects/mongrel_service/Rakefile
index 0f84120..a6b085a 100644
--- a/projects/mongrel_service/Rakefile
+++ b/projects/mongrel_service/Rakefile
@@ -1,144 +1,92 @@
-#--
-# Copyright (c) 2006-2007 Luis Lavena, Multimedia systems
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#++
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/clean'
-require 'rake/gempackagetask'
-require 'rake/rdoctask'
-require 'tools/rakehelp'
-require 'tools/freebasic'
-require 'fileutils'
-include FileUtils
-
-setup_tests
-setup_clean ["pkg", "lib/*.bundle", "*.gem", ".config"]
-
-setup_rdoc ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
-
-desc "Does a full compile, test run"
-task :default => [:compile, :test]
-
-GEM_VERSION = "0.3.3"
-GEM_NAME = "mongrel_service"
-
-desc "Compile native code"
-task :compile => [:native_lib, :native_service]
-
-# global options shared by all the project in this Rakefile
-OPTIONS = {
-  :debug => false,
-  :profile => false,
-  :errorchecking => :ex,
-  :mt => true,
-  :pedantic => true }
-
-OPTIONS[:debug] = true if ENV['DEBUG']
-OPTIONS[:profile] = true if ENV['PROFILE']
-OPTIONS[:errorchecking] = :exx if ENV['EXX']
-OPTIONS[:pedantic] = false if ENV['NOPEDANTIC']
-
-# ServiceFB namespace (lib)
-namespace :lib do
-  project_task 'servicefb' do
-    lib       'ServiceFB'
-    build_to  'lib'
-
-    define    'SERVICEFB_DEBUG_LOG' unless ENV['RELEASE']
-    source    'lib/ServiceFB/ServiceFB.bas'
-    
-    option    OPTIONS
-  end
-  
-  project_task 'servicefb_utils' do
-    lib       'ServiceFB_Utils'
-    build_to  'lib'
-
-    define    'SERVICEFB_DEBUG_LOG' unless ENV['RELEASE']
-    source    'lib/ServiceFB/ServiceFB_Utils.bas'
-    
-    option    OPTIONS
-  end
-end
-# add lib namespace to global tasks
-#include_projects_of :lib
-task :native_lib => "lib:build"
-task :clean => "lib:clobber"
-
-# mongrel_service (native)
-namespace :native do
-  project_task  'mongrel_service' do
-    executable  'mongrel_service'
-    build_to    'bin'
-    
-    define      'DEBUG_LOG' unless ENV['RELEASE']
-    define      "GEM_VERSION=#{GEM_VERSION}"
-    
-    main        'native/mongrel_service.bas'
-    source      'native/process.bas'
-    
-    # including the precompiled file show warnings when linking with
-    # ld, due special m$ directives in the obj file
-    # will solve that later, when migrate the asm part of code to gcc
-    # source      'native/send_signal.o'
-    
-    lib_path    'lib'
-    library     'ServiceFB', 'ServiceFB_Utils'
-    library     'user32', 'advapi32', 'psapi'
-    
-    option      OPTIONS
-  end
-end
-#include_projects_of :native
-task :native_service => "native:build"
-task :clean => "native:clobber"
-
-task :package => [:clean, :compile, :test]
-
-setup_gem(GEM_NAME, GEM_VERSION) do |spec|
-  spec.summary = "Mongrel Native Win32 Service Plugin for Rails"
-  spec.summary += " (debug build)" unless ENV['RELEASE']
-  spec.description = "This plugin offer native win32 services for rails, powered by Mongrel."
-  spec.author = "Luis Lavena"
-  spec.platform = Gem::Platform::WIN32
-  
-  spec.files -= Dir["bin/**/*"]
-  spec.files -= Dir["**/*.{o,a}"]
-  spec.files += Dir["native/**/*.{bas,bi}"]
-  spec.files += ["bin/mongrel_service.exe"]
-  
-  spec.add_dependency('gem_plugin', '>= 0.2.1')
-  spec.add_dependency('mongrel', '>= 0.3.12.4')
-  spec.add_dependency('win32-service', '>= 0.5.0')
-  
-  spec.files += Dir.glob("resources/**/*")
-end
-
-task :install => [:test, :package] do
-  sh %{gem install pkg/#{name}-#{version}.gem}
-end
-
-task :uninstall => [:clean] do
-  sh %{gem uninstall #{name}}
-end
-
+
+require 'echoe'
+require 'tools/freebasic'
+
+echoe_spec = Echoe.new("mongrel_service") do |p|
+  p.summary = "Mongrel Native Win32 Service Plugin for Rails"
+  p.summary += " (debug build)" unless ENV['RELEASE']
+  p.description = "This plugin offer native win32 services for rails, powered by Mongrel."
+  p.author = "Luis Lavena"
+  p.platform = Gem::Platform::WIN32
+  p.dependencies = ['gem_plugin >=0.2.1', 'mongrel >=0.3.12.4', 'win32-service >=0.5.0']
+
+  p.need_tar_gz = false
+  p.need_zip = true
+  p.certificate_chain = ['/Users/eweaver/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem',
+    '/Users/eweaver/p/configuration/gem_certificates/evan_weaver-mongrel-public_cert.pem']    
+  p.require_signed = true
+end
+
+desc "Compile native code"
+task :compile => [:native_lib, :native_service]
+
+task :"bin/mongrel_service.exe" => [:clean, :compile]
+
+# global options shared by all the project in this Rakefile
+OPTIONS = {
+  :debug => false,
+  :profile => false,
+  :errorchecking => :ex,
+  :mt => true,
+  :pedantic => true }
+
+OPTIONS[:debug] = true if ENV['DEBUG']
+OPTIONS[:profile] = true if ENV['PROFILE']
+OPTIONS[:errorchecking] = :exx if ENV['EXX']
+OPTIONS[:pedantic] = false if ENV['NOPEDANTIC']
+
+# ServiceFB namespace (lib)
+namespace :lib do
+  project_task 'servicefb' do
+    lib       'ServiceFB'
+    build_to  'lib'
+
+    define    'SERVICEFB_DEBUG_LOG' unless ENV['RELEASE']
+    source    'lib/ServiceFB/ServiceFB.bas'
+    
+    option    OPTIONS
+  end
+  
+  project_task 'servicefb_utils' do
+    lib       'ServiceFB_Utils'
+    build_to  'lib'
+
+    define    'SERVICEFB_DEBUG_LOG' unless ENV['RELEASE']
+    source    'lib/ServiceFB/ServiceFB_Utils.bas'
+    
+    option    OPTIONS
+  end
+end
+# add lib namespace to global tasks
+#include_projects_of :lib
+task :native_lib => "lib:build"
+task :clean => "lib:clobber"
+
+# mongrel_service (native)
+namespace :native do
+  project_task  'mongrel_service' do
+    executable  'mongrel_service'
+    build_to    'bin'
+    
+    define      'DEBUG_LOG' unless ENV['RELEASE']
+    define      "GEM_VERSION=#{echoe_spec.version}"
+    
+    main        'native/mongrel_service.bas'
+    source      'native/process.bas'
+    
+    # including the precompiled file show warnings when linking with
+    # ld, due pial m$ directives in the obj file
+    # will solve that later, when migrate the asm part of code to gcc
+    # source      'native/send_signal.o'
+    
+    lib_path    'lib'
+    library     'ServiceFB', 'ServiceFB_Utils'
+    library     'user32', 'advapi32', 'psapi'
+    
+    option      OPTIONS
+  end
+end
+#include_projects_of :native
+task :native_service => "native:build"
+task :clean => "native:clobber"
+
diff --git a/projects/mongrel_service/tools/rakehelp.rb b/projects/mongrel_service/tools/rakehelp.rb
deleted file mode 100644
index 3e167cf..0000000
--- a/projects/mongrel_service/tools/rakehelp.rb
+++ /dev/null
@@ -1,106 +0,0 @@
-
-def make(makedir)
-    Dir.chdir(makedir) do
-        sh(PLATFORM =~ /win32/ ? 'nmake' : 'make')
-    end
-end
-
-
-def extconf(dir)
-    Dir.chdir(dir) do ruby "extconf.rb" end
-end
-
-
-def setup_tests
-    Rake::TestTask.new do |t|
-        t.libs << "test"
-        t.test_files = FileList['test/test*.rb']
-        t.verbose = true
-    end
-end
-
-
-def setup_clean otherfiles
-    files = ['build/*', '**/*.o', '**/*.so', '**/*.a', 'lib/*-*', '**/*.log'] + otherfiles
-    CLEAN.include(files)
-end
-
-
-def setup_rdoc files
-    Rake::RDocTask.new do |rdoc|
-        rdoc.rdoc_dir = 'doc/rdoc'
-        rdoc.options << '--line-numbers'
-        rdoc.rdoc_files.add(files)
-    end
-end
-
-
-def setup_extension(dir, extension)
-    ext = "ext/#{dir}"
-    ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
-    ext_files = FileList[
-    "#{ext}/*.c",
-    "#{ext}/*.h",
-    "#{ext}/extconf.rb",
-    "#{ext}/Makefile",
-    "lib"
-    ]
-    
-    task "lib" do
-        directory "lib"
-    end
-
-    desc "Builds just the #{extension} extension"
-    task extension.to_sym => ["#{ext}/Makefile", ext_so ]
-
-    file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
-        extconf "#{ext}"
-    end
-
-    file ext_so => ext_files do
-        make "#{ext}"
-        cp ext_so, "lib"
-    end
-end
-
-
-def base_gem_spec(pkg_name, pkg_version)
-  pkg_version = pkg_version
-  pkg_name    = pkg_name
-  pkg_file_name = "#{pkg_name}-#{pkg_version}"
-  Gem::Specification.new do |s|
-    s.name = pkg_name
-    s.version = pkg_version
-    s.platform = Gem::Platform::RUBY
-    s.has_rdoc = true
-    s.extra_rdoc_files = [ "README" ]
-    
-    s.files = %w(COPYING LICENSE README Rakefile) +
-      Dir.glob("{bin,doc/rdoc,test,lib}/**/*") +
-      Dir.glob("ext/**/*.{h,c,rb}") +
-      Dir.glob("examples/**/*.rb") +
-      Dir.glob("tools/*.rb")
-    
-    s.require_path = "lib"
-    s.extensions = FileList["ext/**/extconf.rb"].to_a
-    s.bindir = "bin"
-  end
-end
-
-def setup_gem(pkg_name, pkg_version)
-  spec = base_gem_spec(pkg_name, pkg_version)
-  yield spec if block_given?
-    
-  Rake::GemPackageTask.new(spec) do |p|
-    p.gem_spec = spec
-    # win32 chokes on this
-    p.need_tar = true if RUBY_PLATFORM !~ /mswin/
-  end
-end
-
-def setup_win32_gem(pkg_name, pkg_version)
-  spec = base_gem_spec(pkg_name, pkg_version)
-  yield spec if block_given?
-
-  Gem::Builder.new(spec).build
-end