setup.py 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. # -*- encoding: utf-8 *-*
  2. import os
  3. import io
  4. import re
  5. import sys
  6. from collections import OrderedDict
  7. from datetime import datetime
  8. from glob import glob
  9. from distutils.command.build import build
  10. from distutils.core import Command
  11. import textwrap
  12. min_python = (3, 4)
  13. my_python = sys.version_info
  14. if my_python < min_python:
  15. print("Borg requires Python %d.%d or later" % min_python)
  16. sys.exit(1)
  17. # Are we building on ReadTheDocs?
  18. on_rtd = os.environ.get('READTHEDOCS')
  19. # msgpack pure python data corruption was fixed in 0.4.6.
  20. # Also, we might use some rather recent API features.
  21. install_requires = ['msgpack-python>=0.4.6', ]
  22. # note for package maintainers: if you package borgbackup for distribution,
  23. # please add llfuse as a *requirement* on all platforms that have a working
  24. # llfuse package. "borg mount" needs llfuse to work.
  25. # if you do not have llfuse, do not require it, most of borgbackup will work.
  26. extras_require = {
  27. # llfuse 0.40 (tested, proven, ok), needs FUSE version >= 2.8.0
  28. # llfuse 0.41 (tested shortly, looks ok), needs FUSE version >= 2.8.0
  29. # llfuse 0.41.1 (tested shortly, looks ok), needs FUSE version >= 2.8.0
  30. # llfuse 0.42 (tested shortly, looks ok), needs FUSE version >= 2.8.0
  31. # llfuse 1.0 (tested shortly, looks ok), needs FUSE version >= 2.8.0
  32. # llfuse 1.1.1 (tested shortly, looks ok), needs FUSE version >= 2.8.0
  33. # llfuse 2.0 will break API
  34. 'fuse': ['llfuse<2.0', ],
  35. }
  36. if sys.platform.startswith('freebsd'):
  37. # llfuse was frequently broken / did not build on freebsd
  38. # llfuse 0.41.1, 1.1 are ok
  39. extras_require['fuse'] = ['llfuse <2.0, !=0.42.*, !=0.43, !=1.0', ]
  40. from setuptools import setup, find_packages, Extension
  41. from setuptools.command.sdist import sdist
  42. compress_source = 'src/borg/compress.pyx'
  43. crypto_source = 'src/borg/crypto.pyx'
  44. chunker_source = 'src/borg/chunker.pyx'
  45. hashindex_source = 'src/borg/hashindex.pyx'
  46. item_source = 'src/borg/item.pyx'
  47. crc32_source = 'src/borg/crc32.pyx'
  48. platform_posix_source = 'src/borg/platform/posix.pyx'
  49. platform_linux_source = 'src/borg/platform/linux.pyx'
  50. platform_darwin_source = 'src/borg/platform/darwin.pyx'
  51. platform_freebsd_source = 'src/borg/platform/freebsd.pyx'
  52. cython_sources = [
  53. compress_source,
  54. crypto_source,
  55. chunker_source,
  56. hashindex_source,
  57. item_source,
  58. crc32_source,
  59. platform_posix_source,
  60. platform_linux_source,
  61. platform_freebsd_source,
  62. platform_darwin_source,
  63. ]
  64. try:
  65. from Cython.Distutils import build_ext
  66. import Cython.Compiler.Main as cython_compiler
  67. class Sdist(sdist):
  68. def __init__(self, *args, **kwargs):
  69. for src in cython_sources:
  70. cython_compiler.compile(src, cython_compiler.default_options)
  71. super().__init__(*args, **kwargs)
  72. def make_distribution(self):
  73. self.filelist.extend([
  74. 'src/borg/compress.c',
  75. 'src/borg/crypto.c',
  76. 'src/borg/chunker.c', 'src/borg/_chunker.c',
  77. 'src/borg/hashindex.c', 'src/borg/_hashindex.c',
  78. 'src/borg/item.c',
  79. 'src/borg/crc32.c',
  80. 'src/borg/_crc32/crc32.c', 'src/borg/_crc32/clmul.c', 'src/borg/_crc32/slice_by_8.c',
  81. 'src/borg/platform/posix.c',
  82. 'src/borg/platform/linux.c',
  83. 'src/borg/platform/freebsd.c',
  84. 'src/borg/platform/darwin.c',
  85. ])
  86. super().make_distribution()
  87. except ImportError:
  88. class Sdist(sdist):
  89. def __init__(self, *args, **kwargs):
  90. raise Exception('Cython is required to run sdist')
  91. compress_source = compress_source.replace('.pyx', '.c')
  92. crypto_source = crypto_source.replace('.pyx', '.c')
  93. chunker_source = chunker_source.replace('.pyx', '.c')
  94. hashindex_source = hashindex_source.replace('.pyx', '.c')
  95. item_source = item_source.replace('.pyx', '.c')
  96. crc32_source = crc32_source.replace('.pyx', '.c')
  97. platform_posix_source = platform_posix_source.replace('.pyx', '.c')
  98. platform_linux_source = platform_linux_source.replace('.pyx', '.c')
  99. platform_freebsd_source = platform_freebsd_source.replace('.pyx', '.c')
  100. platform_darwin_source = platform_darwin_source.replace('.pyx', '.c')
  101. from distutils.command.build_ext import build_ext
  102. if not on_rtd and not all(os.path.exists(path) for path in [
  103. compress_source, crypto_source, chunker_source, hashindex_source, item_source, crc32_source,
  104. platform_posix_source, platform_linux_source, platform_freebsd_source, platform_darwin_source]):
  105. raise ImportError('The GIT version of Borg needs Cython. Install Cython or use a released version.')
  106. def detect_openssl(prefixes):
  107. for prefix in prefixes:
  108. filename = os.path.join(prefix, 'include', 'openssl', 'evp.h')
  109. if os.path.exists(filename):
  110. with open(filename, 'r') as fd:
  111. if 'PKCS5_PBKDF2_HMAC(' in fd.read():
  112. return prefix
  113. def detect_lz4(prefixes):
  114. for prefix in prefixes:
  115. filename = os.path.join(prefix, 'include', 'lz4.h')
  116. if os.path.exists(filename):
  117. with open(filename, 'r') as fd:
  118. if 'LZ4_decompress_safe' in fd.read():
  119. return prefix
  120. def detect_libb2(prefixes):
  121. for prefix in prefixes:
  122. filename = os.path.join(prefix, 'include', 'blake2.h')
  123. if os.path.exists(filename):
  124. with open(filename, 'r') as fd:
  125. if 'blake2b_init' in fd.read():
  126. return prefix
  127. include_dirs = []
  128. library_dirs = []
  129. define_macros = []
  130. crypto_libraries = ['crypto']
  131. possible_openssl_prefixes = ['/usr', '/usr/local', '/usr/local/opt/openssl', '/usr/local/ssl', '/usr/local/openssl',
  132. '/usr/local/borg', '/opt/local', '/opt/pkg', ]
  133. if os.environ.get('BORG_OPENSSL_PREFIX'):
  134. possible_openssl_prefixes.insert(0, os.environ.get('BORG_OPENSSL_PREFIX'))
  135. ssl_prefix = detect_openssl(possible_openssl_prefixes)
  136. if not ssl_prefix:
  137. raise Exception('Unable to find OpenSSL >= 1.0 headers. (Looked here: {})'.format(', '.join(possible_openssl_prefixes)))
  138. include_dirs.append(os.path.join(ssl_prefix, 'include'))
  139. library_dirs.append(os.path.join(ssl_prefix, 'lib'))
  140. possible_lz4_prefixes = ['/usr', '/usr/local', '/usr/local/opt/lz4', '/usr/local/lz4',
  141. '/usr/local/borg', '/opt/local', '/opt/pkg', ]
  142. if os.environ.get('BORG_LZ4_PREFIX'):
  143. possible_lz4_prefixes.insert(0, os.environ.get('BORG_LZ4_PREFIX'))
  144. lz4_prefix = detect_lz4(possible_lz4_prefixes)
  145. if lz4_prefix:
  146. include_dirs.append(os.path.join(lz4_prefix, 'include'))
  147. library_dirs.append(os.path.join(lz4_prefix, 'lib'))
  148. elif not on_rtd:
  149. raise Exception('Unable to find LZ4 headers. (Looked here: {})'.format(', '.join(possible_lz4_prefixes)))
  150. possible_libb2_prefixes = ['/usr', '/usr/local', '/usr/local/opt/libb2', '/usr/local/libb2',
  151. '/usr/local/borg', '/opt/local', '/opt/pkg', ]
  152. if os.environ.get('BORG_LIBB2_PREFIX'):
  153. possible_libb2_prefixes.insert(0, os.environ.get('BORG_LIBB2_PREFIX'))
  154. libb2_prefix = detect_libb2(possible_libb2_prefixes)
  155. if libb2_prefix:
  156. print('Detected and preferring libb2 over bundled BLAKE2')
  157. include_dirs.append(os.path.join(libb2_prefix, 'include'))
  158. library_dirs.append(os.path.join(libb2_prefix, 'lib'))
  159. crypto_libraries.append('b2')
  160. define_macros.append(('BORG_USE_LIBB2', 'YES'))
  161. with open('README.rst', 'r') as fd:
  162. long_description = fd.read()
  163. # remove badges
  164. long_description = re.compile(r'^\.\. start-badges.*^\.\. end-badges', re.M | re.S).sub('', long_description)
  165. # remove |substitutions|
  166. long_description = re.compile(r'\|screencast\|').sub('', long_description)
  167. # remove unknown directives
  168. long_description = re.compile(r'^\.\. highlight:: \w+$', re.M).sub('', long_description)
  169. class build_usage(Command):
  170. description = "generate usage for each command"
  171. user_options = [
  172. ('output=', 'O', 'output directory'),
  173. ]
  174. def initialize_options(self):
  175. pass
  176. def finalize_options(self):
  177. pass
  178. def run(self):
  179. print('generating usage docs')
  180. if not os.path.exists('docs/usage'):
  181. os.mkdir('docs/usage')
  182. # allows us to build docs without the C modules fully loaded during help generation
  183. from borg.archiver import Archiver
  184. parser = Archiver(prog='borg').parser
  185. self.generate_level("", parser, Archiver)
  186. def generate_level(self, prefix, parser, Archiver):
  187. is_subcommand = False
  188. choices = {}
  189. for action in parser._actions:
  190. if action.choices is not None and 'SubParsersAction' in str(action.__class__):
  191. is_subcommand = True
  192. for cmd, parser in action.choices.items():
  193. choices[prefix + cmd] = parser
  194. if prefix and not choices:
  195. return
  196. print('found commands: %s' % list(choices.keys()))
  197. for command, parser in sorted(choices.items()):
  198. if command.startswith('debug'):
  199. print('skipping', command)
  200. continue
  201. print('generating help for %s' % command)
  202. if self.generate_level(command + " ", parser, Archiver):
  203. continue
  204. with open('docs/usage/%s.rst.inc' % command.replace(" ", "_"), 'w') as doc:
  205. doc.write(".. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!\n\n")
  206. if command == 'help':
  207. for topic in Archiver.helptext:
  208. params = {"topic": topic,
  209. "underline": '~' * len('borg help ' + topic)}
  210. doc.write(".. _borg_{topic}:\n\n".format(**params))
  211. doc.write("borg help {topic}\n{underline}\n\n".format(**params))
  212. doc.write(Archiver.helptext[topic])
  213. else:
  214. params = {"command": command,
  215. "command_": command.replace(' ', '_'),
  216. "underline": '-' * len('borg ' + command)}
  217. doc.write(".. _borg_{command_}:\n\n".format(**params))
  218. doc.write("borg {command}\n{underline}\n::\n\n borg {command}".format(**params))
  219. self.write_usage(parser, doc)
  220. epilog = parser.epilog
  221. parser.epilog = None
  222. self.write_options(parser, doc)
  223. doc.write("\n\nDescription\n~~~~~~~~~~~\n")
  224. doc.write(epilog)
  225. if 'create' in choices:
  226. common_options = [group for group in choices['create']._action_groups if group.title == 'Common options'][0]
  227. with open('docs/usage/common-options.rst.inc', 'w') as doc:
  228. self.write_options_group(common_options, doc, False)
  229. return is_subcommand
  230. def write_usage(self, parser, fp):
  231. if any(len(o.option_strings) for o in parser._actions):
  232. fp.write(' <options>')
  233. for option in parser._actions:
  234. if option.option_strings:
  235. continue
  236. fp.write(' ' + option.metavar)
  237. def write_options(self, parser, fp):
  238. for group in parser._action_groups:
  239. if group.title == 'Common options':
  240. fp.write('\n\n`Common options`_\n')
  241. fp.write(' |')
  242. else:
  243. self.write_options_group(group, fp)
  244. def write_options_group(self, group, fp, with_title=True):
  245. def is_positional_group(group):
  246. return any(not o.option_strings for o in group._group_actions)
  247. def get_help(option):
  248. text = textwrap.dedent((option.help or '') % option.__dict__)
  249. return '\n'.join('| ' + line for line in text.splitlines())
  250. def shipout(text):
  251. fp.write(textwrap.indent('\n'.join(text), ' ' * 4))
  252. if not group._group_actions:
  253. return
  254. if with_title:
  255. fp.write('\n\n')
  256. fp.write(group.title + '\n')
  257. text = []
  258. if is_positional_group(group):
  259. for option in group._group_actions:
  260. text.append(option.metavar)
  261. text.append(textwrap.indent(option.help or '', ' ' * 4))
  262. shipout(text)
  263. return
  264. options = []
  265. for option in group._group_actions:
  266. if option.metavar:
  267. option_fmt = '``%%s %s``' % option.metavar
  268. else:
  269. option_fmt = '``%s``'
  270. option_str = ', '.join(option_fmt % s for s in option.option_strings)
  271. options.append((option_str, option))
  272. for option_str, option in options:
  273. help = textwrap.indent(get_help(option), ' ' * 4)
  274. text.append(option_str)
  275. text.append(help)
  276. shipout(text)
  277. class build_man(Command):
  278. description = 'build man pages'
  279. user_options = []
  280. see_also = {
  281. 'create': ('delete', 'prune', 'check', 'patterns', 'placeholders', 'compression'),
  282. 'recreate': ('patterns', 'placeholders', 'compression'),
  283. 'list': ('info', 'diff', 'prune', 'patterns'),
  284. 'info': ('list', 'diff'),
  285. 'init': ('create', 'delete', 'check', 'list', 'key-import', 'key-export', 'key-change-passphrase'),
  286. 'key-import': ('key-export', ),
  287. 'key-export': ('key-import', ),
  288. 'mount': ('umount', 'extract'), # Would be cooler if these two were on the same page
  289. 'umount': ('mount', ),
  290. 'extract': ('mount', ),
  291. }
  292. def initialize_options(self):
  293. pass
  294. def finalize_options(self):
  295. pass
  296. def run(self):
  297. print('building man pages (in docs/man)', file=sys.stderr)
  298. os.makedirs('docs/man', exist_ok=True)
  299. # allows us to build docs without the C modules fully loaded during help generation
  300. from borg.archiver import Archiver
  301. parser = Archiver(prog='borg').parser
  302. self.generate_level('', parser, Archiver)
  303. self.build_topic_pages(Archiver)
  304. def generate_level(self, prefix, parser, Archiver):
  305. is_subcommand = False
  306. choices = {}
  307. for action in parser._actions:
  308. if action.choices is not None and 'SubParsersAction' in str(action.__class__):
  309. is_subcommand = True
  310. for cmd, parser in action.choices.items():
  311. choices[prefix + cmd] = parser
  312. if prefix and not choices:
  313. return
  314. for command, parser in sorted(choices.items()):
  315. if command.startswith('debug') or command == 'help':
  316. continue
  317. man_title = 'borg-' + command.replace(' ', '-')
  318. print('building man page %-40s' % (man_title + '(1)'), end='\r', file=sys.stderr)
  319. if self.generate_level(command + ' ', parser, Archiver):
  320. continue
  321. doc = io.StringIO()
  322. write = self.printer(doc)
  323. self.write_man_header(write, man_title, parser.description)
  324. self.write_heading(write, 'SYNOPSIS')
  325. write('borg', command, end='')
  326. self.write_usage(write, parser)
  327. write('\n')
  328. self.write_heading(write, 'DESCRIPTION')
  329. write(parser.epilog)
  330. self.write_heading(write, 'OPTIONS')
  331. write('See `borg-common(1)` for common options of Borg commands.')
  332. write()
  333. self.write_options(write, parser)
  334. self.write_see_also(write, man_title)
  335. self.gen_man_page(man_title, doc.getvalue())
  336. # Generate the borg-common(1) man page with the common options.
  337. if 'create' in choices:
  338. doc = io.StringIO()
  339. write = self.printer(doc)
  340. man_title = 'borg-common'
  341. self.write_man_header(write, man_title, 'Common options of Borg commands')
  342. common_options = [group for group in choices['create']._action_groups if group.title == 'Common options'][0]
  343. self.write_heading(write, 'SYNOPSIS')
  344. self.write_options_group(write, common_options)
  345. self.write_see_also(write, man_title)
  346. self.gen_man_page(man_title, doc.getvalue())
  347. return is_subcommand
  348. def build_topic_pages(self, Archiver):
  349. for topic, text in Archiver.helptext.items():
  350. doc = io.StringIO()
  351. write = self.printer(doc)
  352. man_title = 'borg-' + topic
  353. print('building man page %-40s' % (man_title + '(1)'), end='\r', file=sys.stderr)
  354. self.write_man_header(write, man_title, 'Details regarding ' + topic)
  355. self.write_heading(write, 'DESCRIPTION')
  356. write(text)
  357. self.gen_man_page(man_title, doc.getvalue())
  358. def printer(self, fd):
  359. def write(*args, **kwargs):
  360. print(*args, file=fd, **kwargs)
  361. return write
  362. def write_heading(self, write, header, char='-', double_sided=False):
  363. write()
  364. if double_sided:
  365. write(char * len(header))
  366. write(header)
  367. write(char * len(header))
  368. write()
  369. def write_man_header(self, write, title, description):
  370. self.write_heading(write, title, '=', double_sided=True)
  371. self.write_heading(write, description, double_sided=True)
  372. # man page metadata
  373. write(':Author: The Borg Collective')
  374. write(':Date:', datetime.utcnow().date().isoformat())
  375. write(':Manual section: 1')
  376. write(':Manual group: borg backup tool')
  377. write()
  378. def write_see_also(self, write, man_title):
  379. see_also = self.see_also.get(man_title.replace('borg-', ''), ())
  380. see_also = ['`borg-%s(1)`' % s for s in see_also]
  381. see_also.insert(0, '`borg-common(1)`')
  382. self.write_heading(write, 'SEE ALSO')
  383. write(', '.join(see_also))
  384. def gen_man_page(self, name, rst):
  385. from docutils.writers import manpage
  386. from docutils.core import publish_string
  387. man_page = publish_string(source=rst, writer=manpage.Writer())
  388. with open('docs/man/%s.1' % name, 'wb') as fd:
  389. fd.write(man_page)
  390. def write_usage(self, write, parser):
  391. if any(len(o.option_strings) for o in parser._actions):
  392. write(' <options> ', end='')
  393. for option in parser._actions:
  394. if option.option_strings:
  395. continue
  396. write(option.metavar, end=' ')
  397. def write_options(self, write, parser):
  398. for group in parser._action_groups:
  399. if group.title == 'Common options' or not group._group_actions:
  400. continue
  401. title = 'arguments' if group.title == 'positional arguments' else group.title
  402. self.write_heading(write, title, '+')
  403. self.write_options_group(write, group)
  404. def write_options_group(self, write, group):
  405. def is_positional_group(group):
  406. return any(not o.option_strings for o in group._group_actions)
  407. if is_positional_group(group):
  408. for option in group._group_actions:
  409. write(option.metavar)
  410. write(textwrap.indent(option.help or '', ' ' * 4))
  411. return
  412. opts = OrderedDict()
  413. for option in group._group_actions:
  414. if option.metavar:
  415. option_fmt = '%s ' + option.metavar
  416. else:
  417. option_fmt = '%s'
  418. option_str = ', '.join(option_fmt % s for s in option.option_strings)
  419. option_desc = textwrap.dedent((option.help or '') % option.__dict__)
  420. opts[option_str] = textwrap.indent(option_desc, ' ' * 4)
  421. padding = len(max(opts)) + 1
  422. for option, desc in opts.items():
  423. write(option.ljust(padding), desc)
  424. class build_api(Command):
  425. description = "generate a basic api.rst file based on the modules available"
  426. user_options = [
  427. ('output=', 'O', 'output directory'),
  428. ]
  429. def initialize_options(self):
  430. pass
  431. def finalize_options(self):
  432. pass
  433. def run(self):
  434. print("auto-generating API documentation")
  435. with open("docs/api.rst", "w") as doc:
  436. doc.write("""
  437. API Documentation
  438. =================
  439. """)
  440. for mod in glob('src/borg/*.py') + glob('src/borg/*.pyx'):
  441. print("examining module %s" % mod)
  442. mod = mod.replace('.pyx', '').replace('.py', '').replace('/', '.')
  443. if "._" not in mod:
  444. doc.write("""
  445. .. automodule:: %s
  446. :members:
  447. :undoc-members:
  448. """ % mod)
  449. cmdclass = {
  450. 'build_ext': build_ext,
  451. 'build_api': build_api,
  452. 'build_usage': build_usage,
  453. 'build_man': build_man,
  454. 'sdist': Sdist
  455. }
  456. ext_modules = []
  457. if not on_rtd:
  458. ext_modules += [
  459. Extension('borg.compress', [compress_source], libraries=['lz4'], include_dirs=include_dirs, library_dirs=library_dirs, define_macros=define_macros),
  460. Extension('borg.crypto', [crypto_source], libraries=crypto_libraries, include_dirs=include_dirs, library_dirs=library_dirs, define_macros=define_macros),
  461. Extension('borg.chunker', [chunker_source]),
  462. Extension('borg.hashindex', [hashindex_source]),
  463. Extension('borg.item', [item_source]),
  464. Extension('borg.crc32', [crc32_source]),
  465. ]
  466. if not sys.platform.startswith(('win32', )):
  467. ext_modules.append(Extension('borg.platform.posix', [platform_posix_source]))
  468. if sys.platform == 'linux':
  469. ext_modules.append(Extension('borg.platform.linux', [platform_linux_source], libraries=['acl']))
  470. elif sys.platform.startswith('freebsd'):
  471. ext_modules.append(Extension('borg.platform.freebsd', [platform_freebsd_source]))
  472. elif sys.platform == 'darwin':
  473. ext_modules.append(Extension('borg.platform.darwin', [platform_darwin_source]))
  474. setup(
  475. name='borgbackup',
  476. use_scm_version={
  477. 'write_to': 'src/borg/_version.py',
  478. },
  479. author='The Borg Collective (see AUTHORS file)',
  480. author_email='borgbackup@python.org',
  481. url='https://borgbackup.readthedocs.io/',
  482. description='Deduplicated, encrypted, authenticated and compressed backups',
  483. long_description=long_description,
  484. license='BSD',
  485. platforms=['Linux', 'MacOS X', 'FreeBSD', 'OpenBSD', 'NetBSD', ],
  486. classifiers=[
  487. 'Development Status :: 4 - Beta',
  488. 'Environment :: Console',
  489. 'Intended Audience :: System Administrators',
  490. 'License :: OSI Approved :: BSD License',
  491. 'Operating System :: POSIX :: BSD :: FreeBSD',
  492. 'Operating System :: POSIX :: BSD :: OpenBSD',
  493. 'Operating System :: POSIX :: BSD :: NetBSD',
  494. 'Operating System :: MacOS :: MacOS X',
  495. 'Operating System :: POSIX :: Linux',
  496. 'Programming Language :: Python',
  497. 'Programming Language :: Python :: 3',
  498. 'Programming Language :: Python :: 3.4',
  499. 'Programming Language :: Python :: 3.5',
  500. 'Programming Language :: Python :: 3.6',
  501. 'Topic :: Security :: Cryptography',
  502. 'Topic :: System :: Archiving :: Backup',
  503. ],
  504. packages=find_packages('src'),
  505. package_dir={'': 'src'},
  506. include_package_data=True,
  507. zip_safe=False,
  508. entry_points={
  509. 'console_scripts': [
  510. 'borg = borg.archiver:main',
  511. 'borgfs = borg.archiver:main',
  512. ]
  513. },
  514. cmdclass=cmdclass,
  515. ext_modules=ext_modules,
  516. setup_requires=['setuptools_scm>=1.7'],
  517. install_requires=install_requires,
  518. extras_require=extras_require,
  519. )