tests/makedist.rb in rwdgutenberg-0.03 vs tests/makedist.rb in rwdgutenberg-0.04
- old
+ new
@@ -4,26 +4,55 @@
#* Copyright (c) 2004, 2005 by Steven Gibson. All Rights Reserved.
#* at "steven@superant.com".
#***********************************************************************/
require 'fileutils'
-load 'configuration/rwdgutenberg.dist'
+DistroName = "rwdgutenberg"
+load "configuration/#{DistroName}.dist"
+DistroVersion=RwdGutenbergVersion
+
+DistroTitle="#{DistroName}-#{DistroVersion}"
+
+
$progdir = File::expand_path( File.dirname(__FILE__))
results = " "
-puts "creating rwdgutenberg distribution files version #{RwdGutenbergVersion}"
+
+puts "creating #{DistroName} distribution files version #{DistroVersion}"
puts "cleaning conf files"
`tests/cleancnf.sh`
puts "moving up one directory"
Dir.chdir("..")
-zipcreatecmd = "zip -r rwdgutenberg-#{RwdGutenbergVersion}.zip rwdgutenberg"
+
+
+FileUtils.rm_rf("#{DistroTitle}.zip")
+zipcreatecmd = "zip -r #{DistroTitle}.zip #{DistroName}"
puts "#{zipcreatecmd}"
`#{zipcreatecmd}`
- tarcreatecmd = "tar --gzip -cf rwdgutenberg-#{RwdGutenbergVersion}.tar.gz rwdgutenberg"
+ tarcreatecmd = "tar --gzip -cf #{DistroTitle}.tar.gz #{DistroName}"
puts "#{tarcreatecmd}"
`#{tarcreatecmd}`
- tarcreatecmd2 = "tar --bzip2 -cf rwdgutenberg-#{RwdGutenbergVersion}.tar.bz2 rwdgutenberg"
+ tarcreatecmd2 = "tar --bzip2 -cf #{DistroTitle}.tar.bz2 #{DistroName}"
puts "#{tarcreatecmd2}"
`#{tarcreatecmd2}`
-print Dir["rwdgutenberg*.{gz,bz2,deb,gem}"]
+gemspecfilename = "#{DistroTitle}.gemspec"
+tobject = Time.now
+year = tobject.year.to_s
+month = tobject.mon.to_s
+daydate = tobject.day.to_s
+
+fd = File.open(gemspecfilename,"w")
+fd.print("Gem::Specification.new do |s|\n")
+fd.print(" s.name = %q{#{DistroName}}\n")
+fd.print(" s.version = \"#{DistroVersion}\"\n")
+fd.print(" s.date = %q{#{year}-#{month}-#{daydate}}")
+load "#{DistroName}/tests/gemspec"
+fd.print($gemspecvar)
+fd.close
+
+ListingCommand = "ls -1 -s -h #{DistroTitle}*"
+
+puts `#{ListingCommand}`
+
+print "Build finished\n"
\ No newline at end of file