2017-01-26 19:30:02 +01:00
|
|
|
# -*- mode: python -*-
|
2017-01-31 00:14:18 +01:00
|
|
|
import platform
|
|
|
|
import os
|
|
|
|
|
2017-01-26 19:30:02 +01:00
|
|
|
import lbryum
|
|
|
|
|
2017-02-10 20:11:26 +01:00
|
|
|
|
2017-01-31 00:14:18 +01:00
|
|
|
cwd = os.getcwd()
|
2017-03-16 00:58:36 +01:00
|
|
|
if os.path.basename(cwd) != 'daemon':
|
2017-01-31 00:14:18 +01:00
|
|
|
raise Exception('The build needs to be run from the same directory as the spec file')
|
|
|
|
repo_base = os.path.abspath(os.path.join(cwd, '..'))
|
|
|
|
|
2017-02-10 20:11:26 +01:00
|
|
|
|
2017-01-31 00:14:18 +01:00
|
|
|
system = platform.system()
|
|
|
|
if system == 'Darwin':
|
|
|
|
icns = os.path.join(repo_base, 'build', 'icon.icns')
|
2017-02-10 20:11:26 +01:00
|
|
|
elif system == 'Linux':
|
|
|
|
icns = os.path.join(repo_base, 'build', 'icons', '256x256.png')
|
|
|
|
elif system == 'Windows':
|
|
|
|
icns = os.path.join(repo_base, 'build', 'icons', 'lbry256.ico')
|
2017-01-31 00:14:18 +01:00
|
|
|
else:
|
2017-02-10 20:11:26 +01:00
|
|
|
print 'Warning: System {} has no icons'.format(system)
|
|
|
|
icns = None
|
|
|
|
|
2017-01-31 00:14:18 +01:00
|
|
|
|
2017-01-26 19:30:02 +01:00
|
|
|
block_cipher = None
|
2017-02-10 20:11:26 +01:00
|
|
|
|
|
|
|
|
2017-01-26 19:30:02 +01:00
|
|
|
languages = (
|
|
|
|
'chinese_simplified.txt', 'japanese.txt', 'spanish.txt',
|
|
|
|
'english.txt', 'portuguese.txt'
|
|
|
|
)
|
|
|
|
|
2017-02-10 20:11:26 +01:00
|
|
|
|
|
|
|
datas = [
|
|
|
|
(
|
|
|
|
os.path.join(os.path.dirname(lbryum.__file__), 'wordlist', language),
|
|
|
|
'lbryum/wordlist'
|
|
|
|
)
|
|
|
|
for language in languages
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2017-01-26 19:30:02 +01:00
|
|
|
a = Analysis(
|
2017-03-16 00:58:36 +01:00
|
|
|
['daemon.py'],
|
2017-01-31 00:14:18 +01:00
|
|
|
pathex=[cwd],
|
2017-01-26 19:30:02 +01:00
|
|
|
binaries=None,
|
2017-02-10 20:11:26 +01:00
|
|
|
datas=datas,
|
2017-01-26 19:30:02 +01:00
|
|
|
hiddenimports=[],
|
|
|
|
hookspath=[],
|
|
|
|
runtime_hooks=[],
|
|
|
|
excludes=[],
|
|
|
|
win_no_prefer_redirects=False,
|
|
|
|
win_private_assemblies=False,
|
|
|
|
cipher=block_cipher
|
|
|
|
)
|
|
|
|
|
2017-02-10 20:11:26 +01:00
|
|
|
|
2017-01-26 19:30:02 +01:00
|
|
|
pyz = PYZ(
|
|
|
|
a.pure, a.zipped_data,
|
|
|
|
cipher=block_cipher
|
|
|
|
)
|
|
|
|
|
2017-02-10 20:11:26 +01:00
|
|
|
|
2017-01-26 19:30:02 +01:00
|
|
|
exe = EXE(
|
|
|
|
pyz,
|
|
|
|
a.scripts,
|
|
|
|
a.binaries,
|
|
|
|
a.zipfiles,
|
|
|
|
a.datas,
|
2017-02-10 20:11:26 +01:00
|
|
|
name='lbrynet-daemon',
|
2017-01-26 19:30:02 +01:00
|
|
|
debug=False,
|
|
|
|
strip=False,
|
|
|
|
upx=True,
|
2017-02-10 20:11:26 +01:00
|
|
|
console=True,
|
2017-01-31 00:14:18 +01:00
|
|
|
icon=icns
|
2017-01-26 19:30:02 +01:00
|
|
|
)
|