diff --git a/libselinux-rhat.patch b/libselinux-rhat.patch index 242007c..7a50559 100644 --- a/libselinux-rhat.patch +++ b/libselinux-rhat.patch @@ -1,3 +1,75 @@ +diff --git a/libselinux/Makefile b/libselinux/Makefile +index 9feaf94..fd4f0b1 100644 +--- a/libselinux/Makefile ++++ b/libselinux/Makefile +@@ -1,3 +1,5 @@ ++SUBDIRS = src include utils man ++ + DISABLE_AVC ?= n + DISABLE_SETRANS ?= n + DISABLE_RPM ?= n +@@ -19,41 +21,24 @@ ifeq ($(DISABLE_SETRANS),y) + endif + export DISABLE_AVC DISABLE_SETRANS DISABLE_RPM DISABLE_BOOL EMFLAGS + +-all: +- $(MAKE) -C src +- $(MAKE) -C utils ++all install relabel clean distclean indent: ++ @for subdir in $(SUBDIRS); do \ ++ (cd $$subdir && $(MAKE) $@) || exit 1; \ ++ done + + swigify: all +- $(MAKE) -C src swigify ++ $(MAKE) -C src swigify $@ + + pywrap: +- $(MAKE) -C src pywrap ++ $(MAKE) -C src pywrap $@ + + rubywrap: +- $(MAKE) -C src rubywrap +- +-install: +- $(MAKE) -C include install +- $(MAKE) -C src install +- $(MAKE) -C utils install +- $(MAKE) -C man install ++ $(MAKE) -C src rubywrap $@ + + install-pywrap: +- $(MAKE) -C src install-pywrap ++ $(MAKE) -C src install-pywrap $@ + + install-rubywrap: +- $(MAKE) -C src install-rubywrap +- +-relabel: +- $(MAKE) -C src relabel +- +-clean distclean: +- $(MAKE) -C src $@ +- $(MAKE) -C utils clean +- +-indent: +- $(MAKE) -C src $@ +- $(MAKE) -C utils $@ +- $(MAKE) -C include $@ ++ $(MAKE) -C src install-rubywrap $@ + + test: +diff --git a/libselinux/include/Makefile b/libselinux/include/Makefile +index 09bcea3..dd264d0 100644 +--- a/libselinux/include/Makefile ++++ b/libselinux/include/Makefile +@@ -11,3 +11,6 @@ install: all + indent: + ../../scripts/Lindent $(wildcard selinux/*.h) + ++distclean clean: ++ -rm -f selinux/*~ ++ diff --git a/libselinux/include/selinux/avc.h b/libselinux/include/selinux/avc.h index da18e41..87a2b12 100644 --- a/libselinux/include/selinux/avc.h @@ -68,6 +140,15 @@ index 2985f6f..e0b2dd4 100644 /* Check if selinuxfs exists as a kernel filesystem */ int selinuxfs_exists(void); +diff --git a/libselinux/man/Makefile b/libselinux/man/Makefile +index a20a5d1..a53c4ad 100644 +--- a/libselinux/man/Makefile ++++ b/libselinux/man/Makefile +@@ -13,3 +13,4 @@ install: all + install -m 644 man5/*.5 $(MAN5DIR) + install -m 644 man8/*.8 $(MAN8DIR) + ++indent distclean clean: diff --git a/libselinux/man/man3/matchpathcon.3 b/libselinux/man/man3/matchpathcon.3 index cdbb252..b6814ed 100644 --- a/libselinux/man/man3/matchpathcon.3 @@ -708,14 +789,20 @@ index f0167e7..176ac34 100644 { unsigned int val; diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile -index 6f5aa52..4b2f348 100644 +index 6f5aa52..d76ccfa 100644 --- a/libselinux/utils/Makefile +++ b/libselinux/utils/Makefile -@@ -4,7 +4,25 @@ LIBDIR ?= $(PREFIX)/lib - BINDIR ?= $(PREFIX)/sbin - _BINDIR ?= $(DESTDIR)/sbin - +@@ -1,10 +1,28 @@ + # Installation directories. + PREFIX ?= $(DESTDIR)/usr + LIBDIR ?= $(PREFIX)/lib +-BINDIR ?= $(PREFIX)/sbin +-_BINDIR ?= $(DESTDIR)/sbin +- -CFLAGS ?= -Werror -Wall -W ++USRBINDIR ?= $(PREFIX)/sbin ++SBINDIR ?= $(DESTDIR)/sbin ++ +MAX_STACK_SIZE=8192 +CFLAGS ?= -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs \ + -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith \ @@ -738,6 +825,33 @@ index 6f5aa52..4b2f348 100644 override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS) LDLIBS += -L../src -lselinux -L$(LIBDIR) +@@ -17,18 +35,18 @@ endif + ifeq ($(DISABLE_BOOL),y) + UNUSED_TARGETS+=getsebool togglesebool + endif +-TARGETS:= $(filter-out $(UNUSED_TARGETS) matchpathcon, $(TARGETS)) ++TARGETS:= $(filter-out $(UNUSED_TARGETS), $(TARGETS)) + +-all: $(TARGETS) matchpathcon ++all: $(TARGETS) + + install: all +- -mkdir -p $(BINDIR) +- install -m 755 $(TARGETS) $(BINDIR) +- -mkdir -p $(_BINDIR) +- install -m 755 matchpathcon $(_BINDIR) +- (cd $(BINDIR); ln -fs ../../sbin/matchpathcon) ++ -mkdir -p $(USRBINDIR) ++ install -m 755 $(TARGETS) $(USRBINDIR) ++ -mkdir -p $(SBINDIR) + clean: +- rm -f $(TARGETS) matchpathcon *.o *~ ++ rm -f $(TARGETS) *.o *~ ++ ++distclean: clean + + indent: + ../../scripts/Lindent $(wildcard *.[ch]) diff --git a/libselinux/utils/avcstat.c b/libselinux/utils/avcstat.c index 772118a..7239ef2 100644 --- a/libselinux/utils/avcstat.c diff --git a/libselinux.spec b/libselinux.spec index 16bb87f..1fd94e4 100644 --- a/libselinux.spec +++ b/libselinux.spec @@ -7,7 +7,7 @@ Summary: SELinux library and simple utilities Name: libselinux Version: 2.1.9 -Release: 4%{?dist} +Release: 5%{?dist} License: Public Domain Group: System Environment/Libraries Source: %{name}-%{version}.tgz @@ -120,7 +120,7 @@ BuildPythonWrapper %{__python} BuildPythonWrapper %{__python3} %endif # with_python3 -make LIBDIR="%{_libdir}" CFLAGS="-g %{optflags}" %{?_smp_mflags} rubywrap +make SHLIBDIR="%{_libdir}" LIBDIR="%{_libdir}" CFLAGS="-g %{optflags}" %{?_smp_mflags} rubywrap %install InstallPythonWrapper() { @@ -134,8 +134,9 @@ InstallPythonWrapper() { make \ PYTHON=$BinaryName \ DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" \ - SHLIBDIR="%{buildroot}/%{_lib}" BINDIR="%{buildroot}%{_sbindir}" \ - install install-pywrap + SHLIBDIR="%{buildroot}/%{_lib}" BINDIR="%{buildroot}%{_bindir}" \ + SBINDIR="%{buildroot}%{_sbindir}" \ + install-pywrap } rm -rf %{buildroot} @@ -152,7 +153,7 @@ InstallPythonWrapper %{__python} InstallPythonWrapper %{__python3} %endif # with_python3 -make DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" SHLIBDIR="%{buildroot}%{_libdir}" BINDIR="%{buildroot}%{_sbindir}" install install-rubywrap +make DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" SHLIBDIR="%{buildroot}%{_libdir}" BINDIR="%{buildroot}%{_bindir}" SBINDIR="%{buildroot}%{_sbindir}" install install-rubywrap # Nuke the files we don't want to distribute rm -f %{buildroot}%{_sbindir}/compute_* @@ -171,16 +172,12 @@ rm -f %{buildroot}%{_sbindir}/selinux_check_securetty_context mv %{buildroot}%{_sbindir}/getdefaultcon %{buildroot}%{_sbindir}/selinuxdefcon mv %{buildroot}%{_sbindir}/getconlist %{buildroot}%{_sbindir}/selinuxconlist -# Move stuff from /lib, /sbin to /usr -mv -f %{buildroot}/sbin/matchpathcon %{buildroot}%{_sbindir}/ || : -mv -f %{buildroot}/%{_lib}/libselinux.so.1 %{buildroot}%{_libdir}/ || : - %clean rm -rf %{buildroot} -%post -p /sbin/ldconfig +%post -p /usr/sbin/ldconfig -%postun -p /sbin/ldconfig +%postun -p /usr/sbin/ldconfig %files %defattr(-,root,root,-) @@ -235,6 +232,9 @@ rm -rf %{buildroot} %{ruby_sitearch}/selinux.so %changelog +* Fri Jan 27 2012 Dan Walsh - 2.1.9-5 +- Rebuild with cleaned up upstream to work in /usr + * Wed Jan 25 2012 Harald Hoyer 2.1.9-4 - install everything in /usr https://fedoraproject.org/wiki/Features/UsrMove