lbry-desktop/daemon/cli.onefile.spec

59 lines
1.1 KiB
RPMSpec
Raw Normal View History

2017-01-26 19:30:02 +01:00
# -*- mode: python -*-
2017-01-31 00:14:18 +01:00
import platform
import os
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-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
a = Analysis(
2017-03-16 00:58:36 +01:00
['cli.py'],
2017-01-31 00:14:18 +01:00
pathex=[cwd],
2017-01-26 19:30:02 +01:00
binaries=None,
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
)
pyz = PYZ(
a.pure,
a.zipped_data,
2017-01-26 19:30:02 +01:00
cipher=block_cipher
)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
2017-03-16 00:58:36 +01:00
name='lbrynet-cli',
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
)