electrum-bitcoinprivate/contrib/make_android

40 lines
1.4 KiB
Plaintext
Raw Normal View History

2012-12-06 22:43:16 -08:00
#!/usr/bin/python
if __name__ == '__main__':
import sys, re, shutil, os, hashlib
2015-01-24 23:14:25 -08:00
import imp
os.chdir(os.path.dirname(os.path.realpath(__file__)))
os.chdir('..')
2015-02-24 09:41:29 -08:00
v = imp.load_source('version', 'lib/version.py')
version = v.ELECTRUM_VERSION
2012-12-06 22:43:16 -08:00
2014-06-20 02:55:58 -07:00
if not ( os.path.exists('packages')):
print "The packages directory is missing."
2012-12-06 22:43:16 -08:00
sys.exit()
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)
2015-02-24 09:41:29 -08:00
shutil.copytree("packages",'dist/e4a-%s/packages'%version, ignore=shutil.ignore_patterns('*.pyc'))
shutil.copytree("lib",'dist/e4a-%s/lib'%version, ignore=shutil.ignore_patterns('*.pyc'))
# dns is not used by android app
os.system('rm -rf dist/e4a-%s/packages/dns')
2013-03-12 05:48:16 -07:00
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
2015-02-24 09:41:29 -08:00
os.system( "zip -qr 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(".","")
2015-02-24 09:41:29 -08:00
os.system("mv %s %s"%(e4a_name, e4a_name2))
print "dist/%s"%e4a_name2
2012-12-06 22:43:16 -08:00