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