From b2536ccfdde333633f1d208a6113182aee260aab Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Mon, 9 Sep 2002 07:49:25 +0000 Subject: Python's setup.py does not need to be munged by configure.in -- it is sufficient to just pass the relevant variables to Python from the Makefile. Therefore, remove setup.py.in. (This used to be commit 8bebe9ee2b6bd56c297acc6b01cb0856aad1c4f3) --- source3/python/setup.py | 168 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100755 source3/python/setup.py (limited to 'source3/python/setup.py') diff --git a/source3/python/setup.py b/source3/python/setup.py new file mode 100755 index 0000000000..b39ef448c1 --- /dev/null +++ b/source3/python/setup.py @@ -0,0 +1,168 @@ +# -*- mode: python -*- +# +# Unix SMB/CIFS implementation. +# Module packaging setup for Samba python extensions +# +# Copyright (C) Tim Potter, 2002 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# + +from distutils.core import setup +from distutils.extension import Extension + +import sys, string, os + +# The Makefile passes in environment variable $PYTHON_OBJ as being the +# list of Samba objects. This kind of goes against the distutils.cmd +# method of adding setup commands and will also confuse people who are +# familiar with the python Distutils module. + +samba_objs = os.environ.get("PYTHON_OBJS", "") + +samba_cflags = os.environ.get("PYTHON_CFLAGS", "") + +samba_srcdir = os.environ.get("SRCDIR", "") + +# These variables are filled in by configure + +samba_libs = os.environ.get("LIBS", "") + +# Convert libs and objs from space separated strings to lists of strings +# for distutils to digest. Split "-l" prefix off library list. + +obj_list = string.split(samba_objs) + +lib_list = [] + +for lib in string.split(samba_libs): + lib_list.append(string.replace(lib, "-l", "")) + +flags_list = string.split(samba_cflags) + +# Invoke distutils.setup + +setup( + + # Overview information + + name = "Samba Python Extensions", + version = "0.1", + author = "Tim Potter", + author_email = "tpot@samba.org", + license = "GPL", + + # Build info + + include_dirs = [samba_srcdir + '.', samba_srcdir + "include", + samba_srcdir + "ubiqx", samba_srcdir + "smbwrapper", + samba_srcdir + "popt", "/usr/kerberos/include", + "/usr/local/include"], + + # Module list + + ext_modules = [ + + # SPOOLSS pipe module + + Extension(name = "spoolss", + sources = [samba_srcdir + "python/py_spoolss.c", + samba_srcdir + "python/py_common.c", + samba_srcdir + "python/py_conv.c", + samba_srcdir + "python/py_ntsec.c", + samba_srcdir + "python/py_spoolss_forms.c", + samba_srcdir + "python/py_spoolss_forms_conv.c", + samba_srcdir + "python/py_spoolss_drivers.c", + samba_srcdir + "python/py_spoolss_drivers_conv.c", + samba_srcdir + "python/py_spoolss_printers.c", + samba_srcdir + "python/py_spoolss_printers_conv.c", + samba_srcdir + "python/py_spoolss_printerdata.c", + samba_srcdir + "python/py_spoolss_ports.c", + samba_srcdir + "python/py_spoolss_ports_conv.c", + samba_srcdir + "python/py_spoolss_jobs.c", + samba_srcdir + "python/py_spoolss_jobs_conv.c", + ], + libraries = lib_list, + library_dirs = ["/usr/kerberos/lib"], + extra_objects = obj_list), + + # LSA pipe module + + Extension(name = "lsa", + sources = [samba_srcdir + "python/py_lsa.c", + samba_srcdir + "python/py_common.c", + samba_srcdir + "python/py_ntsec.c"], + libraries = lib_list, + library_dirs = ["/usr/kerberos/lib"], + extra_objects = obj_list), + + # SAMR pipe module + + Extension(name = "samr", + sources = [samba_srcdir + "python/py_samr.c", + samba_srcdir + "python/py_samr_conv.c", + samba_srcdir + "python/py_common.c"], + libraries = lib_list, + library_dirs = ["/usr/kerberos/lib"], + extra_objects = obj_list), + + # winbind client module + + Extension(name = "winbind", + sources = [samba_srcdir + "python/py_winbind.c", + samba_srcdir + "python/py_common.c"], + libraries = lib_list, + library_dirs = ["/usr/kerberos/lib"], + extra_objects = obj_list, + extra_compile_args = flags_list), + + # WINREG pipe module + + Extension(name = "winreg", + sources = [samba_srcdir + "python/py_winreg.c", + samba_srcdir + "python/py_common.c"], + libraries = lib_list, + library_dirs = ["/usr/kerberos/lib"], + extra_objects = obj_list), + + # tdb module + + Extension(name = "tdb", + sources = [samba_srcdir + "python/py_tdb.c"], + libraries = lib_list, + library_dirs = ["/usr/kerberos/lib"], + extra_objects = obj_list), + + # libsmb module + + Extension(name = "smb", + sources = [samba_srcdir + "python/py_smb.c", + samba_srcdir + "python/py_common.c"], + libraries = lib_list, + library_dirs = ["/usr/kerberos/lib"], + extra_objects = obj_list), + + # Moving to merge all individual extensions in to one big + # extension. This is to avoid the fact that each extension is 3MB + # in size due to the lack of proper depedency management in Samba. + + Extension(name = "samba", + sources = [samba_srcdir + "python/py_samba.c", + samba_srcdir + "python/py_common.c"], + libraries = lib_list, + library_dirs = ["/usr/kerberos/lib"], + extra_objects = obj_list), + ], +) -- cgit From 462818caba9e68f092fdedb3cbcf7155161dffeb Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Mon, 9 Sep 2002 08:06:17 +0000 Subject: Build py_tdbpack as well. (This used to be commit fc5e8b8f672d461809f113fe14435841608b046f) --- source3/python/setup.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/python/setup.py') diff --git a/source3/python/setup.py b/source3/python/setup.py index b39ef448c1..38bc841d98 100755 --- a/source3/python/setup.py +++ b/source3/python/setup.py @@ -164,5 +164,10 @@ setup( libraries = lib_list, library_dirs = ["/usr/kerberos/lib"], extra_objects = obj_list), + + # tdbpack/unpack extensions. Does not actually link to any Samba + # code, although it implements a compatible data format. + Extension(name = "tdbpack", + sources = [os.path.join(samba_srcdir, "python", "py_tdbpack.c")]), ], ) -- cgit From 0ad8d0c768b2c961a1b93662d7050216edc2d3c0 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Mon, 9 Sep 2002 08:34:35 +0000 Subject: Put all Python modules into the 'samba' subpackage. Now you need to write import samba.tdbutil samba.tdbutil.pack('f', ['hello']) You need 'cvs update -d' to get the new subdirectory for this to build properly. (This used to be commit 0d3276355e0511d6aff110a3943199629b3c00fd) --- source3/python/setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/python/setup.py') diff --git a/source3/python/setup.py b/source3/python/setup.py index 38bc841d98..a5d7879371 100755 --- a/source3/python/setup.py +++ b/source3/python/setup.py @@ -4,6 +4,7 @@ # Module packaging setup for Samba python extensions # # Copyright (C) Tim Potter, 2002 +# Copyright (C) Martin Pool, 2002 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -70,9 +71,16 @@ setup( samba_srcdir + "ubiqx", samba_srcdir + "smbwrapper", samba_srcdir + "popt", "/usr/kerberos/include", "/usr/local/include"], + + # Get the "samba" directory of Python source. At the moment this + # just contains the __init__ file that makes it work as a + # subpackage. This is needed even though everything else is an + # extension module. + package_dir = {"samba": os.path.join(samba_srcdir, "python", "samba")}, + packages = ["samba"], # Module list - + ext_package = "samba", ext_modules = [ # SPOOLSS pipe module -- cgit From b3bcdccb1c3670495248469170b7b86c16312f99 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 11 Sep 2002 04:55:45 +0000 Subject: Implemented getpw{nam,uid} functions. (This used to be commit 19adbf1faed3d076207ec55e398f15f87d48c9f7) --- source3/python/setup.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/python/setup.py') diff --git a/source3/python/setup.py b/source3/python/setup.py index a5d7879371..d3c420834a 100755 --- a/source3/python/setup.py +++ b/source3/python/setup.py @@ -130,6 +130,8 @@ setup( Extension(name = "winbind", sources = [samba_srcdir + "python/py_winbind.c", + samba_srcdir + "python/py_winbind_conv.c", + samba_srcdir + "python/py_conv.c", samba_srcdir + "python/py_common.c"], libraries = lib_list, library_dirs = ["/usr/kerberos/lib"], -- cgit From 8eda50793ea5edaddb5224496a42f677328d4af2 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 19 Sep 2002 05:49:14 +0000 Subject: Remove hardcoded -I stuff. Hooray! (This used to be commit 105ff7c5400a6b79613b6a3b72808124b17ddc60) --- source3/python/setup.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source3/python/setup.py') diff --git a/source3/python/setup.py b/source3/python/setup.py index d3c420834a..6d03ca633a 100755 --- a/source3/python/setup.py +++ b/source3/python/setup.py @@ -65,13 +65,6 @@ setup( author_email = "tpot@samba.org", license = "GPL", - # Build info - - include_dirs = [samba_srcdir + '.', samba_srcdir + "include", - samba_srcdir + "ubiqx", samba_srcdir + "smbwrapper", - samba_srcdir + "popt", "/usr/kerberos/include", - "/usr/local/include"], - # Get the "samba" directory of Python source. At the moment this # just contains the __init__ file that makes it work as a # subpackage. This is needed even though everything else is an @@ -104,6 +97,7 @@ setup( ], libraries = lib_list, library_dirs = ["/usr/kerberos/lib"], + extra_compile_args = flags_list, extra_objects = obj_list), # LSA pipe module @@ -114,6 +108,7 @@ setup( samba_srcdir + "python/py_ntsec.c"], libraries = lib_list, library_dirs = ["/usr/kerberos/lib"], + extra_compile_args = flags_list, extra_objects = obj_list), # SAMR pipe module @@ -124,6 +119,7 @@ setup( samba_srcdir + "python/py_common.c"], libraries = lib_list, library_dirs = ["/usr/kerberos/lib"], + extra_compile_args = flags_list, extra_objects = obj_list), # winbind client module @@ -135,8 +131,8 @@ setup( samba_srcdir + "python/py_common.c"], libraries = lib_list, library_dirs = ["/usr/kerberos/lib"], - extra_objects = obj_list, - extra_compile_args = flags_list), + extra_compile_args = flags_list, + extra_objects = obj_list), # WINREG pipe module @@ -145,6 +141,7 @@ setup( samba_srcdir + "python/py_common.c"], libraries = lib_list, library_dirs = ["/usr/kerberos/lib"], + extra_compile_args = flags_list, extra_objects = obj_list), # tdb module @@ -153,6 +150,7 @@ setup( sources = [samba_srcdir + "python/py_tdb.c"], libraries = lib_list, library_dirs = ["/usr/kerberos/lib"], + extra_compile_args = flags_list, extra_objects = obj_list), # libsmb module @@ -162,6 +160,7 @@ setup( samba_srcdir + "python/py_common.c"], libraries = lib_list, library_dirs = ["/usr/kerberos/lib"], + extra_compile_args = flags_list, extra_objects = obj_list), # Moving to merge all individual extensions in to one big @@ -173,6 +172,7 @@ setup( samba_srcdir + "python/py_common.c"], libraries = lib_list, library_dirs = ["/usr/kerberos/lib"], + extra_compile_args = flags_list, extra_objects = obj_list), # tdbpack/unpack extensions. Does not actually link to any Samba -- cgit