freebsd-ports/emulators/linux_base-c6/pkg-install
Alexander Leidinger affb190b16 The port is intended to become the new default linux_base port (replaces
the current linux_base-8 port).

You should only switch to this port if you know what you are doing.
You may or may not have problems with installing other linux related
ports after switching to it. Success or failure reports welcome.

To switch:
 - echo "OVERRIDE_LINUX_BASE_PORT=fc3" >> /etc/make.conf
 - portupgrade -fo emulators/linux_base-fc3 linux_base-8

News and changes (from submitter with some small changes by me):
 - based on linux_base-8 port;
 - don't use linux rpm binary to install. The whole source tree is
   created at ${WRKDIR} and then installed (using cpio);
 - removes some files and directories (etc/passwd, etc/group,
   usr/local, ...) to ensure using FreeBSD original files;
 - introduces etc/nsswitch.conf.dist and etc/yp.conf.sample files,
   uses correct install/deinstall behaviour with etc/nsswitch.conf
   and etc/yp.conf files;
 - doesn't do [u]mounting while install/deinstall process.
   Thus it is possible to use jails while building packages.
   But since linprocfs is not automounted, special measures should be
   taken at package building for those ports which need a mounted
   linprocfs (i.e. for linux JDK building);
 - uses linux ldconfig in the pkg-install file (as opposed to using in
   the Makefile). It is needed when upgrading (i.e. when other linux
   libraries are present in the system) and when installing by packages.

Submitted by:	Boris Samorodov <bsam@ipt.ru> (some small changes by me)
2006-03-18 19:07:04 +00:00

43 lines
1.1 KiB
Bash

#!/bin/sh
# an installation script for linux_base
case "$2" in
PRE-INSTALL)
if [ -z "`kldstat -v | grep -E 'linux(aout|elf)'`" ]; then
echo 'Linux mode is not enabled.'
echo 'Loading linux kernel module now...'
if ! kldload linux; then
echo 'The linux kernel module could not be loaded.'
echo 'Please enable linux mode manually and retry.'
exit 1
fi
fi
;;
POST-INSTALL)
if [ -z "`grep ^linproc /etc/fstab`" ]; then
echo ''
echo '+++ Some programs may need the linprocfs, please add it to /etc/fstab! +++'
else
if [ -z "`mount | grep -w ^linprocfs`" ]; then
echo ''
echo '+++ Please mount linprocfs manually! +++'
fi
fi
if [ ! -f ${PKG_PREFIX}/etc/nsswitch.conf ]; then
cp ${PKG_PREFIX}/etc/nsswitch.conf.dist \
${PKG_PREFIX}/etc/nsswitch.conf
fi
if [ ! -f ${PKG_PREFIX}/etc/yp.conf ]; then
cp ${PKG_PREFIX}/etc/yp.conf.sample ${PKG_PREFIX}/etc/yp.conf
fi
#
# This is needed for updating to ensure that
# already installed libraries get to ${PKG_PREFIX}/etc/ld.so.cache
#
echo ''
echo 'Running linux ldconfig...'
${PKG_PREFIX}/sbin/ldconfig -r ${PKG_PREFIX}
;;
esac
exit 0