~mtrausch/pymcrypt/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from distutils.core import setup
from distutils.extension import Extension
from textwrap import wrap

from platform import python_version_tuple

pyver = int(python_version_tuple()[0])

cython_compiled_files = [ 'libmcrypt-3.c', 'libmcrypt-2.c' ]


if pyver == 3:
    e_modules = [ Extension('pymcrypt.libmcrypt',
                            [ cython_compiled_files[0] ],
                            libraries = ['mcrypt']) ]
    data_file_append = [ cython_compiled_files[1] ]
else:
    e_modules = [ Extension('pymcrypt.libmcrypt',
                            [ cython_compiled_files[1] ],
                            libraries = ['mcrypt']) ]
    data_file_append = [ cython_compiled_files[0] ]

setup(name = 'pymcrypt',
      version = '0.0.1',
      ext_modules = e_modules,
      author = 'Michael B. Trausch',
      author_email = 'mike@trausch.us',
      url = 'https://launchpad.net/pymcrypt',
      license = 'GPLv3',
      packages = [ 'pymcrypt' ],
      py_modules = [ 'pymcrypt.EncryptedWriter', 'pymcrypt.__init__',
                     'pymcrypt.EncryptedReader', 'pymcrypt.common' ],
      data_files = [ ('cmcrypt', [ 'cmcrypt.pxd', 'libmcrypt.pyx' ] + data_file_append) ],
      description = 'mcrypt extension for Python 2 and 3',
      long_description = '\n'.join(wrap('''This package provides for a (hopefully)
clean, simple wrapper around mcrypt that can be used from both Python
2 and Python 3 code.  It is presently not yet stable, and it can be expected
that the interface will not be stable until at least a few versions from now;
it will definitely be stable by 1.0, but it is hoped way before then.''')))