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/>.
18 from distutils.core import setup
19 from distutils.extension import Extension as _Extension
24 from Cython.Distutils import build_ext as _build_ext
29 # read version from local kmod/version.py without pulling in
31 _sys.path.insert(0, package_name)
32 from version import __version__
35 _this_dir = _os.path.dirname(__file__)
38 if platform.system() == "Linux":
39 for filename in sorted(_os.listdir(package_name)):
40 basename,extension = _os.path.splitext(filename)
41 if extension == '.pyx':
44 '{0}.{1}'.format(package_name, basename),
45 [_os.path.join(package_name, filename)],
52 description='Python binding for kmod',
53 packages=[package_name],
54 provides=[package_name],
55 maintainer="Andy Grover",
56 maintainer_email="agrover@redhat.com",
57 cmdclass = {'build_ext': _build_ext},
58 ext_modules=ext_modules,