void-packages/srcpkgs/base-directories/INSTALL

68 lines
1.5 KiB
Plaintext
Raw Normal View History

make_system_dirs()
{
#
# Install FHS system directories.
#
2012-07-09 20:28:26 +02:00
for d in boot etc etc/modprobe.d etc/skel \
home dev proc usr mnt opt sys var run/lock; do
[ ! -d ${d} ] && install -d ${d}
done
[ ! -d root ] && install -dm750 root
[ ! -d var/spool/mail ] && install -dm1777 var/spool/mail
for d in local local/bin local/sbin local/include local/lib \
bin include lib sbin src; do
[ ! -d usr/${d} ] && install -d usr/${d}
done
for d in locale misc terminfo zoneinfo doc info; do
[ ! -d usr/share/${d} ] && install -d usr/share/${d}
[ ! -d usr/local/share/${d} ] && install -d usr/local/share/${d}
done
for d in 1 2 3 4 5 6 7 8; do
[ ! -d usr/share/man/man${d} ] && \
install -d usr/share/man/man${d}
[ ! -d usr/local/share/man/man${d} ] && \
install -d usr/local/share/man/man${d}
done
2012-07-09 20:28:26 +02:00
# Create /bin, /sbin and /lib symlinks to /usr.
for d in bin sbin lib; do
if [ ! -h "$d" -a -d "$d" ]; then
2012-07-09 20:28:26 +02:00
echo "/${d} must not be a directory, exiting!"
exit 1
fi
ln -sf usr/${d} .
done
2012-07-09 20:28:26 +02:00
for d in log opt cache lib; do
[ ! -d var/${d} ] && install -d var/${d}
done
2012-07-09 20:28:26 +02:00
# Create /var/run and /var/lock symlinks.
for d in run lock; do
if [ ! -h "var/$d" -a -d var/${d} ]; then
2012-07-09 20:28:26 +02:00
echo "/${d} must not be a directory, exiting!"
exit 1
fi
done
cd var && ln -sf ../run . && cd ..
cd var && ln -sf ../run/lock . && cd ..
2012-07-09 20:28:26 +02:00
if [ "$(uname -m)" = "x86_64" ]; then
ln -sf usr/lib lib64
2012-07-09 20:28:26 +02:00
cd usr && ln -sf lib lib64
fi
install -dm1777 tmp
install -dm1777 var/tmp
}
case "${ACTION}" in
post)
make_system_dirs
;;
esac