summaryrefslogtreecommitdiff
path: root/emulators/suse91_base/INSTALL
diff options
context:
space:
mode:
authorjlam <jlam>2007-07-29 05:18:36 +0000
committerjlam <jlam>2007-07-29 05:18:36 +0000
commit275d7ca4f86079521544b7e820383bc271742a03 (patch)
tree45cad36d8470a568b9136017b2dd79c9efcc65bc /emulators/suse91_base/INSTALL
parent838c2b6ce6faa38ac52676e60b80d81504e7827c (diff)
downloadpkgsrc-275d7ca4f86079521544b7e820383bc271742a03.tar.gz
* Add new emulator framework in pkgsrc/mk/emulator that handles all
binary-only packages that require binary "emulation" on the native operating system. Please see pkgsrc/mk/emulator/README for more details. * Teach the plist framework to automatically use any existing PLIST.${EMUL_PLATFORM} as part of the default PLIST_SRC definition. * Convert all of the binary-only packages in pkgsrc to use the emulator framework. Most of them have been tested to install and deinstall correctly. This involves the following cleanup actions: * Remove use of custom PLIST code and use PLIST.${EMUL_PLATFORM} more consistently. * Simplify packages by using default INSTALL and DEINSTALL scripts instead of custom INSTALL/DEINSTALL code. * Remove "SUSE_COMPAT32" and "PKG_OPTIONS.suse" from pkgsrc. Packages only need to state exactly which emulations they support, and the framework handles any i386-on-x86_64 or sparc-on-sparc64 uses. * Remove "USE_NATIVE_LINUX" from pkgsrc. The framework will automatically detect when the package is installing on Linux. Specific changes to packages include: * Bump the PKGREVISIONs for all of the suse100* and suse91* packages due to changes in the +INSTALL/+DEINSTALL scripts used in all of the packages. * Remove pkgsrc/emulators/suse_linux, which is unused by any packages. * cad/lc -- remove custom code to create the distinfo file for all supported platforms; just use "emul-fetch" and "emul-distinfo" instead. * lang/Cg-compiler -- install the shared libraries under ${EMULDIR} instead of ${PREFIX}/lib so that compiled programs will find the shared libraries. * mail/thunderbird-bin-nightly -- update to latest binary distributions for supported platforms. * multimedia/ns-flash -- update Linux version to 9.0.48 as the older version is no longer available for interactive fetch. * security/uvscan -- set LD_LIBRARY_PATH explicitly so that it's not necessary to install library symlinks into ${EMULDIR}/usr/local/lib. * www/firefox-bin-flash -- update Linux version to 9.0.48 as the older version is no longer available for interactive fetch.
Diffstat (limited to 'emulators/suse91_base/INSTALL')
-rw-r--r--emulators/suse91_base/INSTALL152
1 files changed, 136 insertions, 16 deletions
diff --git a/emulators/suse91_base/INSTALL b/emulators/suse91_base/INSTALL
index b4da446a9b9..6edf26b6c4f 100644
--- a/emulators/suse91_base/INSTALL
+++ b/emulators/suse91_base/INSTALL
@@ -1,29 +1,149 @@
-# $NetBSD: INSTALL,v 1.3 2006/06/23 15:48:50 jlam Exp $
+# $NetBSD: INSTALL,v 1.4 2007/07/29 05:19:04 jlam Exp $
-case "${STAGE}" in
-POST-INSTALL)
- emulsubdir=linux
+# 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.
+#
+
+CAT="@CAT@"
+CHMOD="@CHMOD@"
+CP="@CP@"
+ECHO="@ECHO@"
+ID="@ID@"
+LN="@LN@"
+MKDIR="@MKDIR@"
+PWD_CMD="@PWD_CMD@"
+RM="@RM@"
+SH="@SH@"
+TEST="@TEST@"
+
+SELF=$0
+ACTION=$1
+
+CURDIR=`${PWD_CMD}`
+PKG_METADATA_DIR="${2-${CURDIR}}"
+: ${PKGNAME=${PKG_METADATA_DIR##*/}}
+: ${PKG_PREFIX=@PREFIX@}
- emuldir="@OPSYS_EMULDIR@"
- pkgemuldir="${PKG_PREFIX}/emul/$emulsubdir"
+EMULDIR="${PKG_PREFIX}/@EMULSUBDIR@"
+OPSYS_EMULDIR="@OPSYS_EMULDIR@"
- emuldir_pwd=`cd $emuldir 2>/dev/null && ${PWD_CMD}`
- pkgemuldir_pwd=`cd $pkgemuldir 2>/dev/null && ${PWD_CMD}`
+ROOT_ACTIONS_COOKIE="${PKG_METADATA_DIR}/+ROOT_ACTIONS_done"
+EUID=`${ID} -u`
- if ${TEST} "$emuldir_pwd" != "$pkgemuldir_pwd"; then
- if ${TEST} -e $emuldir -o -L $emuldir; then
- ${CAT} << EOF
+exitcode=0
+case $ACTION,$EUID in
+ADD,0)
+ ${ECHO} "" > ${ROOT_ACTIONS_COOKIE}
+ ${CHMOD} g+w ${ROOT_ACTIONS_COOKIE}
+ # Create an appropriate Linux-like /dev directory.
+ ${ECHO} "${PKGNAME}: populating ${EMULDIR}/dev"
+ ${MKDIR} ${EMULDIR}/dev
+ ${TEST} ! -f /dev/MAKEDEV ||
+ ${CP} /dev/MAKEDEV ${EMULDIR}/dev
+ ${TEST} ! -f /dev/MAKEDEV.subr ||
+ ${CP} /dev/MAKEDEV.subr ${EMULDIR}/dev
+ ( cd ${EMULDIR}/dev &&
+ ${SH} ./MAKEDEV std audio &&
+ ${LN} -fs sound dsp )
+
+ # Create the appropriate symlink so that the kernel will
+ # find the installed files.
+ #
+ OPSYS_EMULDIR_PWD=`cd ${OPSYS_EMULDIR} 2>/dev/null && ${PWD_CMD}`
+ EMULDIR_PWD=`cd ${EMULDIR} 2>/dev/null && ${PWD_CMD}`
+
+ if ${TEST} "${OPSYS_EMULDIR_PWD}" != "${EMULDIR_PWD}"; then
+ if ${TEST} -e ${OPSYS_EMULDIR} -o -L ${OPSYS_EMULDIR}; then
+ ${CAT} << EOM
==============================================================================
-You must create a symbolic link for ${PKGNAME} to work properly:
+The following symbolic link must be created for ${PKGNAME}
+to work properly:
- $pkgemuldir -> $emuldir
+ ${EMULDIR} -> ${OPSYS_EMULDIR}
-It seems there is something else located at $emuldir.
==============================================================================
-EOF
+EOM
else
- ${MKDIR} -p /emul && ${LN} -fs $pkgemuldir $emuldir
+ ${ECHO} "${PKGNAME}: creating symlink ${EMULDIR} -> ${OPSYS_EMULDIR}"
+ ( ${MKDIR} -p `${DIRNAME} ${OPSYS_EMULDIR}` &&
+ ${LN} -fs ${EMULDIR} ${OPSYS_EMULDIR} ) || ${TRUE}
fi
fi
;;
+
+REMOVE,0)
+ ${ECHO} "${PKGNAME}: removing ${EMULDIR}/dev"
+ ${RM} -fr ${EMULDIR}/dev
+ ${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
+ ${CHMOD} +x ./+ROOT_ACTIONS
+ ;;
+esac
+
+EMULDIR="${PKG_PREFIX}/@EMULSUBDIR@"
+OPSYS_EMULDIR="@OPSYS_EMULDIR@"
+
+case "${STAGE}" in
+POST-INSTALL)
+ # Create a /proc mount point.
+ ${MKDIR} -p ${EMULDIR}/proc
+
+ # Make /etc/mtab usable for Linux programs.
+ ${RM} -f ${EMULDIR}/etc/mtab
+ ${LN} -fs ${EMULDIR}/proc/mounts ${EMULDIR}/etc/mtab
+
+ # Run any actions that require root privileges.
+ ${TEST} ! -x ./+ROOT_ACTIONS ||
+ ./+ROOT_ACTIONS ADD ${PKG_METADATA_DIR}
+ ;;
esac