source: trunk/pyinstaller.spec

Last change on this file was b856238, checked in by Alexandre Detiste <alexandre.detiste@…>, at 2024-02-15T15:53:34Z

remove old Python2 future statements

  • Property mode set to 100644
File size: 2.5 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    'future.backports.misc',
44    'itertools',
45    'math',
46    'packaging.specifiers',
47    're',
48    'reprlib',
49    'six.moves.html_parser',
50    'subprocess',
51    'UserDict',
52    'UserList',
53    'UserString',
54    'yaml',
55    'zfec',
56]
57
58a = Analysis(
59    ['static/tahoe.py'],
60    pathex=[],
61    binaries=None,
62    datas=added_files,
63    hiddenimports=hidden_imports,
64    hookspath=[],
65    runtime_hooks=[],
66    excludes=[],
67    win_no_prefer_redirects=False,
68    win_private_assemblies=False,
69    cipher=None)
70
71pyz = PYZ(
72    a.pure,
73    a.zipped_data,
74    cipher=None)
75
76exe = EXE(
77    pyz,
78    a.scripts,
79    options,
80    exclude_binaries=True,
81    name='tahoe',
82    debug=False,
83    strip=False,
84    upx=False,
85    console=True)
86
87coll = COLLECT(
88    exe,
89    a.binaries,
90    a.zipfiles,
91    a.datas,
92    strip=False,
93    upx=False,
94    name='Tahoe-LAFS')
95
96
97print("Creating archive...")
98platform_tag = platform.system().replace('Darwin', 'MacOS')
99bitness_tag = str(struct.calcsize('P') * 8) + 'bit'
100archive_name = 'Tahoe-LAFS-{}-{}'.format(platform_tag, bitness_tag)
101if sys.platform == 'win32':
102    archive_format = 'zip'
103    archive_suffix = '.zip'
104else:
105    archive_format = 'gztar'
106    archive_suffix = '.tar.gz'
107base_name = os.path.join('dist', archive_name)
108shutil.make_archive(base_name, archive_format, 'dist', 'Tahoe-LAFS')
109
110print("Hashing (SHA256)...")
111archive_path = base_name + archive_suffix
112hasher = hashlib.sha256()
113with open(archive_path, 'rb') as f:
114    for block in iter(lambda: f.read(4096), b''):
115        hasher.update(block)
116print("{}  {}".format(hasher.hexdigest(), archive_path))
Note: See TracBrowser for help on using the repository browser.