Rebuild with cleaned up upstream to work in /usr
This commit is contained in:
parent
cca484b26b
commit
86fcde8ff1
@ -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
|
diff --git a/libselinux/include/selinux/avc.h b/libselinux/include/selinux/avc.h
|
||||||
index da18e41..87a2b12 100644
|
index da18e41..87a2b12 100644
|
||||||
--- a/libselinux/include/selinux/avc.h
|
--- a/libselinux/include/selinux/avc.h
|
||||||
@ -68,6 +140,15 @@ index 2985f6f..e0b2dd4 100644
|
|||||||
|
|
||||||
/* Check if selinuxfs exists as a kernel filesystem */
|
/* Check if selinuxfs exists as a kernel filesystem */
|
||||||
int selinuxfs_exists(void);
|
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
|
diff --git a/libselinux/man/man3/matchpathcon.3 b/libselinux/man/man3/matchpathcon.3
|
||||||
index cdbb252..b6814ed 100644
|
index cdbb252..b6814ed 100644
|
||||||
--- a/libselinux/man/man3/matchpathcon.3
|
--- a/libselinux/man/man3/matchpathcon.3
|
||||||
@ -708,14 +789,20 @@ index f0167e7..176ac34 100644
|
|||||||
{
|
{
|
||||||
unsigned int val;
|
unsigned int val;
|
||||||
diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile
|
diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile
|
||||||
index 6f5aa52..4b2f348 100644
|
index 6f5aa52..d76ccfa 100644
|
||||||
--- a/libselinux/utils/Makefile
|
--- a/libselinux/utils/Makefile
|
||||||
+++ b/libselinux/utils/Makefile
|
+++ b/libselinux/utils/Makefile
|
||||||
@@ -4,7 +4,25 @@ LIBDIR ?= $(PREFIX)/lib
|
@@ -1,10 +1,28 @@
|
||||||
BINDIR ?= $(PREFIX)/sbin
|
# Installation directories.
|
||||||
_BINDIR ?= $(DESTDIR)/sbin
|
PREFIX ?= $(DESTDIR)/usr
|
||||||
|
LIBDIR ?= $(PREFIX)/lib
|
||||||
|
-BINDIR ?= $(PREFIX)/sbin
|
||||||
|
-_BINDIR ?= $(DESTDIR)/sbin
|
||||||
|
-
|
||||||
-CFLAGS ?= -Werror -Wall -W
|
-CFLAGS ?= -Werror -Wall -W
|
||||||
|
+USRBINDIR ?= $(PREFIX)/sbin
|
||||||
|
+SBINDIR ?= $(DESTDIR)/sbin
|
||||||
|
+
|
||||||
+MAX_STACK_SIZE=8192
|
+MAX_STACK_SIZE=8192
|
||||||
+CFLAGS ?= -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs \
|
+CFLAGS ?= -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs \
|
||||||
+ -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith \
|
+ -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith \
|
||||||
@ -738,6 +825,33 @@ index 6f5aa52..4b2f348 100644
|
|||||||
override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS)
|
override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS)
|
||||||
LDLIBS += -L../src -lselinux -L$(LIBDIR)
|
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
|
diff --git a/libselinux/utils/avcstat.c b/libselinux/utils/avcstat.c
|
||||||
index 772118a..7239ef2 100644
|
index 772118a..7239ef2 100644
|
||||||
--- a/libselinux/utils/avcstat.c
|
--- a/libselinux/utils/avcstat.c
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
Summary: SELinux library and simple utilities
|
Summary: SELinux library and simple utilities
|
||||||
Name: libselinux
|
Name: libselinux
|
||||||
Version: 2.1.9
|
Version: 2.1.9
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
License: Public Domain
|
License: Public Domain
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
Source: %{name}-%{version}.tgz
|
Source: %{name}-%{version}.tgz
|
||||||
@ -120,7 +120,7 @@ BuildPythonWrapper %{__python}
|
|||||||
BuildPythonWrapper %{__python3}
|
BuildPythonWrapper %{__python3}
|
||||||
%endif # with_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
|
%install
|
||||||
InstallPythonWrapper() {
|
InstallPythonWrapper() {
|
||||||
@ -134,8 +134,9 @@ InstallPythonWrapper() {
|
|||||||
make \
|
make \
|
||||||
PYTHON=$BinaryName \
|
PYTHON=$BinaryName \
|
||||||
DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" \
|
DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" \
|
||||||
SHLIBDIR="%{buildroot}/%{_lib}" BINDIR="%{buildroot}%{_sbindir}" \
|
SHLIBDIR="%{buildroot}/%{_lib}" BINDIR="%{buildroot}%{_bindir}" \
|
||||||
install install-pywrap
|
SBINDIR="%{buildroot}%{_sbindir}" \
|
||||||
|
install-pywrap
|
||||||
}
|
}
|
||||||
|
|
||||||
rm -rf %{buildroot}
|
rm -rf %{buildroot}
|
||||||
@ -152,7 +153,7 @@ InstallPythonWrapper %{__python}
|
|||||||
InstallPythonWrapper %{__python3}
|
InstallPythonWrapper %{__python3}
|
||||||
%endif # with_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
|
# Nuke the files we don't want to distribute
|
||||||
rm -f %{buildroot}%{_sbindir}/compute_*
|
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}/getdefaultcon %{buildroot}%{_sbindir}/selinuxdefcon
|
||||||
mv %{buildroot}%{_sbindir}/getconlist %{buildroot}%{_sbindir}/selinuxconlist
|
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
|
%clean
|
||||||
rm -rf %{buildroot}
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
%post -p /sbin/ldconfig
|
%post -p /usr/sbin/ldconfig
|
||||||
|
|
||||||
%postun -p /sbin/ldconfig
|
%postun -p /usr/sbin/ldconfig
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
@ -235,6 +232,9 @@ rm -rf %{buildroot}
|
|||||||
%{ruby_sitearch}/selinux.so
|
%{ruby_sitearch}/selinux.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jan 27 2012 Dan Walsh <dwalsh@redhat.com> - 2.1.9-5
|
||||||
|
- Rebuild with cleaned up upstream to work in /usr
|
||||||
|
|
||||||
* Wed Jan 25 2012 Harald Hoyer <harald@redhat.com> 2.1.9-4
|
* Wed Jan 25 2012 Harald Hoyer <harald@redhat.com> 2.1.9-4
|
||||||
- install everything in /usr
|
- install everything in /usr
|
||||||
https://fedoraproject.org/wiki/Features/UsrMove
|
https://fedoraproject.org/wiki/Features/UsrMove
|
||||||
|
Loading…
Reference in New Issue
Block a user