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_common.c",
89 samba_srcdir
+ "python/py_conv.c",
90 samba_srcdir
+ "python/py_ntsec.c",
91 samba_srcdir
+ "python/py_spoolss_forms.c",
92 samba_srcdir
+ "python/py_spoolss_forms_conv.c",
93 samba_srcdir
+ "python/py_spoolss_drivers.c",
94 samba_srcdir
+ "python/py_spoolss_drivers_conv.c",
95 samba_srcdir
+ "python/py_spoolss_printers.c",
96 samba_srcdir
+ "python/py_spoolss_printers_conv.c",
97 samba_srcdir
+ "python/py_spoolss_printerdata.c",
98 samba_srcdir
+ "python/py_spoolss_ports.c",
99 samba_srcdir
+ "python/py_spoolss_ports_conv.c",
100 samba_srcdir
+ "python/py_spoolss_jobs.c",
101 samba_srcdir
+ "python/py_spoolss_jobs_conv.c",
103 libraries
= lib_list
,
104 library_dirs
= ["/usr/kerberos/lib"],
105 extra_objects
= obj_list
),
109 Extension(name
= "lsa",
110 sources
= [samba_srcdir
+ "python/py_lsa.c",
111 samba_srcdir
+ "python/py_common.c",
112 samba_srcdir
+ "python/py_ntsec.c"],
113 libraries
= lib_list
,
114 library_dirs
= ["/usr/kerberos/lib"],
115 extra_objects
= obj_list
),
119 Extension(name
= "samr",
120 sources
= [samba_srcdir
+ "python/py_samr.c",
121 samba_srcdir
+ "python/py_common.c"],
122 libraries
= lib_list
,
123 library_dirs
= ["/usr/kerberos/lib"],
124 extra_objects
= obj_list
),
126 # winbind client module
128 Extension(name
= "winbind",
129 sources
= [samba_srcdir
+ "python/py_winbind.c",
130 samba_srcdir
+ "python/py_common.c"],
131 libraries
= lib_list
,
132 library_dirs
= ["/usr/kerberos/lib"],
133 extra_objects
= obj_list
,
134 extra_compile_args
= flags_list
),
138 Extension(name
= "winreg",
139 sources
= [samba_srcdir
+ "python/py_winreg.c",
140 samba_srcdir
+ "python/py_common.c"],
141 libraries
= lib_list
,
142 library_dirs
= ["/usr/kerberos/lib"],
143 extra_objects
= obj_list
),
147 Extension(name
= "tdb",
148 sources
= [samba_srcdir
+ "python/py_tdb.c"],
149 libraries
= lib_list
,
150 library_dirs
= ["/usr/kerberos/lib"],
151 extra_objects
= obj_list
),