/admin/mac/sign_bundle.rb

http://github.com/tomahawk-player/tomahawk · Ruby · 14 lines · 13 code · 0 blank · 1 comment · 1 complexity · 09d981781003f58bbbe7c71de6aec4d0 MD5 · raw file

  1. #!/usr/bin/ruby
  2. if ARGV.length < 2
  3. puts "Usage: ruby sign_update.rb version private_key_file"
  4. puts "\nCall this from the build directory."
  5. puts "If you don't have the tomahawk private key and you think you should, ask leo :)"
  6. exit
  7. end
  8. tarball = "#{ARGV[0].downcase}-#{ARGV[1]}.tar.bz2"
  9. puts "Zipping: #{tarball}..."
  10. `tar jcvf "#{tarball}" #{ARGV[0]}.app`
  11. puts "Signing..."
  12. puts `openssl dgst -sha1 -binary < "#{tarball}" | openssl dgst -dss1 -sign "#{ARGV[2]}" | openssl enc -base64`