incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lalancette <clala...@redhat.com>
Subject [PATCHv3 1/4] Bugfixes to the fedora spec file.
Date Tue, 31 May 2011 20:07:39 GMT
There are a few changes here:
1)  Remove the patch listings - these are already in the
upstream sources, so no longer necessary
2)  Add some minor cleanups, especially in the area of
prepping an "installation" area.
3)  Whitespace fixes
4)  Remove deltacloudd and add deltacloudd-fedora, to match
what we are doing with fedora.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
---
 server/support/fedora/deltacloud-core.spec |    9 +--
 server/support/fedora/deltacloudd          |  128 ----------------------------
 server/support/fedora/deltacloudd-fedora   |    5 +
 3 files changed, 8 insertions(+), 134 deletions(-)
 delete mode 100755 server/support/fedora/deltacloudd
 create mode 100644 server/support/fedora/deltacloudd-fedora

diff --git a/server/support/fedora/deltacloud-core.spec b/server/support/fedora/deltacloud-core.spec
index be07a17..e3ec1a8 100644
--- a/server/support/fedora/deltacloud-core.spec
+++ b/server/support/fedora/deltacloud-core.spec
@@ -10,8 +10,6 @@ URL: http://incubator.apache.org/deltacloud
 Source0: http://gems.rubyforge.org/gems/%{name}-%{version}.gem
 Source1: deltacloudd-fedora
 Source2: deltacloud-core
-Patch0: fix_load_balancers.patch
-Patch1: fix_rhevm_memory_calculation.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: rubygems
 Requires: ruby(abi) = 1.8
@@ -52,22 +50,21 @@ which implements the REST interface.
 %package doc
 Summary: Documentation for %{name}
 Group: Documentation
-Requires:%{name} = %{version}-%{release}
+Requires: %{name} = %{version}-%{release}
 
 %description doc
 Documentation for %{name}
 
 %prep
-%setup -q -c -T 
+%setup -q -c -T
 gem unpack -V --target=%{_builddir} %{SOURCE0}
 pushd %{_builddir}/%{name}-%{version}
-%patch0
-%patch1
 popd
 
 %build
 
 %install
+rm -rf %{buildroot}
 mkdir -p %{buildroot}%{app_root}
 mkdir -p %{buildroot}%{_initddir}
 mkdir -p %{buildroot}%{_bindir}
diff --git a/server/support/fedora/deltacloudd b/server/support/fedora/deltacloudd
deleted file mode 100755
index 70be6ca..0000000
--- a/server/support/fedora/deltacloudd
+++ /dev/null
@@ -1,128 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'rubygems'
-require 'optparse'
-
-# See if we can require +name+ and return +true+ if the library is there,
-# +false+ otherwise. Note that, as a side effect, the library will be
-# loaded
-def library_present?(name)
-  begin
-    require name
-    true
-  rescue LoadError
-    false
-  end
-end
-
-options = {
-  :env => 'development'
-}
-optparse = OptionParser.new do |opts|
-
-opts.banner = <<BANNER
-Usage:
-deltacloudd -i <driver> [options]
-
-Options:
-BANNER
-  opts.on( '-i', '--driver DRIVER', 'Driver to use') do |driver|
-    ENV["API_DRIVER"] = driver
-  end
-  opts.on( '-r', '--hostname HOSTNAME',
-           'Bind to HOST address (default: localhost)') do |host|
-    ENV["API_HOST"] = host
-  end
-  opts.on( '-p', '--port PORT', 'Use PORT (default: 3001)') do |port|
-    ENV["API_PORT"] = port
-  end
-  opts.on( '-P', '--provider PROVIDER', 'Use PROVIDER (default is set in the driver)') do
|provider|
-    ENV['API_PROVIDER'] = provider
-  end
-  opts.on( '-e', '--env ENV', 'Environment (default: "development")') { |env| options[:env]
= env }
-  opts.on( '-h', '--help', '') { options[:help] = true }
-end
-
-optparse.parse!
-
-if options[:help]
- puts optparse
- exit(0)
-end
-
-unless ENV["API_DRIVER"]
-  puts "You need to specify a driver to use (-i <driver>)"
-  exit(1)
-end
-
-ENV["API_HOST"] = "localhost" unless ENV["API_HOST"]
-ENV["API_PORT"] = "3001" unless ENV["API_PORT"]
-
-msg = "Starting Deltacloud API :: #{ENV["API_DRIVER"]} "
-msg << ":: #{ENV['API_PROVIDER']} " if ENV['API_PROVIDER']
-msg << ":: http://#{ENV["API_HOST"]}:#{ENV["API_PORT"]}/api"
-puts msg
-puts
-
-dirname="#{File.dirname(__FILE__)}/.."
-
-have_thin = library_present?('thin')
-have_rerun = library_present?('rerun')
-
-unless have_thin
-  require 'rack'
-
-  # We can't chdir with webrick so add our root directory
-  # onto the load path
-  $: << dirname
-
-  # Read in config.ru and convert it to an instance of Rack::Builder
-  cfgfile = File.read(File.join(dirname, 'config.ru'))
-  inner_app = eval("Rack::Builder.new {(" + cfgfile + "\n )}.to_app",
-                   nil, 'config.ru')
-
-  app = Rack::Builder.new {
-    use Rack::CommonLogger # apache-like logging
-    use Rack::Reloader if options[:env] == "development"
-    set :root, dirname # Set Sinatra root since we can't chdir to ../
-    run inner_app
-  }.to_app
-
-  # There's a bug with string ports on JRuby so convert to int
-  # http://jira.codehaus.org/browse/JRUBY-4868
-  port = ENV["API_PORT"].to_i
-
-  puts "=> Ctrl-C to shutdown server"
-  Rack::Handler::WEBrick.run(app,
-                             :Host => ENV["API_HOST"],
-                             :Port => port,
-                             :AccessLog => [])
-else
-  argv_opts = ARGV.clone
-  argv_opts << ['start'] unless Thin::Runner.commands.include?(options[0])
-  argv_opts << ['--address', ENV["API_HOST"] ]
-  argv_opts << ['--port', ENV["API_PORT"] ]
-  argv_opts << ['--rackup', 'config.ru' ]
-  argv_opts << ['--chdir', dirname ]
-  argv_opts << ['-e', options[:env] ]
-  argv_opts << ['--threaded', '-D', '--stats', '/stats']
-
-  argv_opts.flatten!
-
-  if have_rerun && options[:env] == "development"
-    argv_opts.unshift "thin"
-    command = argv_opts.join(" ")
-    topdir = File::expand_path(File::join(File::dirname(__FILE__), ".."))
-    rerun = Rerun::Runner.new(command, :dir => topdir)
-    rerun.start
-    rerun.join
-  else
-    thin = Thin::Runner.new(argv_opts)
-
-    begin
-      thin.run!
-    rescue Exception => e
-      puts "ERROR: #{e.message}"
-    end
-  end
-end
diff --git a/server/support/fedora/deltacloudd-fedora b/server/support/fedora/deltacloudd-fedora
new file mode 100644
index 0000000..2afbee4
--- /dev/null
+++ b/server/support/fedora/deltacloudd-fedora
@@ -0,0 +1,5 @@
+#!/usr/bin/ruby
+
+root_path = File.join('/', 'usr', 'share', 'deltacloud-core')
+$:.unshift File.join(root_path, 'lib')
+load File.join(root_path, 'bin', 'deltacloudd')
-- 
1.7.4.4


Mime
View raw message