- Split out pywrap in Makefile

This commit is contained in:
Daniel J Walsh 2006-01-14 05:05:19 +00:00
parent ee0a60b0f5
commit f4d57a9014
2 changed files with 39 additions and 204 deletions

View File

@ -1,204 +1,36 @@
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig.i libselinux-1.29.2/src/selinuxswig.i diff --exclude-from=exclude -N -u -r nsalibselinux/Makefile libselinux-1.29.5/Makefile
--- nsalibselinux/src/selinuxswig.i 2005-12-08 12:52:24.000000000 -0500 --- nsalibselinux/Makefile 2005-02-09 17:04:51.000000000 -0500
+++ libselinux-1.29.2/src/selinuxswig.i 2005-12-20 09:41:32.000000000 -0500 +++ libselinux-1.29.5/Makefile 2006-01-13 23:54:13.000000000 -0500
@@ -36,7 +37,7 @@ @@ -2,12 +2,18 @@
extern int is_selinux_mls_enabled(void); $(MAKE) -C src
extern int getcon(security_context_t *con); $(MAKE) -C utils
extern int setcon(security_context_t con);
-extern int getpidcon(pid_t pid, security_context_t *con);
+extern int getpidcon(int pid, security_context_t *con);
extern int getprevcon(security_context_t *con);
extern int getexeccon(security_context_t *con);
extern int setexeccon(security_context_t con);
diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_wrap.c libselinux-1.29.2/src/selinuxswig_wrap.c
--- nsalibselinux/src/selinuxswig_wrap.c 2005-12-08 12:52:24.000000000 -0500
+++ libselinux-1.29.2/src/selinuxswig_wrap.c 2005-12-20 09:41:35.000000000 -0500
@@ -1322,17 +1322,16 @@
/* -------- TYPES TABLE (BEGIN) -------- */
#define SWIGTYPE_p_mode_t swig_types[0] +pywrap:
-#define SWIGTYPE_p_pid_t swig_types[1] + $(MAKE) -C src pywrap
-#define SWIGTYPE_p_SELboolean swig_types[2]
-#define SWIGTYPE_p_char swig_types[3]
-#define SWIGTYPE_p_p_p_char swig_types[4]
-#define SWIGTYPE_p_access_vector_t swig_types[5]
-#define SWIGTYPE_p_p_char swig_types[6]
-#define SWIGTYPE_size_t swig_types[7]
-#define SWIGTYPE_p_security_context_t swig_types[8]
-#define SWIGTYPE_ptrdiff_t swig_types[9]
-#define SWIGTYPE_p_int swig_types[10]
-static swig_type_info *swig_types[12];
+#define SWIGTYPE_p_SELboolean swig_types[1]
+#define SWIGTYPE_p_char swig_types[2]
+#define SWIGTYPE_p_p_p_char swig_types[3]
+#define SWIGTYPE_p_access_vector_t swig_types[4]
+#define SWIGTYPE_p_p_char swig_types[5]
+#define SWIGTYPE_size_t swig_types[6]
+#define SWIGTYPE_p_security_context_t swig_types[7]
+#define SWIGTYPE_ptrdiff_t swig_types[8]
+#define SWIGTYPE_p_int swig_types[9]
+static swig_type_info *swig_types[11];
/* -------- TYPES TABLE (END) -------- */
@@ -1355,59 +1354,7 @@
int is_selinux_mls_enabled(void);
int getcon(security_context_t *);
int setcon(security_context_t);
-int getpidcon(pid_t,security_context_t *);
-int getprevcon(security_context_t *);
-int getexeccon(security_context_t *);
-int setexeccon(security_context_t);
-int getfscreatecon(security_context_t *);
-int setfscreatecon(security_context_t);
-int getfilecon(char const *,security_context_t *);
-
-/* returns SWIG_OLDOBJ if the input is a raw char*, SWIG_PYSTR if is a PyString */
-SWIGINTERN int
-SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize)
-{
- static swig_type_info* pchar_info = 0;
- char* vptr = 0;
- if (!pchar_info) pchar_info = SWIG_TypeQuery("char *");
- if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_info, 0) != -1) {
- if (cptr) *cptr = vptr;
- if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
- return SWIG_OLDOBJ;
- } else {
- PyErr_Clear();
- if (PyString_Check(obj)) {
- if (cptr) {
- *cptr = PyString_AS_STRING(obj);
- if (psize) {
- *psize = PyString_GET_SIZE(obj) + 1;
- }
- }
- return SWIG_PYSTR;
- }
- }
- if (cptr) {
- SWIG_type_error("char *", obj);
- }
- return 0;
-}
-
-
-SWIGINTERNSHORT int
-SWIG_AsCharPtr(PyObject *obj, char **val)
-{
- if (SWIG_AsCharPtrAndSize(obj, val, (size_t*)(0))) {
- return 1;
- }
- if (val) {
- PyErr_Clear();
- SWIG_type_error("char *", obj);
- }
- return 0;
-}
-
-int lgetfilecon(char const *,security_context_t *);
-int fgetfilecon(int,security_context_t *);
+int getpidcon(int,security_context_t *);
#include <limits.h>
@@ -1509,6 +1456,58 @@
return SWIG_AsVal_int(obj, (int*)0);
}
+int getprevcon(security_context_t *);
+int getexeccon(security_context_t *);
+int setexeccon(security_context_t);
+int getfscreatecon(security_context_t *);
+int setfscreatecon(security_context_t);
+int getfilecon(char const *,security_context_t *);
+ +
+/* returns SWIG_OLDOBJ if the input is a raw char*, SWIG_PYSTR if is a PyString */ install:
+SWIGINTERN int $(MAKE) -C include install
+SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize) $(MAKE) -C src install
+{ $(MAKE) -C utils install
+ static swig_type_info* pchar_info = 0; $(MAKE) -C man install
+ char* vptr = 0;
+ if (!pchar_info) pchar_info = SWIG_TypeQuery("char *"); +install-pywrap:
+ if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_info, 0) != -1) { + $(MAKE) -C src install-pywrap
+ if (cptr) *cptr = vptr;
+ if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
+ return SWIG_OLDOBJ;
+ } else {
+ PyErr_Clear();
+ if (PyString_Check(obj)) {
+ if (cptr) {
+ *cptr = PyString_AS_STRING(obj);
+ if (psize) {
+ *psize = PyString_GET_SIZE(obj) + 1;
+ }
+ }
+ return SWIG_PYSTR;
+ }
+ }
+ if (cptr) {
+ SWIG_type_error("char *", obj);
+ }
+ return 0;
+}
+ +
relabel:
$(MAKE) -C src relabel
diff --exclude-from=exclude -N -u -r nsalibselinux/src/Makefile libselinux-1.29.5/src/Makefile
--- nsalibselinux/src/Makefile 2006-01-04 10:37:34.000000000 -0500
+++ libselinux-1.29.5/src/Makefile 2006-01-13 23:54:50.000000000 -0500
@@ -26,7 +26,9 @@
SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
-all: $(LIBA) $(LIBSO) $(SWIGSO)
+all: $(LIBA) $(LIBSO)
+ +
+SWIGINTERNSHORT int +pywrap: $(SWIGSO)
+SWIG_AsCharPtr(PyObject *obj, char **val)
+{
+ if (SWIG_AsCharPtrAndSize(obj, val, (size_t*)(0))) {
+ return 1;
+ }
+ if (val) {
+ PyErr_Clear();
+ SWIG_type_error("char *", obj);
+ }
+ return 0;
+}
+
+int lgetfilecon(char const *,security_context_t *);
+int fgetfilecon(int,security_context_t *);
int setfilecon(char const *,security_context_t);
int lsetfilecon(char const *,security_context_t);
int fsetfilecon(int,security_context_t);
@@ -1799,7 +1798,7 @@
static PyObject *_wrap_getpidcon(PyObject *self, PyObject *args) { $(LIBA): $(OBJS)
PyObject *resultobj; $(AR) rcs $@ $^
- pid_t arg1 ;
+ int arg1 ;
security_context_t *arg2 = (security_context_t *) 0 ;
int result;
security_context_t temp2 ;
@@ -1810,14 +1809,8 @@
}
if(!PyArg_ParseTuple(args,(char *)"O:getpidcon",&obj0)) goto fail;
{
- pid_t * argp;
- SWIG_Python_ConvertPtr(obj0, (void **)&argp, SWIGTYPE_p_pid_t, SWIG_POINTER_EXCEPTION);
- if (SWIG_arg_fail(1)) SWIG_fail;
- if (argp == NULL) {
- SWIG_null_ref("pid_t");
- }
+ arg1 = (int)(SWIG_As_int(obj0));
if (SWIG_arg_fail(1)) SWIG_fail;
- arg1 = *argp;
}
result = (int)getpidcon(arg1,arg2);
@@ -3142,7 +3135,6 @@
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
static swig_type_info _swigt__p_mode_t[] = {{"_p_mode_t", 0, "mode_t *", 0, 0, 0, 0},{"_p_mode_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_pid_t[] = {{"_p_pid_t", 0, "pid_t *", 0, 0, 0, 0},{"_p_pid_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
static swig_type_info _swigt__p_SELboolean[] = {{"_p_SELboolean", 0, "SELboolean *", 0, 0, 0, 0},{"_p_SELboolean", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
static swig_type_info _swigt__p_p_p_char[] = {{"_p_p_p_char", 0, "char ***", 0, 0, 0, 0},{"_p_p_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
@@ -3155,7 +3147,6 @@
static swig_type_info *swig_types_initial[] = {
_swigt__p_mode_t,
-_swigt__p_pid_t,
_swigt__p_SELboolean,
_swigt__p_char,
_swigt__p_p_p_char,

View File

@ -3,11 +3,11 @@
Summary: SELinux library and simple utilities Summary: SELinux library and simple utilities
Name: libselinux Name: libselinux
Version: 1.29.5 Version: 1.29.5
Release: 1 Release: 2
License: Public domain (uncopyrighted) License: Public domain (uncopyrighted)
Group: System Environment/Libraries Group: System Environment/Libraries
Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz Source: http://www.nsa.gov/selinux/archives/%{name}-%{version}.tgz
#Patch: libselinux-rhat.patch Patch: libselinux-rhat.patch
BuildRequires: libsepol-devel >= %{libsepolver} BuildRequires: libsepol-devel >= %{libsepolver}
Requires: libsepol >= %{libsepolver} Requires: libsepol >= %{libsepolver}
@ -50,11 +50,11 @@ needed for developing SELinux applications.
%prep %prep
%setup -q %setup -q
#%patch -p1 -b .rhat %patch -p1 -b .rhat
%build %build
make clean make clean
make CFLAGS="-g %{optflags}" make CFLAGS="-g %{optflags}" all pywrap
%install %install
rm -rf ${RPM_BUILD_ROOT} rm -rf ${RPM_BUILD_ROOT}
@ -62,7 +62,7 @@ mkdir -p ${RPM_BUILD_ROOT}/%{_lib}
mkdir -p ${RPM_BUILD_ROOT}/%{_libdir} mkdir -p ${RPM_BUILD_ROOT}/%{_libdir}
mkdir -p ${RPM_BUILD_ROOT}%{_includedir} mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
make DESTDIR="${RPM_BUILD_ROOT}" LIBDIR="${RPM_BUILD_ROOT}%{_libdir}" SHLIBDIR="${RPM_BUILD_ROOT}/%{_lib}" BINDIR="${RPM_BUILD_ROOT}%{_sbindir}" install make DESTDIR="${RPM_BUILD_ROOT}" LIBDIR="${RPM_BUILD_ROOT}%{_libdir}" SHLIBDIR="${RPM_BUILD_ROOT}/%{_lib}" BINDIR="${RPM_BUILD_ROOT}%{_sbindir}" install install-pywrap
# Nuke the files we don't want to distribute # Nuke the files we don't want to distribute
rm -f ${RPM_BUILD_ROOT}%{_sbindir}/compute_* rm -f ${RPM_BUILD_ROOT}%{_sbindir}/compute_*
@ -110,6 +110,9 @@ exit 0
%{_libdir}/python2.4/site-packages/selinux.py* %{_libdir}/python2.4/site-packages/selinux.py*
%changelog %changelog
* Fri Jan 13 2006 Dan Walsh <dwalsh@redhat.com> 1.29.5-2
- Split out pywrap in Makefile
* Fri Jan 13 2006 Dan Walsh <dwalsh@redhat.com> 1.29.5-1 * Fri Jan 13 2006 Dan Walsh <dwalsh@redhat.com> 1.29.5-1
- Upgrade to latest from NSA - Upgrade to latest from NSA
* Added getseuser test program. * Added getseuser test program.