incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r962307 - in /incubator/deltacloud/trunk/server/support: ./ fedora/ fedora/deltacloudd fedora/rubygem-deltacloud-core.spec
Date Thu, 08 Jul 2010 23:45:10 GMT
Author: lutter
Date: Thu Jul  8 23:45:10 2010
New Revision: 962307

URL: http://svn.apache.org/viewvc?rev=962307&view=rev
Log:
Added Fedora support files (specfile, launcher)

Added:
    incubator/deltacloud/trunk/server/support/
    incubator/deltacloud/trunk/server/support/fedora/
    incubator/deltacloud/trunk/server/support/fedora/deltacloudd   (with props)
    incubator/deltacloud/trunk/server/support/fedora/rubygem-deltacloud-core.spec

Added: incubator/deltacloud/trunk/server/support/fedora/deltacloudd
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/support/fedora/deltacloudd?rev=962307&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/support/fedora/deltacloudd (added)
+++ incubator/deltacloud/trunk/server/support/fedora/deltacloudd Thu Jul  8 23:45:10 2010
@@ -0,0 +1,68 @@
+#!/usr/bin/env ruby
+
+require 'rubygems'
+require 'optparse'
+require 'thin'
+
+options = {
+  :env => 'production'
+}
+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( '-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"]
+
+dirname="#{File.dirname(__FILE__)}/.."
+
+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!
+
+puts "Starting Deltacloud API :: #{ENV["API_DRIVER"]} :: http://#{ENV["API_HOST"]}:#{ENV["API_PORT"]}/api"
+puts
+
+thin = Thin::Runner.new(argv_opts)
+begin
+  thin.run!
+rescue Exception => e
+  puts "ERROR: #{e.message}"
+end

Propchange: incubator/deltacloud/trunk/server/support/fedora/deltacloudd
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/deltacloud/trunk/server/support/fedora/rubygem-deltacloud-core.spec
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/support/fedora/rubygem-deltacloud-core.spec?rev=962307&view=auto
==============================================================================
--- incubator/deltacloud/trunk/server/support/fedora/rubygem-deltacloud-core.spec (added)
+++ incubator/deltacloud/trunk/server/support/fedora/rubygem-deltacloud-core.spec Thu Jul
 8 23:45:10 2010
@@ -0,0 +1,91 @@
+%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
+%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
+%global gemname deltacloud-core
+%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
+
+Summary: Deltacloud REST API
+Name: rubygem-%{gemname}
+Version: 0.0.1
+Release: 2%{?dist}
+Group: Development/Languages
+License: ASL 2.0 and MIT
+URL: http://www.deltacloud.org
+Source0: http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires: rubygems
+Requires: ruby(abi) = 1.8
+Requires: rubygem(eventmachine) >= 0.12.10
+Requires: rubygem(haml) >= 2.2.17
+Requires: rubygem(sinatra) >= 0.9.4
+Requires: rubygem(rack) >= 1.0.0
+Requires: rubygem(thin) >= 1.2.5
+Requires: rubygem(builder) >= 2.1.2
+Requires: rubygem(json) >= 1.2.3
+BuildRequires: ruby-json >= 1.1.9
+BuildRequires: rubygem(rake) >= 0.8.7
+BuildRequires: rubygem(rack-test) >= 0.4.0
+BuildRequires: rubygem(cucumber) >= 0.4.0
+BuildRequires: rubygem(rcov) >= 0.9.6
+BuildRequires: rubygems
+BuildRequires: ruby(abi) = 1.8
+BuildArch: noarch
+Provides: rubygem(%{gemname}) = %{version}
+
+%description
+The Deltacloud API is built as a service-based REST API.
+You do not directly link a Deltacloud library into your program to use it.
+Instead, a client speaks the Deltacloud API over HTTP to a server
+which implements the REST interface.
+
+%prep
+
+%build
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{gemdir}
+gem install --local --install-dir %{buildroot}%{gemdir} \
+            --force --rdoc %{SOURCE0}
+mkdir -p %{buildroot}/%{_bindir}
+mv %{buildroot}%{geminstdir}/support/fedora/deltacloudd %{buildroot}/%{geminstdir}/bin
+mv %{buildroot}%{gemdir}/bin/* %{buildroot}/%{_bindir}
+rmdir %{buildroot}%{gemdir}/bin
+find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x
+
+# Needs json_pure gem / not available in Fedora yet
+#%check
+#pushd %{buildroot}%{geminstdir}
+#cucumber features/*.feature
+#popd
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-, root, root, -)
+%{_bindir}/deltacloudd
+%{gemdir}/gems/%{gemname}-%{version}/bin
+%{gemdir}/gems/%{gemname}-%{version}/lib
+%{gemdir}/gems/%{gemname}-%{version}/public/favicon.ico
+%{gemdir}/gems/%{gemname}-%{version}/public/images
+%{gemdir}/gems/%{gemname}-%{version}/public/stylesheets
+%{gemdir}/gems/%{gemname}-%{version}/tests
+%{gemdir}/gems/%{gemname}-%{version}/views
+%{gemdir}/gems/%{gemname}-%{version}/Rakefile
+%{gemdir}/gems/%{gemname}-%{version}/*.rb
+%{gemdir}/gems/%{gemname}-%{version}/config.ru
+%doc %{gemdir}/gems/%{gemname}-%{version}/support/fedora
+%doc %{gemdir}/gems/%{gemname}-%{version}/COPYING
+%doc %{gemdir}/doc/%{gemname}-%{version}
+%{gemdir}/cache/%{gemname}-%{version}.gem
+%{gemdir}/specifications/%{gemname}-%{version}.gemspec
+# MIT
+%{gemdir}/gems/%{gemname}-%{version}/public/javascripts
+
+%changelog
+* Mon Apr 26 2010 Michal Fojtik <mfojtik@packager> - 0.0.1-1
+- Initial package
+
+* Mon Apr 26 2010 Michal Fojtik <mfojtik@packager> - 0.0.1-2
+- Fixed broken dependencies
+- Added new launcher for Fedora



Mime
View raw message