ffd0fa8226
pkgsrc/emulator/compat* and pkgsrc/emulator/netbsd32_compat* packages to provide the necessary shared libraries to run dynamically linked NetBSD binaries from the days of yore. * Add some additional compat* packages for completeness: compat15, compat20, compat30 * Modify the compat* packages so that "compatNM" only provides files that aren't in "NetBSD-N.(M+1)". For example, compat12 only provides files that don't exist in NetBSD-1.3.x, compat13 only provides files that don't exist in NetBSD-1.4.x, etc. As a result, if you are running NetBSD-3.0/alpha and want to run a 1.3 dynamically linked binary, there is an automatic dependency chain that causes the following packages to be installed: compat13, compat14, compat15, compat16, compat20 There are some deviations from this dependency chain on platforms that have changed executable formats, e.g. i386, m68, sparc, etc. However, in general pkgsrc will require that you have the necessary COMPAT_* options in your kernel to match the installed compat* packages. This restriction is an artificial one imposed by pkgsrc, but allows for a single set of distfiles to be used on all versions of NetBSD. * Provide compat* package support for every supported architecture of NetBSD. Verily, it is now possible to run 1.2 binaries on NetBSD-1.5.3/pc532 by installing the compat12 package from pkgsrc. Rejoice, one and all! * The netbsd32_compat* packages mirror the corresponding compat* packages for use by sparc64 and x86_64 to allow running 32-bit binaries with COMPAT_NETBSD32 kernel support. The "extras" packages supply the additional shared libraries from the corresponding release of NetBSD so that the set of files in /emul/netbsd32 will be complete. * pkgsrc/emulators/compat_netbsd contains infrastructure files shared by all of the compat* packages.
137 lines
3.1 KiB
Text
137 lines
3.1 KiB
Text
# $NetBSD: INSTALL.ELF,v 1.1 2007/08/21 22:49:24 jlam Exp $
|
|
|
|
# Generate a +ROOT_ACTIONS script that runs certain actions that require
|
|
# superuser privileges.
|
|
#
|
|
case "${STAGE},$1" in
|
|
UNPACK,|UNPACK,+ROOT_ACTIONS)
|
|
${CAT} > ./+ROOT_ACTIONS << 'EOF'
|
|
#!@SH@
|
|
#
|
|
# +ROOT_ACTIONS - run actions requiring superuser privileges
|
|
#
|
|
# Usage: ./+ROOT_ACTIONS ADD|REMOVE [metadatadir]
|
|
#
|
|
# This script runs certain actions that require superuser privileges.
|
|
# If such privileges are not available, then simply output a message
|
|
# asking the user to run this script with the appropriate elevated
|
|
# privileges.
|
|
#
|
|
# Lines starting with "# SYMLINK: " are data read by this script that
|
|
# name the source paths and corresponding symlink that is managed by
|
|
# this script. If the symlink path is relative, then it is taken to be
|
|
# relative to ${PKG_PREFIX}. The source path is always unchanged.
|
|
#
|
|
# # SYMLINK: /dev/rcd0a ${EMULSUBDIR}/dev/cdrom
|
|
#
|
|
|
|
CAT="@CAT@"
|
|
CHMOD="@CHMOD@"
|
|
ECHO="@ECHO@"
|
|
ID="@ID@"
|
|
LN="@LN@"
|
|
PWD_CMD="@PWD_CMD@"
|
|
RM="@RM@"
|
|
SED="@SED@"
|
|
TEST="@TEST@"
|
|
|
|
SELF=$0
|
|
ACTION=$1
|
|
|
|
CURDIR=`${PWD_CMD}`
|
|
PKG_METADATA_DIR="${2-${CURDIR}}"
|
|
: ${PKGNAME=${PKG_METADATA_DIR##*/}}
|
|
: ${PKG_PREFIX=@PREFIX@}
|
|
|
|
ROOT_ACTIONS_COOKIE="./+ROOT_ACTIONS_done"
|
|
EUID=`${ID} -u`
|
|
|
|
exitcode=0
|
|
case $ACTION,$EUID in
|
|
ADD,0)
|
|
${ECHO} "" > ${ROOT_ACTIONS_COOKIE}
|
|
${CHMOD} g+w ${ROOT_ACTIONS_COOKIE}
|
|
${SED} -n "/^\# SYMLINK: /{s/^\# SYMLINK: //;p;}" ${SELF} |
|
|
while read src dst; do
|
|
case $src in
|
|
"") continue ;;
|
|
esac
|
|
case $dst in
|
|
"") continue ;;
|
|
[!/]*) dst="${PKG_PREFIX}/$dst" ;;
|
|
esac
|
|
|
|
if ${TEST} ! -f "$dst"; then
|
|
${ECHO} "${PKGNAME}: linking $dst -> $src"
|
|
${LN} -fs "$src" "$dst"
|
|
else
|
|
${ECHO} "${PKGNAME}: $dst already exists"
|
|
fi
|
|
done
|
|
;;
|
|
|
|
REMOVE,0)
|
|
${SED} -n "/^\# SYMLINK: /{s/^\# SYMLINK: //;p;}" ${SELF} |
|
|
while read src dst; do
|
|
case $src in
|
|
"") continue ;;
|
|
esac
|
|
case $dst in
|
|
"") continue ;;
|
|
[!/]*) dst="${PKG_PREFIX}/$dst" ;;
|
|
esac
|
|
|
|
if ${TEST} -h "$dst"; then
|
|
${ECHO} "${PKGNAME}: removing $dst"
|
|
${RM} -f "$dst"
|
|
fi
|
|
done
|
|
${RM} -f ${ROOT_ACTIONS_COOKIE}
|
|
;;
|
|
|
|
ADD,*)
|
|
if ${TEST} ! -f ${ROOT_ACTIONS_COOKIE}; then
|
|
${CAT} << EOM
|
|
==============================================================================
|
|
Please run the following command with superuser privileges to complete
|
|
the installation of ${PKGNAME}:
|
|
|
|
cd ${PKG_METADATA_DIR} && ${SELF} ADD
|
|
|
|
==============================================================================
|
|
EOM
|
|
fi
|
|
;;
|
|
|
|
REMOVE,*)
|
|
if ${TEST} -f ${ROOT_ACTIONS_COOKIE}; then
|
|
${CAT} << EOM
|
|
==============================================================================
|
|
Please run the following command with superuser privileges to begin the
|
|
removal of ${PKGNAME}:
|
|
|
|
cd ${PKG_METADATA_DIR} && ${SELF} REMOVE
|
|
|
|
Then, please run pkg_delete(1) again to complete the removal of this
|
|
package.
|
|
|
|
==============================================================================
|
|
EOM
|
|
exitcode=1
|
|
fi
|
|
;;
|
|
esac
|
|
exit $exitcode
|
|
|
|
EOF
|
|
${SED} -n "/^\# SYMLINK: /p" ${SELF} >> ./+ROOT_ACTIONS
|
|
${CHMOD} +x ./+ROOT_ACTIONS
|
|
;;
|
|
esac
|
|
|
|
case "${STAGE}" in
|
|
POST-INSTALL)
|
|
${TEST} ! -x ./+ROOT_ACTIONS ||
|
|
./+ROOT_ACTIONS ADD ${PKG_METADATA_DIR}
|
|
;;
|
|
esac
|