[rp-pppoe] install everything in /usr

Harald Hoyer harald at fedoraproject.org
Wed Jan 25 19:52:37 UTC 2012


commit 1094162a4f3ab8475430747de74053134dc02cea
Author: Harald Hoyer <harald at redhat.com>
Date:   Wed Jan 25 19:12:24 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.

 rp-pppoe.spec |   37 ++++++++++++++++---------------------
 1 files changed, 16 insertions(+), 21 deletions(-)
---
diff --git a/rp-pppoe.spec b/rp-pppoe.spec
index 08a0e66..e85b9a0 100644
--- a/rp-pppoe.spec
+++ b/rp-pppoe.spec
@@ -1,7 +1,7 @@
 Summary: A PPP over Ethernet client (for xDSL support).
 Name: rp-pppoe
 Version: 3.10
-Release: 10%{?dist}
+Release: 11%{?dist}
 License: GPLv2+
 Group: System Environment/Daemons
 Url: http://www.roaringpenguin.com/pppoe/
@@ -23,7 +23,8 @@ Requires: ppp >= 2.4.2
 Requires: initscripts >= 5.92
 Requires: iproute >= 2.6
 Requires: coreutils
-Requires: systemd-units >= 13
+Requires: systemd-units >= 39-2
+Conflicts: filesystem < 3					      
 Requires(post): systemd-units
 Requires(preun): systemd-units
 Requires(postun): systemd-units
@@ -34,6 +35,7 @@ BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: coreutils
 BuildRequires: ppp
+BuildRequires: systemd-units >= 39-2
 
 ExcludeArch: s390 s390x
 
@@ -57,24 +59,19 @@ make
 %install
 rm -rf %{buildroot}
 
-mkdir -p %{buildroot}/sbin %{buildroot}%{_unitdir}
+mkdir -p %{buildroot}%{_sbindir} %{buildroot}%{_unitdir}
 
 make -C src install DESTDIR=%{buildroot}
 
-mv %{buildroot}%{_sbindir}/* %{buildroot}/sbin
-
-install -m 0755 %{SOURCE1} %{buildroot}/sbin
-install -m 0755 %{SOURCE2} %{buildroot}/sbin
-install -m 0755 %{SOURCE3} %{buildroot}/sbin
-install -m 0755 %{SOURCE4} %{buildroot}/sbin
-install -m 0755 %{SOURCE5} %{buildroot}/sbin
+install -m 0755 %{SOURCE1} %{buildroot}%{_sbindir}
+install -m 0755 %{SOURCE2} %{buildroot}%{_sbindir}
+install -m 0755 %{SOURCE3} %{buildroot}%{_sbindir}
+install -m 0755 %{SOURCE4} %{buildroot}%{_sbindir}
+install -m 0755 %{SOURCE5} %{buildroot}%{_sbindir}
 install -m 0755 %{SOURCE6} %{buildroot}%{_unitdir}/pppoe-server.service
 
-pushd %{buildroot}%{_sbindir}
-ln -s ../../sbin/* .
-ln -s ../../sbin/pppoe-stop adsl-stop
-ln -s ../../sbin/pppoe-start adsl-start
-popd
+ln -sf pppoe-stop %{buildroot}%{_sbindir}/adsl-stop
+ln -sf pppoe-start %{buildroot}%{_sbindir}/adsl-start
 
 rm -rf %{buildroot}/etc/ppp/pppoe.conf \
        %{buildroot}/etc/rc.d/init.d/pppoe \
@@ -84,11 +81,6 @@ rm -rf %{buildroot}/etc/ppp/pppoe.conf \
 %clean
 rm -rf %{buildroot}
 
-if [ $1 -eq 1 ] ; then
-   # Initial installation
-   /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
-
 %preun
 if [ "$1" = "0" ]; then
    # Package removal, not upgrade
@@ -117,11 +109,14 @@ triggerun -- %{name} < 3.10-9
 %config(noreplace) %{_sysconfdir}/ppp/pppoe-server-options
 %config(noreplace) %{_sysconfdir}/ppp/firewall*
 %{_unitdir}/pppoe-server.service
-/sbin/*
 %{_sbindir}/*
 %{_mandir}/man?/*
 
 %changelog
+* Wed Jan 25 2012 Harald Hoyer <harald at redhat.com> 3.10-11
+- install everything in /usr
+  https://fedoraproject.org/wiki/Features/UsrMove
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.10-10
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list