[policycoreutils] install everything in /usr
Harald Hoyer
harald at fedoraproject.org
Wed Jan 25 13:23:03 UTC 2012
commit 53f4a4c7dc06417a5cde8dd39a0897f08a436de9
Author: Harald Hoyer <harald at redhat.com>
Date: Wed Jan 25 14:22:37 2012 +0100
install everything in /usr
This patch is needed for the /usr-move feature
https://fedoraproject.org/wiki/Features/UsrMove
This package requires now 'filesystem' >= 3, which is only installable
on a system which has /bin, /sbin, /lib, /lib64 as symlinks to /usr and
not regular directories. The 'filesystem' package acts as a guard, to
prevent *this* package to be installed on old unconverted systems.
New installations will have the 'filesystem' >=3 layout right away, old
installations need to be converted with anaconda or dracut first; only
after that, the 'filesystem' package, and also *this* package can be
installed.
Packages *should* not install files in /bin, /sbin, /lib, /lib64, but
only in the corresponding directories in /usr. Packages *must* not
install conflicting files with the same names in the corresponding
directories in / and /usr. Especially compatibilty symlinks must not be
installed.
Feel free to modify any of the changes to the spec file, but keep the
above in mind.
policycoreutils.spec | 30 +++++++++++++++++++-----------
1 files changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/policycoreutils.spec b/policycoreutils.spec
index 24b94a1..47a0754 100644
--- a/policycoreutils.spec
+++ b/policycoreutils.spec
@@ -7,7 +7,7 @@
Summary: SELinux policy core utilities
Name: policycoreutils
Version: 2.1.10
-Release: 11%{?dist}
+Release: 12%{?dist}
License: GPLv2
Group: System Environment/Base
# Based on git repository with tag 20101221
@@ -28,6 +28,9 @@ Patch1: policycoreutils-po.patch
Patch3: policycoreutils-gui.patch
Patch4: policycoreutils-sepolgen.patch
Obsoletes: policycoreutils < 2.0.61-2
+#Conflicts: filesystem < 3
+Provides: /sbin/fixfiles
+Provides: /sbin/restorecon
%global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")
@@ -68,16 +71,17 @@ context.
%patch3 -p1 -b .gui
%patch4 -p2 -b .sepolgen -d sepolgen-%{sepolgenver}
+sed -i 's#$(DESTDIR)/sbin#$(SBINDIR)#g' scripts/Makefile
+
%build
-make LSPP_PRIV=y LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro" all
-make -C sepolgen-%{sepolgenver} LSPP_PRIV=y LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro" all
+make LSPP_PRIV=y SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro" all
+make -C sepolgen-%{sepolgenver} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro" all
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/var/lib/selinux
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_sbindir}
-mkdir -p %{buildroot}/sbin
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_mandir}/man5
mkdir -p %{buildroot}%{_mandir}/man8
@@ -88,14 +92,14 @@ mkdir -p %{buildroot}%{_sysconfdir}/security/console.apps
%{__mkdir} -p %{buildroot}/%{_usr}/share/doc/%{name}-%{version}/
cp COPYING %{buildroot}/%{_usr}/share/doc/%{name}-%{version}/
-make LSPP_PRIV=y DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" install
-make -C gui LSPP_PRIV=y DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" install
+make LSPP_PRIV=y DESTDIR="%{buildroot}" SBINDIR="%{buildroot}%{_sbindir}" LIBDIR="%{buildroot}%{_libdir}" install
+make -C gui LSPP_PRIV=y DESTDIR="%{buildroot}" SBINDIR="%{buildroot}%{_sbindir}" LIBDIR="%{buildroot}%{_libdir}" install
# Systemd
mkdir -p %{buildroot}%{_unitdir}
install -m644 %{SOURCE10} %{buildroot}%{_unitdir}
rm -rf %{buildroot}/%{_sysconfdir}/rc.d/init.d/restorecond
-make -C sepolgen-%{sepolgenver} DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" install
+make -C sepolgen-%{sepolgenver} DESTDIR="%{buildroot}" SBINDIR="%{buildroot}%{_sbindir}" LIBDIR="%{buildroot}%{_libdir}" install
install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps
install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/icons/hicolor/24x24/apps
@@ -260,10 +264,10 @@ rm -rf %{buildroot}
%files -f %{name}.lang
%defattr(-,root,root)
-/sbin/restorecon
-/sbin/fixfiles
-/sbin/setfiles
-/sbin/load_policy
+%{_sbindir}/restorecon
+%{_sbindir}/fixfiles
+%{_sbindir}/setfiles
+%{_sbindir}/load_policy
%{_sbindir}/genhomedircon
%{_sbindir}/load_policy
%{_sbindir}/setsebool
@@ -355,6 +359,10 @@ fi
/bin/systemctl try-restart restorecond.service >/dev/null 2>&1 || :
%changelog
+* Wed Jan 25 2012 Harald Hoyer <harald at redhat.com> 2.1.10-12
+- install everything in /usr
+ https://fedoraproject.org/wiki/Features/UsrMove
+
* Tue Jan 24 2012 Dan Walsh <dwalsh at redhat.com> - 2.1.10-11
- restorecond fixes:
Stop using depracated g_io interfaces
More information about the scm-commits
mailing list