X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=make_packages;fp=make_packages;h=4863de7536c41595cc1a57460d82047e9c6bb1e5;hb=437c79eab50e115045289c0f235cff95e9f8aec6;hp=0000000000000000000000000000000000000000;hpb=864974aa48d4072a86e49fe227a78e13884b7488;p=electrum-nvc.git diff --git a/make_packages b/make_packages new file mode 100755 index 0000000..4863de7 --- /dev/null +++ b/make_packages @@ -0,0 +1,53 @@ +#!/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/icons_rc.py") + 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) + shutil.copyfile("electrum",'dist/e4a-%s/e4a.py'%version) + shutil.copytree("ecdsa",'dist/e4a-%s/ecdsa'%version) + shutil.copytree("aes",'dist/e4a-%s/aes'%version) + shutil.copytree("lib",'dist/e4a-%s/lib'%version) + os.mkdir('dist/e4a-%s/gui'%version) + for n in ['gui_android.py', 'pyqrnative.py', 'bmp.py']: + shutil.copy("gui/%s"%n,'dist/e4a-%s/gui'%version) + open('dist/e4a-%s/gui/__init__.py'%version,'w').close() + + os.chdir("dist") + # create the zip file + os.system( "zip -r e4a-%s.zip e4a-%s"%(version, version) ) + 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(".","") + os.system( "mv %s %s"%(e4a_name, e4a_name2) ) + os.chdir("..") + + md5_tgz = hashlib.md5(file('dist/'+_tgz, 'r').read()).digest().encode('hex') + md5_zip = hashlib.md5(file('dist/'+_zip, 'r').read()).digest().encode('hex') + md5_android = hashlib.md5(file('dist/'+e4a_name2, 'r').read()).digest().encode('hex') + + print "" + print "Packages are ready:" + print "dist/%s "%_tgz, md5_tgz + print "dist/%s "%_zip, md5_zip + 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" +