aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Nemo <cnemo@tutanota.com>2019-12-02 04:07:50 +0000
committerJuan RP <xtraeme@gmail.com>2019-12-14 13:01:42 +0000
commit091ab0b612d039891f4d549f9f054567bcef3627 (patch)
tree53cc04eb880786793a15236c4f3282bc284aa89d
parentcb84b180e84abce6478d420789db7e00eb2fa829 (diff)
downloadvoid-packages-091ab0b612d039891f4d549f9f054567bcef3627.tar
void-packages-091ab0b612d039891f4d549f9f054567bcef3627.tar.gz
void-packages-091ab0b612d039891f4d549f9f054567bcef3627.tar.bz2
void-packages-091ab0b612d039891f4d549f9f054567bcef3627.tar.lz
void-packages-091ab0b612d039891f4d549f9f054567bcef3627.tar.xz
void-packages-091ab0b612d039891f4d549f9f054567bcef3627.tar.zst
void-packages-091ab0b612d039891f4d549f9f054567bcef3627.zip
base-files: ship bin and lib symlinks
-rw-r--r--common/hooks/pre-pkg/99-pkglint.sh20
-rw-r--r--srcpkgs/base-files/INSTALL26
-rw-r--r--srcpkgs/base-files/template27
3 files changed, 32 insertions, 41 deletions
diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh
index ab2b215508e..d0a26808083 100644
--- a/common/hooks/pre-pkg/99-pkglint.sh
+++ b/common/hooks/pre-pkg/99-pkglint.sh
@@ -7,19 +7,21 @@ hook() {
set +E
# Check for forbidden directories that are symlinks in void.
- for f in bin sbin lib lib32; do
- if [ -d ${PKGDESTDIR}/${f} ]; then
- msg_red "${pkgver}: /${f} directory is not allowed, use /usr/${f}.\n"
+ for f in lib bin sbin lib64 lib32 usr/sbin usr/lib64; do
+ [ -e "${PKGDESTDIR}/${f}" ] || continue
+ if [ "${pkgname}" = "base-files" ]; then
+ if [ -L "${PKGDESTDIR}/${f}" ]; then
+ continue
+ fi
+ msg_red "${pkgver}: /${f} must be a symlink.\n"
+ error=1
+ else
+ msg_red "${pkgver}: /${f} must not exist.\n"
error=1
fi
done
-
- if [ -d ${PKGDESTDIR}/usr/sbin ]; then
- msg_red "${pkgver}: /usr/sbin directory is not allowed, use /usr/bin.\n"
- error=1
- fi
- for f in sys dev home root run var/run tmp usr/lib64 usr/local destdir; do
+ for f in sys dev home root run var/run tmp usr/local destdir; do
if [ -d ${PKGDESTDIR}/${f} ]; then
msg_red "${pkgver}: /${f} directory is not allowed, remove it!\n"
error=1
diff --git a/srcpkgs/base-files/INSTALL b/srcpkgs/base-files/INSTALL
index cfdc0ebd61c..9e1387d6270 100644
--- a/srcpkgs/base-files/INSTALL
+++ b/srcpkgs/base-files/INSTALL
@@ -32,36 +32,10 @@ make_system_dirs() {
install -d usr/local/share/man/man${d}
done
- # Create /bin, /sbin and /lib symlinks to /usr.
- for d in bin sbin lib; do
- if [ ! -h "$d" -a -d "$d" ]; then
- echo "/${d} must not be a directory, exiting!"
- exit 1
- fi
- ln -sf usr/${d} .
- done
- # Create /usr/sbin symlink to /usr/bin.
- [ ! -e usr/sbin ] && ln -sf bin usr/sbin
-
for d in empty log opt cache lib; do
[ ! -d var/${d} ] && install -d var/${d}
done
- if [ "${ARCH}" = "x86_64" ] || [ "${ARCH}" = "ppc64le" ]; then
- [ -L lib64 ] || ln -sf usr/lib lib64
- cd usr
- [ -L lib64 ] || ln -sf lib lib64
- cd ..
- fi
- if [ "${ARCH}" = "x86_64" ]; then
- install -d usr/lib32
- [ -L lib32 ] || ln -sf usr/lib32 lib32
- fi
- if [ "${ARCH}" = "i686" ]; then
- [ -L lib32 ] || ln -sf lib lib32
- [ -L usr/lib32 ] || ln -sf lib usr/lib32
- fi
-
# Create /var/run and /var/lock symlinks.
for d in run lock; do
if [ ! -h "var/$d" -a -d var/${d} ]; then
diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template
index a049c59681d..68ea75347a7 100644
--- a/srcpkgs/base-files/template
+++ b/srcpkgs/base-files/template
@@ -1,12 +1,12 @@
# Template file for 'base-files'
pkgname=base-files
version=0.140
-revision=8
+revision=9
bootstrap=yes
depends="xbps-triggers"
short_desc="Void Linux base system files"
maintainer="Enno Boland <orphan@voidlinux.org>"
-license="custom:Public domain"
+license="Public Domain"
homepage="https://www.voidlinux.org"
conf_files="
/etc/inputrc
@@ -32,11 +32,26 @@ replaces="base-directories>=0"
system_groups="kvm:24"
do_install() {
- if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
- vmkdir usr/lib
+ # Create bin and lib dirs and symlinks.
+ for d in bin lib; do
+ vmkdir "usr/${d}"
+ ln -snrf "${DESTDIR}/usr/${d}" "${DESTDIR}/${d}"
+ done
+ # Symlink sbin paths to /usr/bin.
+ for d in sbin usr/sbin; do
+ ln -snrf "${DESTDIR}/usr/bin" "${DESTDIR}/${d}"
+ done
+ # Symlink word-specific lib paths to /usr/lib.
+ for d in lib usr/lib; do
+ ln -snrf "${DESTDIR}/usr/lib" \
+ "${DESTDIR}/${d}${XBPS_TARGET_WORDSIZE}"
+ done
+ # Populate 32-bit lib files on 64-bit systems, for multilib.
+ if [ "${XBPS_TARGET_WORDSIZE}" = "64" ]; then
vmkdir usr/lib32
- ln -s ../lib/locale ${DESTDIR}/usr/lib32/locale
- vinstall ${FILESDIR}/ld.so.lib32.conf 644 etc/ld.so.conf.d lib32.conf
+ ln -snrf "${DESTDIR}/usr/lib32" "${DESTDIR}/lib32"
+ ln -sf ../lib/locale "${DESTDIR}/usr/lib32/locale"
+ vinstall "${FILESDIR}/ld.so.lib32.conf" 644 etc/ld.so.conf.d lib32.conf
fi
# Install misc config files.