update version to 0.9.1
[python-kmod.git] / setup.py
1 # Copyright (C) 2012 Red Hat, Inc.
2 #                    W. Trevor King <wking@tremily.us>
3 #
4 # This file is part of python-kmod.
5 #
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.
9 #
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
13 # details.
14 #
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
18 from distutils.core import setup
19 from distutils.extension import Extension as _Extension
20 import os as _os
21 import sys as _sys
22 import platform
23
24 from Cython.Distutils import build_ext as _build_ext
25
26
27 package_name = 'kmod'
28
29 # read version from local kmod/version.py without pulling in
30 # kmod/__init__.py
31 _sys.path.insert(0, package_name)
32 from version import __version__
33
34
35 _this_dir = _os.path.dirname(__file__)
36
37 ext_modules = []
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':
42             ext_modules.append(
43                 _Extension(
44                     '{0}.{1}'.format(package_name, basename),
45                     [_os.path.join(package_name, filename)],
46                     libraries=['kmod'],
47                     ))
48
49 setup(
50     name=package_name,
51     version=__version__,
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,
59     )