- Fix Makefile to use pkg-config --cflags python3 to discover include paths

This commit is contained in:
Dan Walsh 2011-01-18 10:08:15 -05:00
parent ca9cea7698
commit 3c1b814b3d
2 changed files with 20 additions and 59 deletions

View File

@ -1,62 +1,8 @@
diff --git a/libselinux/man/man8/selinuxconlist.8 b/libselinux/man/man8/selinuxconlist.8
new file mode 100644
index 0000000..c698daa
--- /dev/null
+++ b/libselinux/man/man8/selinuxconlist.8
@@ -0,0 +1,18 @@
+.TH "selinuxconlist" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
+.SH "NAME"
+selinuxconlist \- list all SELinux context reachable for user
+.SH "SYNOPSIS"
+.B selinuxconlist [-l level] user [context]
+
+.SH "DESCRIPTION"
+.B selinuxconlist
+reports the list of context reachable for user from the current context or specified context
+
+.B \-l level
+mcs/mls level
+
+.SH AUTHOR
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
+
+.SH "SEE ALSO"
+secon(8), selinuxdefcon(8)
diff --git a/libselinux/man/man8/selinuxdefcon.8 b/libselinux/man/man8/selinuxdefcon.8
new file mode 100644
index 0000000..3cbeff2
--- /dev/null
+++ b/libselinux/man/man8/selinuxdefcon.8
@@ -0,0 +1,24 @@
+.TH "selinuxdefcon" "1" "7 May 2008" "dwalsh@redhat.com" "SELinux Command Line documentation"
+.SH "NAME"
+selinuxdefcon \- report default SELinux context for user
+
+.SH "SYNOPSIS"
+.B selinuxdefcon [-l level] user fromcon
+
+.SH "DESCRIPTION"
+.B selinuxdefcon
+reports the default context for the specified user from the specified context
+
+.B \-l level
+mcs/mls level
+
+.SH EXAMPLE
+# selinuxdefcon jsmith system_u:system_r:sshd_t:s0
+.br
+unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
+
+.SH AUTHOR
+This manual page was written by Dan Walsh <dwalsh@redhat.com>.
+
+.SH "SEE ALSO"
+secon(8), selinuxconlist(8)
diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
index bf665ab..8aeb7a1 100644
index bf665ab..ccd08ae 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
@@ -1,9 +1,10 @@
@@ -1,10 +1,11 @@
# Installation directories.
+PYTHON ?= python
PREFIX ?= $(DESTDIR)/usr
@ -64,10 +10,12 @@ index bf665ab..8aeb7a1 100644
SHLIBDIR ?= $(DESTDIR)/lib
INCLUDEDIR ?= $(PREFIX)/include
-PYLIBVER ?= $(shell python -c 'import sys;print "python%d.%d" % sys.version_info[0:2]')
-PYINC ?= /usr/include/$(PYLIBVER)
+PYLIBVER ?= $(shell $(PYTHON) -c 'import sys;print("python%d.%d" % sys.version_info[0:2])')
PYINC ?= /usr/include/$(PYLIBVER)
+PYINC ?= $(shell pkg-config --cflags `basename $(PYTHON)`)
PYLIB ?= /usr/lib/$(PYLIBVER)
PYTHONLIBDIR ?= $(LIBDIR)/$(PYLIBVER)
RUBYLIBVER ?= $(shell ruby -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
@@ -23,13 +24,13 @@ SWIGIF= selinuxswig_python.i selinuxswig_python_exception.i
SWIGRUBYIF= selinuxswig_ruby.i
SWIGCOUT= selinuxswig_wrap.c
@ -85,13 +33,23 @@ index bf665ab..8aeb7a1 100644
ifeq ($(DISABLE_AVC),y)
UNUSED_SRCS+=avc.c avc_internal.c avc_sidtab.c mapping.c stringrep.c checkAccess.c
@@ -70,7 +71,7 @@ $(LIBA): $(OBJS)
$(RANLIB) $@
$(SWIGLOBJ): $(SWIGCOUT)
- $(CC) $(filter-out -Werror,$(CFLAGS)) -I$(PYINC) -fPIC -DSHARED -c -o $@ $<
+ $(CC) $(filter-out -Werror,$(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $<
$(SWIGRUBYLOBJ): $(SWIGRUBYCOUT)
$(CC) $(filter-out -Werror,$(CFLAGS)) -I$(RUBYINC) -fPIC -DSHARED -c -o $@ $<
@@ -91,10 +92,10 @@ $(LIBPC): $(LIBPC).in
selinuxswig_python_exception.i: ../include/selinux/selinux.h
bash exception.sh > $@
-audit2why.lo: audit2why.c
- $(CC) $(CFLAGS) -I$(PYINC) -fPIC -DSHARED -c -o $@ $<
+$(PYPREFIX)audit2why.lo: audit2why.c
$(CC) $(CFLAGS) -I$(PYINC) -fPIC -DSHARED -c -o $@ $<
+ $(CC) $(CFLAGS) $(PYINC) -fPIC -DSHARED -c -o $@ $<
-$(AUDIT2WHYSO): audit2why.lo
+$(AUDIT2WHYSO): $(PYPREFIX)audit2why.lo

View File

@ -7,7 +7,7 @@
Summary: SELinux library and simple utilities
Name: libselinux
Version: 2.0.98
Release: 1%{?dist}
Release: 2%{?dist}
License: Public Domain
Group: System Environment/Libraries
Source: http://www.nsa.gov/research/selinux/%{name}-%{version}.tgz
@ -236,6 +236,9 @@ exit 0
%{ruby_sitearch}/selinux.so
%changelog
* Tue Jan 18 2012 Dan Walsh <dwalsh@redhat.com> - 2.0.98-2
- Fix Makefile to use pkg-config --cflags python3 to discover include paths
* Tue Dec 21 2010 Dan Walsh <dwalsh@redhat.com> - 2.0.98-1
- Update to upstream
- Turn off fallback in to SELINUX_DEFAULTUSER in get_context_list