-
Notifications
You must be signed in to change notification settings - Fork 34
/
setup.py
77 lines (67 loc) · 2.33 KB
/
setup.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env python
from os import environ
try:
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
except ImportError:
from distutils.core import setup, Extension
from distutils.command.build_ext import build_ext
# Although setuptools supports swig, it fails to copy the generated
# Python wrapper: http://stackoverflow.com/questions/12491328
cmdclass = { }
try:
from setuptools.command.install import install
except ImportError:
pass
else:
class Install(install):
def run(self):
self.run_command('build_ext')
install.run(self)
cmdclass['install'] = Install
from distutils.command.build import build
class Build(build):
def run(self):
self.run_command('build_ext')
build.run(self)
cmdclass['build'] = Build
name = 'libnfs'
version = '1.0'
release = '4'
versrel = version + '-' + release
readme = 'README'
download_url = "https://github.com/sahlberg/libnfs-python/libnfs-" + \
versrel + ".tar.gz"
with open(readme, "r") as f:
long_description = f.read()
_libnfs = Extension(name='libnfs._libnfs',
sources=['libnfs/libnfs.i'],
swig_opts=['-shadow', '-threads'],
extra_link_args=['-g'],
extra_compile_args=['-g'],
libraries=['nfs'],
)
setup(name = name,
version = versrel,
description = 'NFS client for Python.',
long_description = long_description,
license = 'LGPLv2.1',
platforms = ['any'],
author = 'Ronnie Sahlberg',
author_email = '[email protected]',
url = 'https://github.com/sahlberg/libnfs-python/',
download_url = download_url,
packages = ['libnfs'],
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: C',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Communications :: File Sharing',
'Topic :: System :: Filesystems',
],
ext_modules = [_libnfs],
cmdclass = cmdclass,
)