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.
This commit is contained in:
parent
ff762fcf65
commit
4dd7fd5d27
@ -1,6 +1,6 @@
|
||||
Summary: The basic directory layout for a Linux system
|
||||
Name: filesystem
|
||||
Version: 2.4.46
|
||||
Version: 3
|
||||
Release: 1%{?dist}
|
||||
License: Public Domain
|
||||
URL: https://fedorahosted.org/filesystem
|
||||
@ -12,6 +12,10 @@ Source3: iso_3166.sed
|
||||
BuildRequires: iso-codes
|
||||
Requires(pre): setup
|
||||
|
||||
# old installations; this ensures we can not install the incompatible
|
||||
# filesystem.rpm on unconverted systems
|
||||
#Requires: rpmlib(X-CheckUnifiedSystemdir) >= 1
|
||||
|
||||
%description
|
||||
The filesystem package is one of the basic packages that is installed
|
||||
on a Linux system. Filesystem contains the basic directory layout
|
||||
@ -31,14 +35,18 @@ install -p -c -m755 %SOURCE3 %{buildroot}/iso_3166.sed
|
||||
|
||||
cd %{buildroot}
|
||||
|
||||
mkdir -p bin boot dev \
|
||||
mkdir -p boot dev \
|
||||
etc/{X11/{applnk,fontpath.d},xdg/autostart,opt,pm/{config.d,power.d,sleep.d},xinetd.d,skel,sysconfig,pki} \
|
||||
home lib/modules %{_lib}/tls media mnt opt proc root run/lock sbin srv sys tmp \
|
||||
usr/{bin,etc,games,include,%{_lib}/{games,sse2,tls,X11,pm-utils/{module.d,power.d,sleep.d}},lib/{games,locale,sse2},libexec,local/{bin,etc,games,lib,%{_lib},sbin,src,share/{applications,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x},info},libexec,include,},sbin,share/{aclocal,applications,augeas/lenses,backgrounds,desktop-directories,dict,doc,empty,games,ghostscript/conf.d,gnome,icons,idl,info,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p},mime-info,misc,omf,pixmaps,sounds,themes,xsessions,X11},src,src/kernels,src/debug} \
|
||||
home media mnt opt proc root run/lock srv sys tmp \
|
||||
usr/{bin,etc,games,include,%{_lib}/{games,sse2,tls,X11,pm-utils/{module.d,power.d,sleep.d}},lib/{games,locale,modules,sse2},libexec,local/{bin,etc,games,lib,%{_lib},sbin,src,share/{applications,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x},info},libexec,include,},sbin,share/{aclocal,applications,augeas/lenses,backgrounds,desktop-directories,dict,doc,empty,games,ghostscript/conf.d,gnome,icons,idl,info,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p},mime-info,misc,omf,pixmaps,sounds,themes,xsessions,X11},src,src/kernels,src/debug} \
|
||||
var/{adm,empty,gopher,lib/{games,misc,rpm-state},local,lock/subsys,log,nis,preserve,run,spool/{mail,lpd,uucp},tmp,db,cache,opt,games,yp}
|
||||
|
||||
ln -snf ../var/tmp usr/tmp
|
||||
ln -snf spool/mail var/mail
|
||||
ln -snf usr/bin bin
|
||||
ln -snf usr/sbin sbin
|
||||
ln -snf usr/lib lib
|
||||
ln -snf usr/%{_lib} %{_lib}
|
||||
|
||||
sed -n -f %{buildroot}/iso_639.sed /usr/share/xml/iso-codes/iso_639.xml \
|
||||
>%{buildroot}/iso_639.tab
|
||||
@ -60,9 +68,9 @@ cat %{SOURCE1} | grep -v "^#" | grep -v "^$" | while read loc ; do
|
||||
locale=$loc
|
||||
locality=
|
||||
special=
|
||||
[[ "$locale" =~ "@" ]] && locale=${locale%%@*}
|
||||
[[ "$locale" =~ "@" ]] && locale=${locale%%%%@*}
|
||||
[[ "$locale" =~ "_" ]] && locality=${locale##*_}
|
||||
[[ "$locality" =~ "." ]] && locality=${locality%%.*}
|
||||
[[ "$locality" =~ "." ]] && locality=${locality%%%%.*}
|
||||
[[ "$loc" =~ "_" ]] || [[ "$loc" =~ "@" ]] || special=$loc
|
||||
|
||||
# If the locality is not official, skip it
|
||||
@ -71,7 +79,7 @@ cat %{SOURCE1} | grep -v "^#" | grep -v "^$" | while read loc ; do
|
||||
fi
|
||||
# If the locale is not official and not special, skip it
|
||||
if [ -z "$special" ]; then
|
||||
egrep -q "[[:space:]]${locale%_*}[[:space:]]" \
|
||||
egrep -q "[[:space:]]${locale%%_*}[[:space:]]" \
|
||||
%{buildroot}/iso_639.tab || continue
|
||||
fi
|
||||
echo "%lang(${locale}) /usr/share/locale/${loc}" >> $RPM_BUILD_DIR/filelist
|
||||
@ -98,6 +106,29 @@ done
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%pretrans -p <lua>
|
||||
--#
|
||||
--# If we are running in pretrans in a fresh root, there is no /usr and symlinks.
|
||||
--# We cannot be sure, to be the very first rpm in the transaction list,
|
||||
--# so, let's create the toplevel symlinks here and the directories they point to.
|
||||
--# When our rpm is unpacked by cpio, it will set all permissions and modes later.
|
||||
--#
|
||||
|
||||
if posix.stat("/usr") == nil then
|
||||
posix.mkdir("/usr")
|
||||
end
|
||||
|
||||
for i,dir in ipairs({"/lib", "/%{_lib}", "/sbin", "/bin"}) do
|
||||
if posix.stat("/usr"..dir) == nil then
|
||||
posix.mkdir("/usr"..dir)
|
||||
if posix.stat(dir, "mode") == nil then
|
||||
posix.symlink("usr"..dir, dir)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return 0
|
||||
|
||||
%post -p <lua>
|
||||
posix.symlink("../run", "/var/run")
|
||||
posix.symlink("../run/lock", "/var/lock")
|
||||
@ -105,7 +136,7 @@ posix.symlink("../run/lock", "/var/lock")
|
||||
%files -f filelist
|
||||
%defattr(0755,root,root,-)
|
||||
%dir %attr(555,root,root) /
|
||||
%attr(555,root,root) /bin
|
||||
/bin
|
||||
%attr(555,root,root) /boot
|
||||
/dev
|
||||
%dir /etc
|
||||
@ -118,9 +149,9 @@ posix.symlink("../run/lock", "/var/lock")
|
||||
/etc/sysconfig
|
||||
/etc/pki
|
||||
/home
|
||||
%attr(555,root,root) /lib
|
||||
/lib
|
||||
%ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x
|
||||
%attr(555,root,root) /%{_lib}
|
||||
/%{_lib}
|
||||
%endif
|
||||
/media
|
||||
%dir /mnt
|
||||
@ -128,7 +159,7 @@ posix.symlink("../run/lock", "/var/lock")
|
||||
%attr(555,root,root) /proc
|
||||
%attr(550,root,root) /root
|
||||
/run
|
||||
%attr(555,root,root) /sbin
|
||||
/sbin
|
||||
/srv
|
||||
/sys
|
||||
%attr(1777,root,root) /tmp
|
||||
@ -196,6 +227,10 @@ posix.symlink("../run/lock", "/var/lock")
|
||||
/var/yp
|
||||
|
||||
%changelog
|
||||
* Wed Jan 25 2012 Harald Hoyer <harald@redhat.com> 3-1
|
||||
- install everything in /usr
|
||||
https://fedoraproject.org/wiki/Features/UsrMove
|
||||
|
||||
* Thu Jan 12 2012 Ondrej Vasik <ovasik@redhat.com> 2.4.46-1
|
||||
- own and create /var/lib/rpm-state (#771713)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user