1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-22 08:52:12 +02:00
tomahawk/admin/mac/sign_bundle.rb
2016-01-07 15:20:58 +01:00

15 lines
494 B
Ruby
Executable File

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