base-directories: install stuff via INSTALL, less error prune.

This commit is contained in:
Juan RP 2011-06-25 10:43:54 +02:00
parent 5efd8cdd4d
commit 01ae5d4d1a
2 changed files with 66 additions and 53 deletions

View file

@ -1,5 +1,59 @@
make_system_dirs()
{
#
# Install FHS system directories.
#
for d in bin sbin boot etc etc/modprobe.d etc/skel \
home lib dev proc usr mnt opt sys var media run; 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
[ ! -h usr/man ] && ln -sf /usr/share/man usr/man
[ ! -h usr/local/man ] && ln -sf /usr/share/man usr/local/man
for d in log run opt cache lib; do
[ ! -d var/${d} ] && install -d var/${d}
done
if [ "$(uname -m)" = "x86_64" ]; then
[ ! -h lib64 ] && ln -sf /lib lib64
[ ! -h usr/lib64 ] && ln -sf /usr/lib usr/lib64
fi
[ ! -d lib/rc ] && install -d lib/rc
for d in init.d udev; do
[ ! -d run/${d} ] && install -dm0755 run/${d}
done
for d in lock tmp shm; do
[ ! -d run/${d} ] && install -dm1777 run/${d}
done
}
case "${ACTION}" in
post)
make_system_dirs
# Create compat symlinks for /run.
mntpnts="tmp /run/tmp"
mntpnts="$mntpnts var/tmp /run/tmp"

View file

@ -1,66 +1,25 @@
# Template file for 'base-directories'
pkgname=base-directories
version=0.11
version=0.12
build_style=custom-install
short_desc="XBPS FHS Base System directories"
short_desc="Vanilla GNU/Linux base system directories"
maintainer="Juan RP <xtraeme@gmail.com>"
long_desc="
This package installs the base system directories as specifed by FHS that aren't
installed by any other package and are required on any GNU/Linux system."
nostrip=yes
noverifyrdeps=yes
keep_empty_dirs=yes
noarch=yes
base_chroot=yes
do_install()
{
#
# Install FHS system directories.
#
for d in bin sbin boot etc etc/modprobe.d etc/skel \
home lib dev proc mnt opt sys var media run; do
install -d ${DESTDIR}/${d}
done
install -d -m750 ${DESTDIR}/root
for d in var/spool/mail; do
install -d -m1777 ${DESTDIR}/${d}
done
for d in local local/bin local/sbin local/include local/lib \
bin include lib sbin src; do
install -d ${DESTDIR}/usr/${d}
done
for d in locale misc terminfo zoneinfo doc info; do
install -d ${DESTDIR}/usr/share/${d}
install -d ${DESTDIR}/usr/local/share/${d}
done
for f in 1 2 3 4 5 6 7 8; do
install -d ${DESTDIR}/usr/share/man/man${d}
install -d ${DESTDIR}/usr/local/share/man/man${d}
done
cd ${DESTDIR}/usr && ln -s ./share/man man
cd ${DESTDIR}/usr/local && ln -s ./share/man man
for d in log run opt cache lib; do
install -d ${DESTDIR}/var/${d}
done
if [ "$xbps_machine" = "x86_64" ]; then
cd ${DESTDIR} && ln -s lib lib64
cd ${DESTDIR}/usr && ln -s lib lib64
fi
install -d ${DESTDIR}/lib/rc
for d in init.d udev; do
install -d -m0755 ${DESTDIR}/run/${d}
done
for d in lock tmp shm; do
install -d -m1777 ${DESTDIR}/run/${d}
done
. ${XBPS_SRCPKGDIR}/${pkgname}/INSTALL
install -d ${DESTDIR}
cd ${DESTDIR} && make_system_dirs
}
post_stow()
{
. ${XBPS_SRCPKGDIR}/${pkgname}/INSTALL
cd ${XBPS_MASTERDIR} && make_system_dirs
}