source: trunk/pyinstaller.spec

Last change on this file was 168532d, checked in by Alexandre Detiste <alexandre.detiste@…>, at 2024-12-21T18:03:57Z

finish removing "future"

  • Property mode set to 100644
File size: 2.4 KB
Line 
1# -*- mode: python -*-
2
3
4from distutils.sysconfig import get_python_lib
5import hashlib
6import os
7import platform
8import shutil
9import struct
10import sys
11
12
13try:
14    import allmydata
15    del allmydata
16except ImportError:
17    sys.exit("Please run inside a virtualenv with Tahoe-LAFS installed.")
18
19
20options = [('u', None, 'OPTION')]  # Unbuffered stdio
21
22added_files = [
23    ('COPYING.*', '.'),
24    ('CREDITS', '.'),
25    ('relnotes.txt', '.'),
26    ('src/allmydata/web/*.xhtml', 'allmydata/web'),
27    ('src/allmydata/web/static/*', 'allmydata/web/static'),
28    ('src/allmydata/web/static/css/*', 'allmydata/web/static/css'),
29    ('src/allmydata/web/static/img/*.png', 'allmydata/web/static/img')]
30
31hidden_imports = [
32    '__builtin__',
33    'allmydata.client',
34    'allmydata.introducer',
35    'allmydata.stats',
36    'base64',
37    'cffi',
38    'charset_normalizer.md__mypyc',
39    'collections',
40    'commands',
41    'Crypto',
42    'functools',
43    'itertools',
44    'math',
45    'packaging.specifiers',
46    're',
47    'reprlib',
48    'six.moves.html_parser',
49    'subprocess',
50    'UserDict',
51    'UserList',
52    'UserString',
53    'yaml',
54    'zfec',
55]
56
57a = Analysis(
58    ['static/tahoe.py'],
59    pathex=[],
60    binaries=None,
61    datas=added_files,
62    hiddenimports=hidden_imports,
63    hookspath=[],
64    runtime_hooks=[],
65    excludes=[],
66    win_no_prefer_redirects=False,
67    win_private_assemblies=False,
68    cipher=None)
69
70pyz = PYZ(
71    a.pure,
72    a.zipped_data,
73    cipher=None)
74
75exe = EXE(
76    pyz,
77    a.scripts,
78    options,
79    exclude_binaries=True,
80    name='tahoe',
81    debug=False,
82    strip=False,
83    upx=False,
84    console=True)
85
86coll = COLLECT(
87    exe,
88    a.binaries,
89    a.zipfiles,
90    a.datas,
91    strip=False,
92    upx=False,
93    name='Tahoe-LAFS')
94
95
96print("Creating archive...")
97platform_tag = platform.system().replace('Darwin', 'MacOS')
98bitness_tag = str(struct.calcsize('P') * 8) + 'bit'
99archive_name = 'Tahoe-LAFS-{}-{}'.format(platform_tag, bitness_tag)
100if sys.platform == 'win32':
101    archive_format = 'zip'
102    archive_suffix = '.zip'
103else:
104    archive_format = 'gztar'
105    archive_suffix = '.tar.gz'
106base_name = os.path.join('dist', archive_name)
107shutil.make_archive(base_name, archive_format, 'dist', 'Tahoe-LAFS')
108
109print("Hashing (SHA256)...")
110archive_path = base_name + archive_suffix
111hasher = hashlib.sha256()
112with open(archive_path, 'rb') as f:
113    for block in iter(lambda: f.read(4096), b''):
114        hasher.update(block)
115print("{}  {}".format(hasher.hexdigest(), archive_path))
Note: See TracBrowser for help on using the repository browser.