2017-06-08 01:03:11 +00:00
|
|
|
# -*- mode: python -*-
|
|
|
|
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
|
|
from distutils.sysconfig import get_python_lib
|
|
|
|
import hashlib
|
|
|
|
import os
|
|
|
|
import platform
|
|
|
|
import shutil
|
|
|
|
import struct
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
2022-02-15 15:12:31 +00:00
|
|
|
try:
|
|
|
|
import allmydata
|
|
|
|
del allmydata
|
|
|
|
except ImportError:
|
2017-06-08 01:03:11 +00:00
|
|
|
sys.exit("Please run inside a virtualenv with Tahoe-LAFS installed.")
|
|
|
|
|
|
|
|
|
|
|
|
options = [('u', None, 'OPTION')] # Unbuffered stdio
|
|
|
|
|
|
|
|
added_files = [
|
|
|
|
('COPYING.*', '.'),
|
|
|
|
('CREDITS', '.'),
|
|
|
|
('relnotes.txt', '.'),
|
|
|
|
('src/allmydata/web/*.xhtml', 'allmydata/web'),
|
|
|
|
('src/allmydata/web/static/*', 'allmydata/web/static'),
|
|
|
|
('src/allmydata/web/static/css/*', 'allmydata/web/static/css'),
|
|
|
|
('src/allmydata/web/static/img/*.png', 'allmydata/web/static/img')]
|
|
|
|
|
2018-03-29 18:11:15 +00:00
|
|
|
hidden_imports = [
|
2020-07-03 17:44:47 +00:00
|
|
|
'__builtin__',
|
2018-03-29 18:11:15 +00:00
|
|
|
'allmydata.client',
|
|
|
|
'allmydata.introducer',
|
|
|
|
'allmydata.stats',
|
2020-07-03 17:44:47 +00:00
|
|
|
'base64',
|
2018-03-29 18:11:15 +00:00
|
|
|
'cffi',
|
2023-01-27 15:02:59 +00:00
|
|
|
'charset_normalizer.md__mypyc',
|
2020-07-03 17:44:47 +00:00
|
|
|
'collections',
|
|
|
|
'commands',
|
2018-03-29 18:11:15 +00:00
|
|
|
'Crypto',
|
2020-07-03 17:44:47 +00:00
|
|
|
'functools',
|
|
|
|
'future.backports.misc',
|
|
|
|
'itertools',
|
|
|
|
'math',
|
2018-03-29 18:11:15 +00:00
|
|
|
'packaging.specifiers',
|
2020-07-03 17:44:47 +00:00
|
|
|
're',
|
|
|
|
'reprlib',
|
2018-03-29 18:11:15 +00:00
|
|
|
'six.moves.html_parser',
|
2020-07-03 17:44:47 +00:00
|
|
|
'subprocess',
|
|
|
|
'UserDict',
|
|
|
|
'UserList',
|
|
|
|
'UserString',
|
2018-03-29 18:11:15 +00:00
|
|
|
'yaml',
|
2020-07-03 17:44:47 +00:00
|
|
|
'zfec',
|
2018-03-29 18:11:15 +00:00
|
|
|
]
|
|
|
|
|
2017-06-08 01:03:11 +00:00
|
|
|
a = Analysis(
|
|
|
|
['static/tahoe.py'],
|
|
|
|
pathex=[],
|
|
|
|
binaries=None,
|
|
|
|
datas=added_files,
|
2018-03-29 18:11:15 +00:00
|
|
|
hiddenimports=hidden_imports,
|
2017-06-08 01:03:11 +00:00
|
|
|
hookspath=[],
|
|
|
|
runtime_hooks=[],
|
|
|
|
excludes=[],
|
|
|
|
win_no_prefer_redirects=False,
|
|
|
|
win_private_assemblies=False,
|
|
|
|
cipher=None)
|
|
|
|
|
|
|
|
pyz = PYZ(
|
|
|
|
a.pure,
|
|
|
|
a.zipped_data,
|
|
|
|
cipher=None)
|
|
|
|
|
|
|
|
exe = EXE(
|
|
|
|
pyz,
|
|
|
|
a.scripts,
|
|
|
|
options,
|
|
|
|
exclude_binaries=True,
|
|
|
|
name='tahoe',
|
|
|
|
debug=False,
|
|
|
|
strip=False,
|
|
|
|
upx=False,
|
|
|
|
console=True)
|
|
|
|
|
|
|
|
coll = COLLECT(
|
|
|
|
exe,
|
|
|
|
a.binaries,
|
|
|
|
a.zipfiles,
|
|
|
|
a.datas,
|
|
|
|
strip=False,
|
|
|
|
upx=False,
|
|
|
|
name='Tahoe-LAFS')
|
|
|
|
|
|
|
|
|
|
|
|
print("Creating archive...")
|
|
|
|
platform_tag = platform.system().replace('Darwin', 'MacOS')
|
|
|
|
bitness_tag = str(struct.calcsize('P') * 8) + 'bit'
|
|
|
|
archive_name = 'Tahoe-LAFS-{}-{}'.format(platform_tag, bitness_tag)
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
archive_format = 'zip'
|
|
|
|
archive_suffix = '.zip'
|
|
|
|
else:
|
|
|
|
archive_format = 'gztar'
|
|
|
|
archive_suffix = '.tar.gz'
|
|
|
|
base_name = os.path.join('dist', archive_name)
|
|
|
|
shutil.make_archive(base_name, archive_format, 'dist', 'Tahoe-LAFS')
|
|
|
|
|
|
|
|
print("Hashing (SHA256)...")
|
|
|
|
archive_path = base_name + archive_suffix
|
|
|
|
hasher = hashlib.sha256()
|
|
|
|
with open(archive_path, 'rb') as f:
|
|
|
|
for block in iter(lambda: f.read(4096), b''):
|
|
|
|
hasher.update(block)
|
|
|
|
print("{} {}".format(hasher.hexdigest(), archive_path))
|