openbsd-ports/emulators/redhat/base/pkg/INSTALL
pvalchev 218bc1ee30 - fix PLIST issues
- error out when linux emul is not present and deal more gracefully in general
from maintainer Jason Ish
2003-09-25 06:50:21 +00:00

98 lines
2.1 KiB
Plaintext

#!/bin/sh
# $OpenBSD: INSTALL,v 1.2 2003/09/25 06:50:21 pvalchev Exp $
#
# Pre/post-installation setup of redhat_base
# exit on errors, use a sane path and install prefix
#
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local/emul/redhat}
# Function: tell the user what s/he needs to do to use the port just installed
#
do_notice_top()
{
echo
echo "+---------------"
echo "|"
}
do_notice_link()
{
echo "| /emul/linux already exists but it's not a symlink to $PREFIX."
echo "|"
echo "| To make this port active you must make /emul/linux a symlink to"
echo "| $PREFIX."
echo "|"
}
do_notice_sysctl()
{
echo "| *** Warning: Linux compatibility not enabled."
echo "|"
echo "| Before this port will work you must:"
echo "|"
echo "| 1. Enable Linux compatibility:"
echo "|"
echo "| Documentation on how to enable Linux compatibility can be"
echo "| found in the compat_linux(8) man page."
echo "|"
echo "| 2. Update the Linux ld.so.cache file:"
echo "|"
echo "| Once Linux compatibility has been enabled, run"
echo "| /emul/linux/sbin/ldconfig as root."
echo "|"
}
do_notice_bottom()
{
echo "| Installation of $1 complete. See compat_linux(8)"
echo "| for more information."
echo "|"
echo "+---------------"
echo
}
# verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
install -d -o root -g bin -m 755 /emul
install -d -o root -g bin -m 755 $PREFIX
;;
POST-INSTALL)
do_notice_top
if [ -e /emul/linux ]; then
if [ x`readlink /emul/linux` != x"$PREFIX" ]; then
do_notice_link
fi
else
ln -sf $PREFIX /emul/linux
fi
# Only run ldconfig if kern.emul.linux = 1.
if [ x`sysctl -n kern.emul.linux` = x1 ]; then
${PREFIX}/sbin/ldconfig
else
do_notice_sysctl
fi
do_notice_bottom $1
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0