[udev] install everything in /usr

Kay Sievers kay at fedoraproject.org
Wed Jan 25 14:34:42 UTC 2012


commit dc3e663505775fa2e4d743d6a6033565ebdaf096
Author: Kay Sievers <kay.sievers at vrfy.org>
Date:   Wed Jan 25 15:26:48 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.

 udev.spec |   45 ++++++++++++++++++++++++++-------------------
 1 files changed, 26 insertions(+), 19 deletions(-)
---
diff --git a/udev.spec b/udev.spec
index 2aeb9b3..0ac9dcf 100644
--- a/udev.spec
+++ b/udev.spec
@@ -24,8 +24,9 @@ Requires(pre):  /usr/bin/getent /usr/sbin/groupadd
 Requires:       hwdata
 Requires:       systemd-units
 Requires:       util-linux >= 2.15.1
-Conflicts:      systemd < 37
+Conflicts:      systemd < 39
 Conflicts:      dracut < 013-93
+Conflicts:      filesystem < 3
 
 %ifarch s390 s390x
 # Require s390utils-base, because it's essential on s390
@@ -43,6 +44,7 @@ removed from the system.
 Summary:        Dynamic library to access udev device information
 Group:          System Environment/Libraries
 Requires:       udev = %{version}-%{release}
+Conflicts:      filesystem < 3
 License:        LGPLv2+
 
 %description -n libudev
@@ -64,6 +66,7 @@ dynamic library, which provides access to udev device information.
 Summary:        Libraries for adding libudev support to applications that use glib
 Group:          Development/Libraries
 Requires:       libudev = %{version}-%{release}
+Conflicts:      filesystem < 3
 License:        LGPLv2+
 
 %description -n libgudev1
@@ -90,23 +93,22 @@ export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fPIE -DPIE -pie -Wl,-z,relro -Wl,-z,now"
 export V=1
 %configure \
         --prefix=%{_prefix} \
-        --with-rootprefix= \
         --sysconfdir=%{_sysconfdir} \
-        --bindir=/sbin \
-        --libexecdir=/lib \
-        --with-rootlibdir=/%{_lib} \
+        --libexecdir=%{_prefix}/lib \
         --with-selinux \
-        --with-systemdsystemunitdir=/lib/systemd/system
+        --with-systemdsystemunitdir=%{_prefix}/lib/systemd/system
 make %{?_smp_mflags}
 
 %install
 make install DESTDIR=$RPM_BUILD_ROOT
 rm -fr $RPM_BUILD_ROOT%{_docdir}/udev
 rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
-mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware
-mkdir -p -m 0755 $RPM_BUILD_ROOT/lib/firmware/updates
+mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware
+mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/lib/firmware/updates
+mkdir -p -m 0755 $RPM_BUILD_ROOT%{_prefix}/sbin
+ln -sf ../bin/udevadm $RPM_BUILD_ROOT%{_prefix}/sbin/udevadm
 %ifarch s390 s390x
-install -m 0644 rules/arch/40-s390.rules $RPM_BUILD_ROOT/lib/udev/rules.d
+install -m 0644 rules/arch/40-s390.rules $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d
 %endif
 
 %pre
@@ -131,24 +133,25 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || :
 
 %files
 %doc NEWS COPYING README TODO ChangeLog  src/extras/keymap/README.keymap.txt
-/lib/udev
-%attr(0755,root,root) /sbin/udevadm
+%{_bindir}/udevadm
+%{_prefix}/sbin/udevadm
+%{_prefix}/lib/udev
 %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf
 %attr(0755,root,root) %dir %{_sysconfdir}/udev/
 %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/
 %attr(0644,root,root) %{_mandir}/man7/*.7*
 %attr(0644,root,root) %{_mandir}/man8/*.8*
 %{_datadir}/pkgconfig/udev.pc
-%dir %attr(0755,root,root) /lib/firmware
-%dir %attr(0755,root,root) /lib/firmware/updates
-%attr(0644,root,root) /lib/systemd/system/*.service
-%attr(0644,root,root) /lib/systemd/system/*.socket
-/lib/systemd/system/basic.target.wants/*.service
-/lib/systemd/system/sockets.target.wants/*.socket
+%dir %attr(0755,root,root) %{_prefix}/lib/firmware
+%dir %attr(0755,root,root) %{_prefix}/lib/firmware/updates
+%attr(0644,root,root) %{_prefix}/lib/systemd/system/*.service
+%attr(0644,root,root) %{_prefix}/lib/systemd/system/*.socket
+%{_prefix}/lib/systemd/system/basic.target.wants/*.service
+%{_prefix}/lib/systemd/system/sockets.target.wants/*.socket
 
 %files -n libudev
 %doc src/COPYING
-%attr(0755,root,root) /%{_lib}/libudev.so.*
+%attr(0755,root,root) %{_libdir}/libudev.so.*
 
 %files -n libudev-devel
 %doc src/docs/html/*
@@ -159,7 +162,7 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || :
 
 %files -n libgudev1
 %doc src/extras/gudev/COPYING
-%attr(0755,root,root) /%{_lib}/libgudev-1.0.so.*
+%attr(0755,root,root) %{_libdir}/libgudev-1.0.so.*
 %attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib
 
 %files -n libgudev1-devel
@@ -175,6 +178,10 @@ getent group floppy >/dev/null || /usr/sbin/groupadd -g 19 floppy || :
 
 %changelog
 * Wed Jan 25 2012 Kay Sievers <kay at redhat.com> 179-1
+- install everything in /usr
+  https://fedoraproject.org/wiki/Features/UsrMove
+
+* Wed Jan 25 2012 Kay Sievers <kay at redhat.com> 179-1
 - version 179
   - devtmpfs is mandatory now
   - /run is mandatory now


More information about the scm-commits mailing list