summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/baselayout/baselayout-9999.ebuild')
-rw-r--r--sys-apps/baselayout/baselayout-9999.ebuild101
1 files changed, 47 insertions, 54 deletions
diff --git a/sys-apps/baselayout/baselayout-9999.ebuild b/sys-apps/baselayout/baselayout-9999.ebuild
index c6296f1a6f94..8dfcf1d42876 100644
--- a/sys-apps/baselayout/baselayout-9999.ebuild
+++ b/sys-apps/baselayout/baselayout-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -12,7 +12,7 @@ if [[ ${PV} = 9999 ]]; then
inherit git-r3
else
SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.bz2"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
LICENSE="GPL-2"
@@ -21,10 +21,6 @@ IUSE="build +split-usr"
RDEPEND="!sys-apps/baselayout-prefix"
-pkg_setup() {
- multilib_layout
-}
-
riscv_compat_symlink() {
# Here we apply some special sauce for riscv.
# Two multilib layouts exist for now:
@@ -71,18 +67,30 @@ multilib_layout() {
continue
fi
if ! use split-usr && [[ ${prefix} = ${EROOT}/ ]]; then
+ # for the special case of riscv multilib, we drop the
+ # second part of two-component libdirs, e.g. lib64/lp64
libdir="${libdir%%/*}"
dir="${prefix}${libdir}"
- einfo "symlinking ${dir} to usr/${libdir}"
- ln -s usr/${libdir} ${dir} ||
- die "Unable to make ${dir} symlink"
+ if [[ -h "${dir}" ]] ; then
+ if use riscv ; then
+ # with riscv we get now double entries so we
+ # need to ignore already existing symlinks
+ einfo "symlink ${dir} already exists (riscv)"
+ else
+ die "symlink ${dir} already exists"
+ fi
+ else
+ einfo "symlinking ${dir} to usr/${libdir}"
+ ln -s usr/${libdir} ${dir} ||
+ die "Unable to make ${dir} symlink"
+ fi
else
einfo "creating directory ${dir}"
mkdir -p "${dir}" ||
die "Unable to create ${dir} directory"
fi
done
- riscv_compat_symlink "${def_libdir}" "${prefix}${def_libdir}/${DEFAULT_ABI}"
+ [[ -d "${prefix}${def_libdir}" ]] && riscv_compat_symlink "${def_libdir}" "${prefix}${def_libdir}/${DEFAULT_ABI}"
done
return 0
fi
@@ -164,7 +172,6 @@ multilib_layout() {
# only symlinked the lib dir on systems where we moved it
# to "lib32" ...
case ${CHOST} in
- *-gentoo-freebsd*) ;; # We want it the other way on fbsd.
i?86*|x86_64*|powerpc*|sparc*|s390*)
if [[ -d ${prefix}lib32 && ! -h ${prefix}lib32 ]] ; then
rm -f "${prefix}lib32"/.keep || die
@@ -192,24 +199,8 @@ multilib_layout() {
fi
}
-pkg_preinst() {
- # This is written in src_install (so it's in CONTENTS), but punt all
- # pending updates to avoid user having to do etc-update (and make the
- # pkg_postinst logic simpler).
- rm -f "${EROOT}"/etc/._cfg????_gentoo-release || die
-
- # We need to install directories and maybe some dev nodes when building
- # stages, but they cannot be in CONTENTS.
- # Also, we cannot reference $S as binpkg will break so we do this.
+pkg_setup() {
multilib_layout
- if use build ; then
- if use split-usr ; then
- emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout
- else
- emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout-usrmerge
- fi
- fi
- rm -f "${ED}"/usr/share/${PN}/Makefile || die
}
src_prepare() {
@@ -218,7 +209,6 @@ src_prepare() {
# don't want symlinked directories in PATH on systems with usr-merge
if ! use split-usr && ! use prefix-guest; then
sed \
- -e 's|/usr/local/sbin:||g' \
-e 's|:/usr/sbin:|:|g' \
-e 's|:/sbin:|:|g' \
-e 's|:/bin:|:|g' \
@@ -227,10 +217,12 @@ src_prepare() {
if use prefix; then
hprefixify -e "/EUID/s,0,${EUID}," -q '"' etc/profile
- hprefixify etc/shells share.Linux/passwd
+ hprefixify etc/shells share/passwd
hprefixify -w '/PATH=/' etc/env.d/50baselayout
hprefixify -w 1 etc/env.d/50baselayout
echo PATH=/usr/sbin:/sbin:/usr/bin:/bin >> etc/env.d/99host
+ echo ROOTPATH=/usr/sbin:/sbin:/usr/bin:/bin >> etc/env.d/99host
+ echo MANPATH=/usr/share/man >> etc/env.d/99host
# change branding
sed -i \
@@ -258,7 +250,6 @@ src_prepare() {
src_install() {
emake \
- OS=Linux \
DESTDIR="${ED}" \
install
@@ -289,6 +280,31 @@ src_install() {
fi
}
+pkg_preinst() {
+ # We need to install directories and maybe some dev nodes when building
+ # stages, but they cannot be in CONTENTS.
+ # Also, we cannot reference $S as binpkg will break so we do this.
+ multilib_layout
+ if use build ; then
+ if use split-usr ; then
+ emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout
+ else
+ emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout-usrmerge
+ fi
+ fi
+ rm -f "${ED}"/usr/share/${PN}/Makefile || die
+
+ # Create symlinks in pkg_preinst to avoid Portage collision check.
+ # Create the symlinks in ${ED} via dosym so that we own it.
+ # Only create the symlinks if it wont cause a conflict in ${EROOT}.
+ if [[ -L ${EROOT}/var/lock || ! -e ${EROOT}/var/lock ]]; then
+ dosym ../run/lock /var/lock
+ fi
+ if [[ -L ${EROOT}/var/run || ! -e ${EROOT}/var/run ]]; then
+ dosym ../run /var/run
+ fi
+}
+
pkg_postinst() {
local x
@@ -309,12 +325,6 @@ pkg_postinst() {
chmod o-rwx "${EROOT}/etc/${x}" || die
fi
done
-
- # Take care of the etc-update for the user
- if [ -e "${EROOT}"/etc/._cfg0000_gentoo-release ] ; then
- mv "${EROOT}"/etc/._cfg0000_gentoo-release "${EROOT}"/etc/gentoo-release || die
- fi
-
# whine about users that lack passwords #193541
if [[ -e "${EROOT}"/etc/shadow ]] ; then
local bad_users=$(sed -n '/^[^:]*::/s|^\([^:]*\)::.*|\1|p' "${EROOT}"/etc/shadow)
@@ -347,23 +357,6 @@ pkg_postinst() {
ewarn "You should reboot now to get /run mounted with tmpfs!"
fi
- for x in ${REPLACING_VERSIONS}; do
- if ver_test 2.4 -lt ${x}; then
- ewarn "After updating ${EROOT}/etc/profile, please run"
- ewarn "env-update && . /etc/profile"
- fi
-
- if ver_test 2.6 -lt ${x}; then
- ewarn "Please run env-update then log out and back in to"
- ewarn "update your path."
- fi
- # clean up after 2.5 typos
- # https://bugs.gentoo.org/show_bug.cgi?id=656380
- if [[ ${x} == 2.5 ]]; then
- rm -fr "${EROOT}/{,usr" || die
- fi
- done
-
if [[ -e "${EROOT}"/etc/env.d/00basic ]]; then
ewarn "${EROOT}/etc/env.d/00basic is now ${EROOT}/etc/env.d/50baselayout"
ewarn "Please migrate your changes."