electrum-bitcoinprivate/make_packages

59 lines
2.1 KiB
Plaintext
Raw Normal View History

2012-12-06 22:43:16 -08:00
#!/usr/bin/python
from lib.version import ELECTRUM_VERSION as version
if __name__ == '__main__':
import sys, re, shutil, os, hashlib
if not ( os.path.exists('aes') and os.path.exists('ecdsa') ):
print "aes and ecdsa are missing. copy them locally before."
sys.exit()
os.system("python mki18n.py")
os.system("pyrcc4 icons.qrc -o gui/qt/icons_rc.py")
2012-12-06 22:43:16 -08:00
os.system("python setup.py sdist --format=zip,gztar")
_tgz="Electrum-%s.tar.gz"%version
_zip="Electrum-%s.zip"%version
# android
os.system('rm -rf dist/e4a-%s'%version)
os.mkdir('dist/e4a-%s'%version)
2013-03-12 05:48:16 -07:00
shutil.copyfile("electrum",'dist/e4a-%s/e4a.py'%version)
2012-12-06 22:43:16 -08:00
shutil.copytree("ecdsa",'dist/e4a-%s/ecdsa'%version)
shutil.copytree("aes",'dist/e4a-%s/aes'%version)
2013-03-12 05:48:16 -07:00
shutil.copytree("lib",'dist/e4a-%s/lib'%version)
os.mkdir('dist/e4a-%s/gui'%version)
2013-10-07 04:26:10 -07:00
for n in ['android.py']:
2013-03-24 05:08:41 -07:00
shutil.copy("gui/%s"%n,'dist/e4a-%s/gui'%version)
2013-03-20 14:34:24 -07:00
open('dist/e4a-%s/gui/__init__.py'%version,'w').close()
2012-12-06 22:43:16 -08:00
os.chdir("dist")
2012-12-06 22:43:16 -08:00
# create the zip file
os.system( "zip -r e4a-%s.zip e4a-%s"%(version, version) )
2013-04-13 09:50:17 -07:00
os.system( "rm -rf e4a-%s"%(version) )
# change filename because some 3G carriers do not allow users to download a zip file...
e4a_name = "e4a-%s.zip"%version
e4a_name2 = e4a_name.replace(".","")
2013-04-13 09:50:17 -07:00
os.system( "mv %s %s"%(e4a_name, e4a_name2) )
2012-12-06 22:43:16 -08:00
2013-12-16 13:19:23 -08:00
import getpass
password = getpass.getpass("Password:")
for f in os.listdir("."):
os.system( "gpg --sign --armor --detach --passphrase \"%s\" %s"%(password, f) )
md5_tgz = hashlib.md5(file(_tgz, 'r').read()).digest().encode('hex')
md5_zip = hashlib.md5(file(_zip, 'r').read()).digest().encode('hex')
md5_android = hashlib.md5(file(e4a_name2, 'r').read()).digest().encode('hex')
os.chdir("..")
2012-12-06 22:43:16 -08:00
print ""
print "Packages are ready:"
print "dist/%s "%_tgz, md5_tgz
print "dist/%s "%_zip, md5_zip
2012-12-18 08:18:03 -08:00
print "dist/%s "%e4a_name2, md5_android
print "To make a release, upload the files to the server, and update the webpages in branch gh-pages"
2012-12-06 22:43:16 -08:00