borg.exe.spec 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # -*- mode: python -*-
  2. # this pyinstaller spec file is used to build borg binaries on posix platforms
  3. import os, sys
  4. # Note: SPEC contains the spec file argument given to pyinstaller
  5. here = os.path.dirname(os.path.abspath(SPEC))
  6. basepath = os.path.abspath(os.path.join(here, '..'))
  7. block_cipher = None
  8. a = Analysis([os.path.join(basepath, 'src/borg/__main__.py'), ],
  9. pathex=[basepath, ],
  10. binaries=[],
  11. datas=[
  12. ('../src/borg/paperkey.html', 'borg'),
  13. ],
  14. hiddenimports=['borg.platform.posix'],
  15. hookspath=[],
  16. runtime_hooks=[],
  17. excludes=[
  18. '_ssl', 'ssl',
  19. ],
  20. win_no_prefer_redirects=False,
  21. win_private_assemblies=False,
  22. cipher=block_cipher)
  23. if sys.platform == 'darwin':
  24. # do not bundle the osxfuse libraries, so we do not get a version
  25. # mismatch to the installed kernel driver of osxfuse.
  26. a.binaries = [b for b in a.binaries if 'libosxfuse' not in b[0]]
  27. pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
  28. exe = EXE(pyz,
  29. a.scripts,
  30. a.binaries,
  31. a.zipfiles,
  32. a.datas,
  33. name='borg.exe',
  34. debug=False,
  35. strip=False,
  36. upx=True,
  37. console=True )
  38. # Build a directory-based binary in addition to a packed
  39. # single file. This allows one to easily look at all included
  40. # files (e.g. without having to strace or halt the built binary
  41. # and introspect /tmp). Also avoids unpacking all libs when
  42. # running the app, which is better for app signing on various OS.
  43. slim_exe = EXE(pyz,
  44. a.scripts,
  45. exclude_binaries=True,
  46. name='borg.exe',
  47. debug=False,
  48. strip=False,
  49. upx=False,
  50. console=True)
  51. coll = COLLECT(slim_exe,
  52. a.binaries,
  53. a.zipfiles,
  54. a.datas,
  55. strip=False,
  56. upx=False,
  57. name='borg-dir')