Add support for building on GNU/kFreeBSD
[pylibacl.git] / setup.py
1 #!/usr/bin/env python
2
3 import distutils, os
4 from distutils.core import setup, Extension
5
6 (u_sysname, u_nodename, u_release, u_version, u_machine) = os.uname()
7
8 macros = []
9 libs = []
10 if u_sysname == "Linux":
11     macros.append(("HAVE_LINUX", None))
12     macros.append(("HAVE_LEVEL2", None))
13     libs.append("acl")
14 elif u_sysname == "GNU/kFreeBSD":
15     macros.append(("HAVE_LINUX", None))
16     macros.append(("HAVE_LEVEL2", None))
17     libs.append("acl")
18 elif u_sysname == "FreeBSD":
19     macros.append(("HAVE_FREEBSD", None))
20     libs.append("posix1e")
21 else:
22     raise ValueError("I don't know your system '%s'."
23                      " Please contact the author" % u_sysname)
24
25 long_desc = """This is a C extension module for Python which
26 implements POSIX ACLs manipulation. It is a wrapper on top
27 of the systems's acl C library - see acl(5)."""
28 version = "0.2.1"
29 setup(name="pylibacl",
30       version=version,
31       description="POSIX.1e ACLs for python",
32       long_description=long_desc,
33       author="Iustin Pop",
34       author_email="iusty@k1024.org",
35       url="http://pylibacl.sourceforge.net",
36       license="GPL",
37       ext_modules=[Extension("posix1e", ["acl.c"],
38                              libraries=libs,
39                              define_macros=macros,
40                              )],
41       data_files=[("/usr/share/doc/pylibacl-%s" % version,
42                    ["README","IMPLEMENTATION", "PLATFORMS",
43                     "BENCHMARK",
44                     "posix1e.html", "posix1e.txt"])],
45       )