|
@@ -9,6 +9,7 @@ versioneer.versionfile_build = 'attic/_version.py'
|
|
versioneer.tag_prefix = ''
|
|
versioneer.tag_prefix = ''
|
|
versioneer.parentdir_prefix = 'Attic-' # dirname like 'myproject-1.2.0'
|
|
versioneer.parentdir_prefix = 'Attic-' # dirname like 'myproject-1.2.0'
|
|
|
|
|
|
|
|
+platform = os.uname().sysname
|
|
|
|
|
|
min_python = (3, 2)
|
|
min_python = (3, 2)
|
|
if sys.version_info < min_python:
|
|
if sys.version_info < min_python:
|
|
@@ -23,6 +24,7 @@ except ImportError:
|
|
crypto_source = 'attic/crypto.pyx'
|
|
crypto_source = 'attic/crypto.pyx'
|
|
chunker_source = 'attic/chunker.pyx'
|
|
chunker_source = 'attic/chunker.pyx'
|
|
hashindex_source = 'attic/hashindex.pyx'
|
|
hashindex_source = 'attic/hashindex.pyx'
|
|
|
|
+platform_linux_source = 'attic/platform_linux.pyx'
|
|
|
|
|
|
try:
|
|
try:
|
|
from Cython.Distutils import build_ext
|
|
from Cython.Distutils import build_ext
|
|
@@ -36,7 +38,7 @@ try:
|
|
versioneer.cmd_sdist.__init__(self, *args, **kwargs)
|
|
versioneer.cmd_sdist.__init__(self, *args, **kwargs)
|
|
|
|
|
|
def make_distribution(self):
|
|
def make_distribution(self):
|
|
- self.filelist.extend(['attic/crypto.c', 'attic/chunker.c', 'attic/_chunker.c', 'attic/hashindex.c', 'attic/_hashindex.c'])
|
|
|
|
|
|
+ self.filelist.extend(['attic/crypto.c', 'attic/chunker.c', 'attic/_chunker.c', 'attic/hashindex.c', 'attic/_hashindex.c', 'attic/platform_linux.c'])
|
|
super(Sdist, self).make_distribution()
|
|
super(Sdist, self).make_distribution()
|
|
|
|
|
|
except ImportError:
|
|
except ImportError:
|
|
@@ -47,8 +49,9 @@ except ImportError:
|
|
crypto_source = crypto_source.replace('.pyx', '.c')
|
|
crypto_source = crypto_source.replace('.pyx', '.c')
|
|
chunker_source = chunker_source.replace('.pyx', '.c')
|
|
chunker_source = chunker_source.replace('.pyx', '.c')
|
|
hashindex_source = hashindex_source.replace('.pyx', '.c')
|
|
hashindex_source = hashindex_source.replace('.pyx', '.c')
|
|
|
|
+ acl_source = platform_linux_source.replace('.pyx', '.c')
|
|
from distutils.command.build_ext import build_ext
|
|
from distutils.command.build_ext import build_ext
|
|
- if not all(os.path.exists(path) for path in [crypto_source, chunker_source, hashindex_source]):
|
|
|
|
|
|
+ if not all(os.path.exists(path) for path in [crypto_source, chunker_source, hashindex_source, acl_source]):
|
|
raise ImportError('The GIT version of Attic needs Cython. Install Cython or use a released version')
|
|
raise ImportError('The GIT version of Attic needs Cython. Install Cython or use a released version')
|
|
|
|
|
|
|
|
|
|
@@ -77,6 +80,14 @@ with open('README.rst', 'r') as fd:
|
|
cmdclass = versioneer.get_cmdclass()
|
|
cmdclass = versioneer.get_cmdclass()
|
|
cmdclass.update({'build_ext': build_ext, 'sdist': Sdist})
|
|
cmdclass.update({'build_ext': build_ext, 'sdist': Sdist})
|
|
|
|
|
|
|
|
+ext_modules = [
|
|
|
|
+ Extension('attic.crypto', [crypto_source], libraries=['crypto'], include_dirs=include_dirs, library_dirs=library_dirs),
|
|
|
|
+ Extension('attic.chunker', [chunker_source]),
|
|
|
|
+ Extension('attic.hashindex', [hashindex_source])
|
|
|
|
+]
|
|
|
|
+if platform == 'Linux':
|
|
|
|
+ ext_modules.append(Extension('attic.platform_linux', [platform_linux_source], libraries=['acl']))
|
|
|
|
+
|
|
setup(
|
|
setup(
|
|
name='Attic',
|
|
name='Attic',
|
|
version=versioneer.get_version(),
|
|
version=versioneer.get_version(),
|
|
@@ -102,10 +113,6 @@ setup(
|
|
packages=['attic', 'attic.testsuite'],
|
|
packages=['attic', 'attic.testsuite'],
|
|
scripts=['scripts/attic'],
|
|
scripts=['scripts/attic'],
|
|
cmdclass=cmdclass,
|
|
cmdclass=cmdclass,
|
|
- ext_modules=[
|
|
|
|
- Extension('attic.crypto', [crypto_source], libraries=['crypto'], include_dirs=include_dirs, library_dirs=library_dirs),
|
|
|
|
- Extension('attic.chunker', [chunker_source]),
|
|
|
|
- Extension('attic.hashindex', [hashindex_source])
|
|
|
|
- ],
|
|
|
|
|
|
+ ext_modules=ext_modules,
|
|
install_requires=['msgpack-python']
|
|
install_requires=['msgpack-python']
|
|
)
|
|
)
|