summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/python/py_samba.c64
-rw-r--r--source3/python/samba-head.patch22
-rwxr-xr-xsource3/python/setup.py.in10
3 files changed, 85 insertions, 11 deletions
diff --git a/source3/python/py_samba.c b/source3/python/py_samba.c
new file mode 100644
index 0000000000..7c94569787
--- /dev/null
+++ b/source3/python/py_samba.c
@@ -0,0 +1,64 @@
+/*
+ Python wrappers for DCERPC/SMB client routines.
+
+ 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.
+*/
+
+#include "Python.h"
+#include "python/py_common.h"
+
+/*
+ * Module initialisation
+ */
+
+static PyObject *lsa_open_policy(PyObject *self, PyObject *args,
+ PyObject *kw)
+{
+ return NULL;
+}
+
+static PyMethodDef samba_methods[] = {
+ { NULL }
+};
+
+static PyMethodDef cheepy_methods[] = {
+ { "open_policy", (PyCFunction)lsa_open_policy, METH_VARARGS|METH_KEYWORDS,
+ "Foo"},
+ { NULL }
+};
+
+void initsamba(void)
+{
+ PyObject *module, *new_module, *dict;
+
+ /* Initialise module */
+
+ module = Py_InitModule("samba", samba_methods);
+ dict = PyModule_GetDict(module);
+
+ new_module = PyModule_N("cheepy");
+
+
+
+ PyDict_SetItemString(dict, "cheepy", new_module);
+
+
+
+ /* Do samba initialisation */
+
+ py_samba_init();
+}
diff --git a/source3/python/samba-head.patch b/source3/python/samba-head.patch
index a739346a5b..ced7da551e 100644
--- a/source3/python/samba-head.patch
+++ b/source3/python/samba-head.patch
@@ -1,11 +1,11 @@
Index: Makefile.in
===================================================================
RCS file: /data/cvs/samba/source/Makefile.in,v
-retrieving revision 1.500
-diff -u -r1.500 Makefile.in
---- Makefile.in 2002/07/28 06:04:32 1.500
-+++ Makefile.in 2002/07/29 03:48:03
-@@ -838,6 +838,45 @@
+retrieving revision 1.502
+diff -u -r1.502 Makefile.in
+--- Makefile.in 2002/08/02 07:20:56 1.502
++++ Makefile.in 2002/08/06 00:51:48
+@@ -839,6 +839,45 @@
-$(INSTALLCMD) -d ${prefix}/include
-$(INSTALLCMD) include/libsmbclient.h ${prefix}/include
@@ -54,16 +54,16 @@ diff -u -r1.500 Makefile.in
Index: configure.in
===================================================================
RCS file: /data/cvs/samba/source/configure.in,v
-retrieving revision 1.324
-diff -u -r1.324 configure.in
---- configure.in 2002/07/27 01:37:32 1.324
-+++ configure.in 2002/07/29 03:48:04
+retrieving revision 1.326
+diff -u -r1.326 configure.in
+--- configure.in 2002/07/30 09:59:52 1.326
++++ configure.in 2002/08/06 00:51:51
@@ -2797,7 +2797,7 @@
builddir=`pwd`
AC_SUBST(builddir)
--AC_OUTPUT(include/stamp-h Makefile script/findsmb)
-+AC_OUTPUT(include/stamp-h Makefile script/findsmb python/setup.py)
+-AC_OUTPUT(include/stamp-h Makefile script/findsmb ../examples/VFS/Makefile ../examples/VFS/block/Makefile)
++AC_OUTPUT(include/stamp-h Makefile script/findsmb ../examples/VFS/Makefile ../examples/VFS/block/Makefile python/setup.py)
#################################################
# Print very concise instructions on building/use
diff --git a/source3/python/setup.py.in b/source3/python/setup.py.in
index 9b6dc1a650..5896301245 100755
--- a/source3/python/setup.py.in
+++ b/source3/python/setup.py.in
@@ -160,5 +160,15 @@ setup(
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),
],
)