From: <jh...@us...> - 2009-11-14 21:42:50
|
Revision: 166 http://etch.svn.sourceforge.net/etch/?rev=166&view=rev Author: jheiss Date: 2009-11-14 21:42:41 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Update macport task to set checksums in portfile. Modified Paths: -------------- trunk/client/Portfile trunk/client/Rakefile Modified: trunk/client/Portfile =================================================================== --- trunk/client/Portfile 2009-11-14 19:20:11 UTC (rev 165) +++ trunk/client/Portfile 2009-11-14 21:42:41 UTC (rev 166) @@ -24,9 +24,9 @@ master_sites sourceforge -checksums md5 e462d44552ce628b2a2e121eb5825b62 \ - sha1 0cee484b291e89adaa46b1fccc763e14ccb41f90 \ - rmd160 5221532a9bba2b93274a8fd419dc4da6ec965e5e +checksums md5 %MD5% \ + sha1 %SHA1% \ + rmd160 %RMD160% depends_build port:rb-rake depends_run port:ruby \ Modified: trunk/client/Rakefile =================================================================== --- trunk/client/Rakefile 2009-11-14 19:20:11 UTC (rev 165) +++ trunk/client/Rakefile 2009-11-14 21:42:41 UTC (rev 166) @@ -1,8 +1,11 @@ require 'rbconfig' require 'tempfile' require 'tmpdir' +require 'open-uri' ETCHVER = IO.read('../VERSION').chomp +TARBALLFILE = "etch-#{ETCHVER}.tar.gz" +TARBALL = File.expand_path(TARBALLFILE) BUILDROOT = '/var/tmp/etch-client-buildroot' @@ -385,13 +388,33 @@ :installbase => '/') end +desc 'Fetch tarball from sourceforge' +task :fetch do + if !File.exist?(TARBALL) + url = "http://downloads.sourceforge.net/project/etch/etch/#{ETCHVER}/#{TARBALLFILE}?use_mirror=autoselect" + puts "Fetching tarball from #{url}" + open(url) do |df| + open(TARBALL, 'w') do |lf| + lf.write(df.read) + end + end + end +end + desc 'Prepare portfile for submission to MacPorts' -task :macport do +task :macport => :fetch do + md5 = `openssl md5 #{TARBALL}`.chomp.split.last + sha1 = `openssl sha1 #{TARBALL}`.chomp.split.last + rmd160 = `openssl rmd160 #{TARBALL}`.chomp.split.last + portfile = File.join(Dir.tmpdir, 'Portfile') rm_f(portfile) File.open(portfile, 'w') do |newfile| IO.foreach('Portfile') do |line| line.sub!('%VER%', ETCHVER) + line.sub!('%MD5%', md5) + line.sub!('%SHA1%', sha1) + line.sub!('%RMD160%', rmd160) newfile.puts(line) end end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |