borg.exe.spec 1.9 KB

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