3 if RUBY_PATCHLEVEL.zero?
4 dirname = sprintf 'ruby-%s', RUBY_VERSION
5 tagname = dirname.gsub /ruby-(\d)\.(\d)\.(\d)/, 'v\1_\2_\3'
7 dirname = sprintf 'ruby-%s-p%u', RUBY_VERSION, RUBY_PATCHLEVEL
8 tagname = dirname.gsub /ruby-(\d)\.(\d)\.(\d)-p/, 'v\1_\2_\3_'
10 tgzname = dirname + '.tar.gz'
11 tbzname = dirname + '.tar.bz2'
12 zipname = dirname + '.zip'
13 repos = 'http://svn.ruby-lang.org/repos/ruby/tags/' + tagname
15 STDERR.puts 'exporting sources...'
16 system 'svn', 'export', '-q', repos, dirname
18 STDERR.puts 'generating configure...'
20 system 'rm', '-rf', 'autom4te.cache'
22 STDERR.puts 'generating parse.c...'
23 system 'bison', '-y', '-o', 'parse.c', 'parse.y'
26 STDERR.puts 'generating tarballs...'
28 system 'tar', 'chofzp', tgzname, dirname
29 system 'tar', 'chojfp', tbzname, dirname
30 system 'zip', '-q9r', zipname, dirname
34 for name in [tgzname, tbzname, zipname] do
35 open name, 'rb' do |fp|
37 md5 = Digest::MD5.hexdigest str
38 sha = Digest::SHA256.hexdigest str
39 printf "MD5(%s)= %s\nSHA256(%s)= %s\nSIZE(%s)= %s\n\n",
54 # ruby-indent-level: 3
56 # default-justification: full