rpms/libsemanage/devel libsemanage-swigify.patch, 1.2, 1.3 libsemanage.spec, 1.42, 1.43

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Nov 23 15:06:13 UTC 2005


Author: dwalsh

Update of /cvs/dist/rpms/libsemanage/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv12946

Modified Files:
	libsemanage-swigify.patch libsemanage.spec 
Log Message:
* Wed Nov 23 2005 Dan Walsh <dwalsh at redhat.com> 1.3.56-2
- Add additional swig objects


libsemanage-swigify.patch:
 Makefile               |   11 
 pywrap-test.py         |   39 
 pywrap-test.py.swigify |  149 +
 semanage.py            |  340 --
 semanageswig.i         |   74 
 semanageswig.i.swigify |  117 
 semanageswig_wrap.c    | 6079 -------------------------------------------------
 7 files changed, 380 insertions(+), 6429 deletions(-)

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.2 -r 1.3 libsemanage-swigify.patch
Index: libsemanage-swigify.patch
===================================================================
RCS file: /cvs/dist/rpms/libsemanage/devel/libsemanage-swigify.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- libsemanage-swigify.patch	14 Nov 2005 22:09:06 -0000	1.2
+++ libsemanage-swigify.patch	23 Nov 2005 15:06:09 -0000	1.3
@@ -1,6628 +1,128 @@
---- libsemanage-1.3.53/src/Makefile.swigify	2005-11-11 11:12:49.000000000 -0500
-+++ libsemanage-1.3.53/src/Makefile	2005-11-11 13:35:50.000000000 -0500
-@@ -3,6 +3,10 @@
+diff --exclude-from=exclude -N -u -r nsalibsemanage/src/Makefile libsemanage-1.3.56/src/Makefile
+--- nsalibsemanage/src/Makefile	2005-11-16 15:27:51.000000000 -0500
++++ libsemanage-1.3.56/src/Makefile	2005-11-23 10:01:32.000000000 -0500
+@@ -3,10 +3,9 @@
  LIBDIR ?= $(PREFIX)/lib
  SHLIBDIR ?= $(DESTDIR)/lib
  INCLUDEDIR ?= $(PREFIX)/include
-+PYINC ?= /usr/include/python2.4
-+PYLIB ?= /usr/lib/python2.4
-+PYLIBVER ?= python2.4
-+PYTHONLIBDIR ?= $(LIBDIR)/python2.4
+-PYINC ?= /usr/include/python2.4
+-PYLIB ?= /usr/lib/python2.4
+ PYLIBVER ?= python2.4
+-PYTHONLIBDIR ?= $(LIBDIR)/python2.4
++PYINC ?= /usr/include/${PYLIBVER}
++PYLIBDIR ?= $(LIBDIR)${PYLIBVER}
  
  DEFAULT_SEMANAGE_CONF_LOCATION=$(DESTDIR)/etc/selinux/semanage.conf
  
-@@ -20,14 +24,29 @@
+@@ -40,8 +39,6 @@
  
- LIBA=libsemanage.a
- TARGET=libsemanage.so
-+SWIGIF= semanageswig.i
-+SWIGCOUT= semanageswig_wrap.c
-+SWIGLOBJ:= $(patsubst %.c,%.lo,$(SWIGCOUT)) 
-+SWIGSO=_semanage.so
-+SWIGFILES=$(SWIGSO) semanage.py 
- LIBSO=$(TARGET).$(LIBVERSION)
--OBJS= $(patsubst %.c,%.o,$(wildcard *.c)) conf-scan.o conf-parse.o
--LOBJS= $(patsubst %.c,%.lo,$(wildcard *.c)) conf-scan.lo conf-parse.lo
-+OBJS= $(patsubst %.c,%.o,$(filter-out $(SWIGCOUT),$(wildcard *.c))) conf-scan.o conf-parse.o
-+LOBJS= $(patsubst %.c,%.lo,$(filter-out $(SWIGCOUT),$(wildcard *.c))) conf-scan.lo conf-parse.lo
- CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
+ all: $(LIBA) $(LIBSO) $(SWIGSO)
  
