[ncpfs] install everything in /usr

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


commit 3bc48327b4b5810660988a9fa9442183d76f68aa
Author: Harald Hoyer <harald at redhat.com>
Date:   Wed Jan 25 19:05:34 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.

 ncpfs.spec |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)
---
diff --git a/ncpfs.spec b/ncpfs.spec
index a91a8fa..ef7c832 100644
--- a/ncpfs.spec
+++ b/ncpfs.spec
@@ -1,7 +1,7 @@
 Summary: Utilities for the ncpfs filesystem, a NetWare client for Linux
 Name: ncpfs
 Version: 2.2.6
-Release: 15%{?dist}
+Release: 16%{?dist}
 License: GPL+
 URL: ftp://platan.vc.cvut.cz/pub/linux/ncpfs/
 Source: http://ftp.cvut.cz/ncpfs/ncpfs-%{version}.tar.gz
@@ -15,6 +15,7 @@ Patch6: ncpfs-2.2.6-offsetof.patch
 Patch7: ncpfs-2.2.6-mount-issue.patch
 Group: Applications/System
 Requires: ipxutils
+Conflicts: filesystem < 3
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: gettext
 
@@ -66,7 +67,7 @@ network.
 perl -pi -e 's/-fpie/-fPIE/' sutil/Makefile.in
 %endif
 export CFLAGS="$RPM_OPT_FLAGS -fPIC"
-%configure --disable-pam --disable-function-sections --disable-php
+%configure --disable-pam --disable-function-sections --disable-php --sbindir=/sbin
 make
 make -C ipxdump
 mv ipxdump/README ipxdump/README.ipxdump
@@ -77,9 +78,19 @@ rm -rf $RPM_BUILD_ROOT
 make install install-dev DESTDIR="$RPM_BUILD_ROOT"
 make -C ipxdump install DESTDIR="$RPM_BUILD_ROOT"
 
-# Move ipx_configure/ipx_internal_net to permit /usr from NFS
+# Move ipx_configure/ipx_internal_net from bin to sbin for historic reasons
+mkdir -p $RPM_BUILD_ROOT%{_sbindir}
 mv $RPM_BUILD_ROOT%{_bindir}/{ipx_configure,ipx_internal_net,ipx_interface} \
-	$RPM_BUILD_ROOT/sbin
+	$RPM_BUILD_ROOT%{_sbindir}
+
+# Move /sbin tools to /usr/sbin if not already installed there
+mv -n %{buildroot}/sbin/nwmsg %{buildroot}%{_sbindir} || :
+mv -n %{buildroot}/sbin/ipx_* %{buildroot}%{_sbindir} || :
+
+# Re-create links for mount(8)
+rm -f %{buildroot}/sbin/mount.ncp*
+ln -sf ../bin/ncpmount %{buildroot}%{_sbindir}/mount.ncp
+ln -sf ../bin/ncpmount %{buildroot}%{_sbindir}/mount.ncpfs
 
 # these could be SUID root, but it's a security hole
 chmod 755 $RPM_BUILD_ROOT%{_bindir}/{ncpmount,ncpumount}
@@ -96,14 +107,13 @@ rm -rf $RPM_BUILD_ROOT
 %files -f %name.lang
 %defattr(-,root,root)
 %doc BUGS COPYING Changes FAQ README
-/sbin/mount.ncp*
-/sbin/nwmsg
+%{_sbindir}/mount.ncp*
+%{_sbindir}/nwmsg
 %attr(4755,root,root) %{_bindir}/nwsfind
 %{_bindir}/n[cps]*
 %{_bindir}/nw[^s]*
 %{_bindir}/[ps]*
 %{_libdir}/libncp.so.*
-%{_sbindir}/nwmsg
 %{_mandir}/man[^3]/[^i]*
 
 %files devel
@@ -117,11 +127,15 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root)
 %doc ipx-1.0/COPYING ipx-1.0/README
 %doc ipxdump/README.ipxdump
-/sbin/ipx_*
+%{_sbindir}/ipx_*
 %{_bindir}/ipx*
 %{_mandir}/man8/ipx*
 
 %changelog
+* Wed Jan 25 2012 Harald Hoyer <harald at redhat.com> 2.2.6-16
+- install everything in /usr
+  https://fedoraproject.org/wiki/Features/UsrMove
+
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.2.6-15
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list