3 # Unix SMB/CIFS implementation.
4 # Module packaging setup for Samba python extensions
6 # Copyright (C) Tim Potter, 2002
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 from distutils.core import setup
24 from distutils.extension import Extension
26 import sys, string, os
28 # The Makefile passes in environment variable $PYTHON_OBJ as being the
29 # list of Samba objects. This kind of goes against the distutils.cmd
30 # method of adding setup commands and will also confuse people who are
31 # familiar with the python Distutils module.
34 if os.environ.has_key("PYTHON_OBJS"):
35 samba_objs = os.environ.get("PYTHON_OBJS")
38 if os.environ.has_key("PYTHON_CFLAGS"):
39 samba_cflags = os.environ.get("PYTHON_CFLAGS")
42 if os.environ.has_key("SRCDIR"):
43 samba_srcdir = os.environ.get("SRCDIR")
45 # These variables are filled in by configure
49 # Convert libs and objs from space separated strings to lists of strings
50 # for distutils to digest. Split "-l" prefix off library list.
52 obj_list = string.split(samba_objs)
56 for lib in string.split(samba_libs):
57 lib_list.append(string.replace(lib, "-l", ""))
59 flags_list = string.split(samba_cflags)
61 # Invoke distutils.setup
65 # Overview information
67 name = "Samba Python Extensions",
69 author = "Tim Potter",
70 author_email = "tpot@samba.org",
75 include_dirs = [samba_srcdir, samba_srcdir + "include",
76 samba_srcdir + "ubiqx", samba_srcdir + "smbwrapper",
77 samba_srcdir + "popt", "/usr/kerberos/include",
78 "/usr/local/include"],
86 Extension(name = "spoolss",
87 sources = [samba_srcdir + "python/py_spoolss.c",
88 samba_srcdir + "python/py_spoolss_forms.c",
89 samba_srcdir + "python/py_spoolss_ports.c",
90 samba_srcdir + "python/py_common.c",
91 samba_srcdir + "python/py_conv.c"],
93 library_dirs = ["/usr/kerberos/lib"],
94 extra_objects = obj_list),
98 Extension(name = "lsa",
99 sources = [samba_srcdir + "python/py_lsa.c",
100 samba_srcdir + "python/py_common.c"],
101 libraries = lib_list,
102 library_dirs = ["/usr/kerberos/lib"],
103 extra_objects = obj_list),
105 # winbind client module
107 Extension(name = "winbind",
108 sources = [samba_srcdir + "python/py_winbind.c",
109 samba_srcdir + "python/py_common.c"],
110 libraries = lib_list,
111 library_dirs = ["/usr/kerberos/lib"],
112 extra_objects = obj_list,
113 extra_compile_args = flags_list),