- override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE 
+-pywrap: all $(SWIGLOBJ) $(SWIGSO) 
+-
+ $(SWIGLOBJ): $(SWIGCOUT)
+ 	$(CC) $(CFLAGS) -I$(PYINC) -fpic -DSHARED -c -o $@ $<
  
--all: $(LIBA) $(LIBSO)
-+SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
-+
-+all: $(LIBA) $(LIBSO) $(SWIGSO)
-+
-+pywrap: all $(SWIGLOBJ) $(SWIGSO) 
-+
-+$(SWIGLOBJ): $(SWIGCOUT)
-+	$(CC) $(CFLAGS) -I$(PYINC) -fpic -DSHARED -c -o $@ $<
-+
-+$(SWIGSO): $(SWIGLOBJ)
-+	$(CC) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage -l$(PYLIBVER) -L$(LIBDIR) -Wl,-soname,$@,-z,defs
- 
- $(LIBA): $(OBJS)
- 	$(AR) rcs $@ $^
-@@ -51,7 +70,13 @@
- %.lo:  %.c
- 	$(CC) $(CFLAGS) -fpic -DSHARED -c -o $@ $<
- 
--install: all
-+$(SWIGCOUT): $(SWIGIF)
-+	$(SWIG) $^
-+
-+swigify: $(SWIGIF)
-+	$(SWIG) $^
-+
-+install: all install-pywrap 
- 	test -d $(LIBDIR) || install -m 755 -d $(LIBDIR)
- 	install -m 644 $(LIBA) $(LIBDIR)
- 	test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
-@@ -59,7 +84,14 @@
- 	install -m 644 -D semanage.conf $(DEFAULT_SEMANAGE_CONF_LOCATION)
- 	cd $(LIBDIR) && ln -sf ../../`basename $(SHLIBDIR)`/$(LIBSO) $(TARGET)
- 
-+install-pywrap: pywrap 
-+	test -d $(PYTHONLIBDIR)/site-packages || install -m 755 -d $(PYTHONLIBDIR)/site-packages
-+	install -m 755 $(SWIGFILES) $(PYTHONLIBDIR)/site-packages
-+
- clean: 
--	rm -f $(OBJS) $(LOBJS) $(LIBA) $(LIBSO) $(TARGET) conf-parse.c conf-parse.h conf-scan.c
-+	rm -f $(OBJS) $(LOBJS) $(LIBA) $(LIBSO) $(SWIGLOBJ) $(SWIGSO) $(TARGET) conf-parse.c conf-parse.h conf-scan.c
-+
-+distclean: clean
-+	rm -f $(SWIGCOUT) $(SWIGFILES)
- 
--.PHONY: clean
-+.PHONY: all clean pywrap swigify install install-pywrap distclean
---- /dev/null	2005-11-09 07:43:59.127947500 -0500
-+++ libsemanage-1.3.53/src/semanage.py	2005-11-11 13:21:47.000000000 -0500
-@@ -0,0 +1,340 @@
-+# This file was created automatically by SWIG.
-+# Don't modify this file, modify the SWIG interface instead.
-+# This file is compatible with both classic and new-style classes.
-+
-+import _semanage
-+
-+def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
-+    if (name == "this"):
-+        if isinstance(value, class_type):
-+            self.__dict__[name] = value.this
-+            if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
-+            del value.thisown
-+            return
-+    method = class_type.__swig_setmethods__.get(name,None)
-+    if method: return method(self,value)
-+    if (not static) or hasattr(self,name) or (name == "thisown"):
-+        self.__dict__[name] = value
-+    else:
-+        raise AttributeError("You cannot add attributes to %s" % self)
-+
-+def _swig_setattr(self,class_type,name,value):
-+    return _swig_setattr_nondynamic(self,class_type,name,value,0)
-+
-+def _swig_getattr(self,class_type,name):
-+    method = class_type.__swig_getmethods__.get(name,None)
-+    if method: return method(self)
-+    raise AttributeError,name
-+
-+import types
-+try:
-+    _object = types.ObjectType
-+    _newclass = 1
-+except AttributeError:
-+    class _object : pass
-+    _newclass = 0
-+del types
-+
-+
-+
-+semanage_user_by_idx = _semanage.semanage_user_by_idx
-+
-+semanage_seuser_by_idx = _semanage.semanage_seuser_by_idx
-+
-+semanage_bool_key_create = _semanage.semanage_bool_key_create
-+
-+semanage_bool_key_extract = _semanage.semanage_bool_key_extract
-+
-+semanage_bool_key_free = _semanage.semanage_bool_key_free
-+
-+semanage_bool_compare = _semanage.semanage_bool_compare
-+
-+semanage_bool_get_name = _semanage.semanage_bool_get_name
-+
-+semanage_bool_set_name = _semanage.semanage_bool_set_name
-+
-+semanage_bool_get_value = _semanage.semanage_bool_get_value
-+
-+semanage_bool_set_value = _semanage.semanage_bool_set_value
-+
-+semanage_bool_create = _semanage.semanage_bool_create
-+
-+semanage_bool_clone = _semanage.semanage_bool_clone
-+
-+semanage_bool_free = _semanage.semanage_bool_free
-+SEMANAGE_MSG_ERR = _semanage.SEMANAGE_MSG_ERR
-+SEMANAGE_MSG_WARN = _semanage.SEMANAGE_MSG_WARN
-+SEMANAGE_MSG_INFO = _semanage.SEMANAGE_MSG_INFO
-+
-+semanage_msg_get_level = _semanage.semanage_msg_get_level
-+
-+semanage_msg_get_channel = _semanage.semanage_msg_get_channel
-+
-+semanage_msg_get_fname = _semanage.semanage_msg_get_fname
-+
-+semanage_msg_set_callback = _semanage.semanage_msg_set_callback
-+
-+semanage_iface_query = _semanage.semanage_iface_query
-+
-+semanage_iface_exists = _semanage.semanage_iface_exists
-+
-+semanage_iface_count = _semanage.semanage_iface_count
-+
-+semanage_iface_iterate = _semanage.semanage_iface_iterate
-+
-+semanage_iface_list = _semanage.semanage_iface_list
-+
-+semanage_bool_add_local = _semanage.semanage_bool_add_local
-+
-+semanage_bool_modify_local = _semanage.semanage_bool_modify_local
-+
-+semanage_bool_set_local = _semanage.semanage_bool_set_local
-+
-+semanage_bool_del_local = _semanage.semanage_bool_del_local
-+
[...13026 lines suppressed...]
+-                } else {
+-                    Py_INCREF(Py_None);
+-                    obj = Py_None;
+-                }
+-                break;
+-                case SWIG_PY_POINTER:
+-                obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
+-                break;
+-                case SWIG_PY_BINARY:
+-                obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
+-                break;
+-                default:
+-                obj = 0;
+-                break;
+-            }
+-            if (obj) {
+-                PyDict_SetItemString(d,constants[i].name,obj);
+-                Py_DECREF(obj);
+-            }
+-        }
+-    }
+-    
+-    /* -----------------------------------------------------------------------------*/
+-    /* Fix SwigMethods to carry the callback ptrs when needed */
+-    /* -----------------------------------------------------------------------------*/
+-    
+-    static void
+-    SWIG_Python_FixMethods(PyMethodDef *methods,
+-    swig_const_info *const_table,
+-    swig_type_info **types,
+-    swig_type_info **types_initial) {
+-        size_t i;
+-        for (i = 0; methods[i].ml_name; ++i) {
+-            char *c = methods[i].ml_doc;
+-            if (c && (c = strstr(c, "swig_ptr: "))) {
+-                int j;
+-                swig_const_info *ci = 0;
+-                char *name = c + 10;
+-                for (j = 0; const_table[j].type; j++) {
+-                    if (strncmp(const_table[j].name, name, 
+-                    strlen(const_table[j].name)) == 0) {
+-                        ci = &(const_table[j]);
+-                        break;
+-                    }
+-                }
+-                if (ci) {
+-                    size_t shift = (ci->ptype) - types;
+-                    swig_type_info *ty = types_initial[shift];
+-                    size_t ldoc = (c - methods[i].ml_doc);
+-                    size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
+-                    char *ndoc = (char*)malloc(ldoc + lptr + 10);
+-                    char *buff = ndoc;
+-                    void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue: (void *)(ci->lvalue);
+-                    strncpy(buff, methods[i].ml_doc, ldoc);
+-                    buff += ldoc;
+-                    strncpy(buff, "swig_ptr: ", 10);
+-                    buff += 10;
+-                    SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
+-                    methods[i].ml_doc = ndoc;
+-                }
+-            }
+-        }
+-    }
+-    
+-    /* -----------------------------------------------------------------------------*
+-     *  Initialize type list
+-     * -----------------------------------------------------------------------------*/
+-    
+-#if PY_MAJOR_VERSION < 2
+-    /* PyModule_AddObject function was introduced in Python 2.0.  The following function
+-    is copied out of Python/modsupport.c in python version 2.3.4 */
+-    static int
+-    PyModule_AddObject(PyObject *m, char *name, PyObject *o)
+-    {
+-        PyObject *dict;
+-        if (!PyModule_Check(m)) {
+-            PyErr_SetString(PyExc_TypeError,
+-            "PyModule_AddObject() needs module as first arg");
+-            return -1;
+-        }
+-        if (!o) {
+-            PyErr_SetString(PyExc_TypeError,
+-            "PyModule_AddObject() needs non-NULL value");
+-            return -1;
+-        }
+-        
+-        dict = PyModule_GetDict(m);
+-        if (dict == NULL) {
+-            /* Internal error -- modules must have a dict! */
+-            PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
+-            PyModule_GetName(m));
+-            return -1;
+-        }
+-        if (PyDict_SetItemString(dict, name, o))
+-        return -1;
+-        Py_DECREF(o);
+-        return 0;
+-    }
+-#endif
+-    
+-    static swig_type_info **
+-    SWIG_Python_SetTypeListHandle(swig_type_info **type_list_handle) {
+-        static PyMethodDef swig_empty_runtime_method_table[] = {
+-            {
+-                NULL, NULL, 0, NULL
+-            } 
+-        };/* Sentinel */
+-        
+-        PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+-        swig_empty_runtime_method_table);
+-        PyObject *pointer = PyCObject_FromVoidPtr((void *) type_list_handle, NULL);
+-        if (pointer && module) {
+-            PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+-        }
+-        return type_list_handle;
+-    } 
+-    
+-    static swig_type_info **
+-    SWIG_Python_LookupTypePointer(swig_type_info **type_list_handle) {
+-        swig_type_info **type_pointer;
+-        
+-        /* first check if module already created */
+-        type_pointer = SWIG_Python_GetTypeListHandle();
+-        if (type_pointer) {
+-            return type_pointer;
+-        } else {
+-            /* create a new module and variable */
+-            return SWIG_Python_SetTypeListHandle(type_list_handle);
+-        }
+-    }
+-    
+-#ifdef __cplusplus
+-}
+-#endif
+-
+-/* -----------------------------------------------------------------------------*
+- *  Partial Init method
+- * -----------------------------------------------------------------------------*/
+-
+-#ifdef SWIG_LINK_RUNTIME
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-SWIGEXPORT(void *) SWIG_ReturnGlobalTypeList(void *);
+-#endif
+-
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-SWIGEXPORT(void) SWIG_init(void) {
+-    static PyObject *SWIG_globals = 0; 
+-    static int       typeinit = 0;
+-    PyObject *m, *d;
+-    int       i;
+-    if (!SWIG_globals) SWIG_globals = SWIG_newvarlink();
+-    
+-    /* Fix SwigMethods to carry the callback ptrs when needed */
+-    SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_types_initial);
+-    
+-    m = Py_InitModule((char *) SWIG_name, SwigMethods);
+-    d = PyModule_GetDict(m);
+-    
+-    if (!typeinit) {
+-#ifdef SWIG_LINK_RUNTIME
+-        swig_type_list_handle = (swig_type_info **) SWIG_ReturnGlobalTypeList(swig_type_list_handle);
+-#else
+-#  ifndef SWIG_STATIC_RUNTIME
+-        swig_type_list_handle = SWIG_Python_LookupTypePointer(swig_type_list_handle);
+-#  endif
+-#endif
+-        for (i = 0; swig_types_initial[i]; i++) {
+-            swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
+-        }
+-        typeinit = 1;
+-    }
+-    SWIG_InstallConstants(d,swig_const_table);
+-    
+-    {
+-        PyDict_SetItemString(d,"SEMANAGE_MSG_ERR", SWIG_From_int((int)(1))); 
+-    }
+-    {
+-        PyDict_SetItemString(d,"SEMANAGE_MSG_WARN", SWIG_From_int((int)(2))); 
+-    }
+-    {
+-        PyDict_SetItemString(d,"SEMANAGE_MSG_INFO", SWIG_From_int((int)(3))); 
+-    }
+-    {
+-        PyDict_SetItemString(d,"SEMANAGE_CON_INVALID", SWIG_From_int((int)(SEMANAGE_CON_INVALID))); 
+-    }
+-    {
+-        PyDict_SetItemString(d,"SEMANAGE_CON_DIRECT", SWIG_From_int((int)(SEMANAGE_CON_DIRECT))); 
+-    }
+-    {
+-        PyDict_SetItemString(d,"SEMANAGE_CON_POLSERV_LOCAL", SWIG_From_int((int)(SEMANAGE_CON_POLSERV_LOCAL))); 
+-    }
+-    {
+-        PyDict_SetItemString(d,"SEMANAGE_CON_POLSERV_REMOTE", SWIG_From_int((int)(SEMANAGE_CON_POLSERV_REMOTE))); 
+-    }
+-}
+-


