Rakefile
changeset 3 7f6da371e2ce
parent 2 0c24586f579a
--- a/Rakefile	Thu Oct 16 02:43:08 2008 +0000
+++ b/Rakefile	Thu Nov 20 16:43:02 2008 +0000
@@ -45,11 +45,21 @@
 PROJECT_NAME  = 'jparallel'
 PKG_NAME      = PROJECT_NAME.downcase
 PKG_SUMMARY   = 'A "parallel jail shell" written in Ruby'
+
 VERSION_FILE  = LIBDIR + 'jparallel.rb'
-PKG_VERSION   = VERSION_FILE.read[ /VERSION\s*=\s*'(\d+\.\d+\.\d+)'/, 1 ]
+if VERSION_FILE.exist? && buildrev = ENV['CC_BUILD_LABEL']
+	PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ] + '.' + buildrev
+elsif VERSION_FILE.exist?
+	PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ]
+else
+	PKG_VERSION = '0.0.0'
+end
+
 PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}"
 GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem"
 
+EXTCONF       = EXTDIR + 'extconf.rb'
+
 ARTIFACTS_DIR = Pathname.new( ENV['CC_BUILD_ARTIFACTS'] || 'artifacts' )
 
 TEXT_FILES    = %w( Rakefile ChangeLog README LICENSE ).collect {|filename| BASEDIR + filename }
@@ -124,7 +134,7 @@
 	'-SHN',
 	'-i', '.',
 	'-m', 'README',
-	'-W', 'http://deveiate.org/projects/Jparallel//browser/trunk/'
+	'-W', 'http://deveiate.org/projects/jParallel//browser/trunk/'
   ]
 
 # Release constants
@@ -180,14 +190,17 @@
 
 	gem.authors           = 'Michael Granger and Mahlon Smith'
 	gem.email             = 'ged@FaerieMUD.org, mahlon@martini.nu'
-	gem.homepage          = 'http://deveiate.org/projects/Jparallel/'
+	gem.homepage          = 'http://deveiate.org/projects/jParallel/'
 	gem.rubyforge_project = RUBYFORGE_PROJECT
 
 	gem.has_rdoc          = true
 	gem.rdoc_options      = RDOC_OPTIONS
 
 	gem.bindir            = BINDIR.relative_path_from(BASEDIR).to_s
-	
+
+	if EXTCONF.exist?
+		gem.extensions << EXTCONF.relative_path_from( BASEDIR ).to_s
+	end
 
 	gem.files             = RELEASE_FILES.
 		collect {|f| f.relative_path_from(BASEDIR).to_s }
@@ -272,7 +285,7 @@
 desc "Cruisecontrol build"
 task :cruise => [:clean, 'spec:quiet', :package] do |task|
 	raise "Artifacts dir not set." if ARTIFACTS_DIR.to_s.empty?
-	artifact_dir = ARTIFACTS_DIR.cleanpath
+	artifact_dir = ARTIFACTS_DIR.cleanpath + ENV['CC_BUILD_LABEL']
 	artifact_dir.mkpath
 	
 	coverage = BASEDIR + 'coverage'