1 # Copyright (C) 2012 Red Hat, Inc.
2 # W. Trevor King <wking@tremily.us>
4 # This file is part of python-kmod.
6 # python-kmod is free software: you can redistribute it and/or modify it under
7 # the terms of the GNU Lesser General Public License version 2.1 as published
8 # by the Free Software Foundation.
10 # python-kmod is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with python-kmod. If not, see <http://www.gnu.org/licenses/>.
17 from setuptools import setup
18 from distutils.extension import Extension as _Extension
23 # setuptools DWIM monkey-patch madness
24 # http://mail.python.org/pipermail/distutils-sig/2007-September/thread.html#8204
26 if 'setuptools.extension' in sys.modules:
27 m = sys.modules['setuptools.extension']
28 m.Extension.__dict__ = m._Extension.__dict__
32 # read version from local kmod/version.py without pulling in
34 _sys.path.insert(0, package_name)
35 from version import __version__
38 _this_dir = _os.path.dirname(__file__)
41 if platform.system() == "Linux":
42 for filename in sorted(_os.listdir(package_name)):
43 basename,extension = _os.path.splitext(filename)
44 if extension == '.pyx':
47 '{0}.{1}'.format(package_name, basename),
48 [_os.path.join(package_name, filename)],
55 description='Python binding for kmod',
56 packages=[package_name],
57 provides=[package_name],
58 maintainer="Andy Grover",
59 maintainer_email="agrover@redhat.com",
60 ext_modules=ext_modules,
61 install_requires=["Cython"],
62 setup_requires=["setuptools_cython"],