[libselinux] install everything in /usr

Harald Hoyer harald at fedoraproject.org
Wed Jan 25 19:49:03 UTC 2012


commit cca484b26bbfebad7cf33457ea0cb9f316c17e40
Author: Harald Hoyer <harald at redhat.com>
Date:   Wed Jan 25 19:01: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 compatibility symlinks must not be
    installed.
    
    Feel free to modify any of the changes to the spec file, but keep the
    above in mind.

 libselinux.spec |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/libselinux.spec b/libselinux.spec
index eef2acf..16bb87f 100644
--- a/libselinux.spec
+++ b/libselinux.spec
@@ -7,7 +7,7 @@
 Summary: SELinux library and simple utilities
 Name: libselinux
 Version: 2.1.9
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: Public Domain
 Group: System Environment/Libraries
 Source: %{name}-%{version}.tgz
@@ -18,6 +18,7 @@ BuildRequires: python-devel ruby-devel ruby libsepol-static >= %{libsepolver} sw
 BuildRequires: python3-devel
 %endif # if with_python3
 Requires: libsepol >= %{libsepolver}
+Conflicts: filesystem < 3
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description
@@ -151,7 +152,7 @@ InstallPythonWrapper %{__python}
 InstallPythonWrapper %{__python3}
 %endif # with_python3
 
-make DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" SHLIBDIR="%{buildroot}/%{_lib}" BINDIR="%{buildroot}%{_sbindir}" install install-rubywrap
+make DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_libdir}" SHLIBDIR="%{buildroot}%{_libdir}" BINDIR="%{buildroot}%{_sbindir}" install install-rubywrap
 
 # Nuke the files we don't want to distribute
 rm -f %{buildroot}%{_sbindir}/compute_*
@@ -170,6 +171,10 @@ 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}
 
@@ -179,9 +184,9 @@ rm -rf %{buildroot}
 
 %files
 %defattr(-,root,root,-)
-/%{_lib}/libselinux.so.*
+%{_libdir}/libselinux.so.*
 /var/run/setrans
-/sbin/matchpathcon
+%{_sbindir}/matchpathcon
 /etc/tmpfiles.d/libselinux.conf
 
 %files utils
@@ -189,7 +194,6 @@ rm -rf %{buildroot}
 %{_sbindir}/avcstat
 %{_sbindir}/getenforce
 %{_sbindir}/getsebool
-%{_sbindir}/matchpathcon
 %{_sbindir}/selinuxconlist
 %{_sbindir}/selinuxdefcon
 %{_sbindir}/selinuxexeccon
@@ -231,6 +235,10 @@ rm -rf %{buildroot}
 %{ruby_sitearch}/selinux.so
 
 %changelog
+* Wed Jan 25 2012 Harald Hoyer <harald at redhat.com> 2.1.9-4
+- install everything in /usr
+  https://fedoraproject.org/wiki/Features/UsrMove
+
 * Mon Jan 23 2012 Dan Walsh <dwalsh at redhat.com> - 2.1.9-3
 - Add Dan Berrange code cleanup patches.
 


More information about the scm-commits mailing list