Index: libsemanage.spec
===================================================================
RCS file: /cvs/dist/rpms/libsemanage/devel/libsemanage.spec,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- libsemanage.spec	17 Nov 2005 02:31:54 -0000	1.42
+++ libsemanage.spec	23 Nov 2005 15:06:09 -0000	1.43
@@ -2,10 +2,11 @@
 Summary: SELinux binary policy manipulation library 
 Name: libsemanage
 Version: 1.3.56
-Release: 1
+Release: 2
 License: GPL
 Group: System Environment/Libraries
 Source: http://www.nsa.gov/selinux/archives/libsemanage-%{version}.tgz
+Patch: libsemanage-swigify.patch
 
 BuildRoot: %{_tmppath}/%{name}-buildroot
 BuildRequires: libselinux-devel >= %{libselinuxver} 
@@ -37,6 +38,7 @@
 
 %prep
 %setup -q
+%patch -p1 -b .swigify
 
 %build
 make CFLAGS="%{optflags}"
@@ -71,6 +73,9 @@
 %{_includedir}/semanage/*.h
 
 %changelog
+* Wed Nov 23 2005 Dan Walsh <dwalsh at redhat.com> 1.3.56-2
+- Add additional swig objects
+
 * Fri Nov 16 2005 Dan Walsh <dwalsh at redhat.com> 1.3.56-1
 - Upgrade to latest from NSA
 	* Fixed free->key_free bug.




More information about the fedora-cvs-commits mailing list