pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators Cleanup fallout from {DE,}INSTALL_SRC remova...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5290e4428fdd
branches:  trunk
changeset: 514877:5290e4428fdd
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Mon Jun 19 23:20:59 2006 +0000

description:
Cleanup fallout from {DE,}INSTALL_SRC removal: rewrite the INSTALL
script to be of the format expected by the pkginstall framework.
Also, split out the important text from the INSTALL script and put it
into a MESSAGE file.

diffstat:

 emulators/freebsd_lib/INSTALL |  48 +++++++++++++++++++-----------------------
 emulators/freebsd_lib/MESSAGE |   8 +++++++
 emulators/osf1_lib/INSTALL    |  48 ++++++++++++++++++++----------------------
 emulators/osf1_lib/MESSAGE    |   6 +++++
 emulators/osf1_lib/Makefile   |   7 +-----
 5 files changed, 60 insertions(+), 57 deletions(-)

diffs (168 lines):

diff -r ce3143f72e69 -r 5290e4428fdd emulators/freebsd_lib/INSTALL
--- a/emulators/freebsd_lib/INSTALL     Mon Jun 19 23:19:24 2006 +0000
+++ b/emulators/freebsd_lib/INSTALL     Mon Jun 19 23:20:59 2006 +0000
@@ -1,34 +1,30 @@
-#!/bin/sh
-# $NetBSD: INSTALL,v 1.1 2001/10/31 23:52:39 zuntum Exp $
-
-emul=freebsd
-if [ "$2" != "POST-INSTALL" ]; then exit 0; fi
+# $NetBSD: INSTALL,v 1.2 2006/06/19 23:20:59 jlam Exp $
 
-cat <<EOF
-==============================================================================
+case "${STAGE}" in
+POST-INSTALL)
+       emulsubdir=freebsd
 
-Do not forget to include COMPAT_FREEBSD in your kernel configuration file.
-(FreeBSD binaries require this option in order to work.)
-Note that FreeBSD ELF binaries are not yet supported with this package.
-EOF
+       emuldir="/emul/$emulsubdir"
+       pkgemuldir="${PKG_PREFIX}/emul/$emulsubdir"
 
-if [ "`cd /etc && cd ${PKG_PREFIX}/emul/$emul 2>/dev/null && pwd -P`" != \
-     "`cd / && cd /emul/$emul 2>/dev/null && pwd -P`" ]; then
-       if [ -e /emul/$emul -o -L /emul/$emul ] || \
-          [ \( -e /emul -o -L /emul \) -a ! -d /emul ]; then
-               cat <<-EOF
+       emuldir_pwd=`cd $emulsubdir 2>/dev/null && ${PWD_CMD}`
+       pkgemuldir_pwd=`cd $pkgemulsubdir 2>/dev/null && ${PWD_CMD}`
 
-               IMPORTANT:  You must create a symbolic link from /emul/$emul to
-               ${PKG_PREFIX}/emul/$emul in order for this package to work properly.
-               (It seems there is something else located at /emul/$emul.)
-               EOF
-       else
-               mkdir -p /emul
-               ln -sf ${PKG_PREFIX}/emul/$emul /emul/$emul
-       fi
-fi
+       if ${TEST} "$emuldir_pwd" != "$pkgemuldir_pwd"; then
+               if ${TEST} -e $emuldir -o -L $emuldir; then
+                       ${CAT} << EOF
+==============================================================================
+You must create a symbolic link for ${PKGNAME} to work properly:
 
-cat <<EOF
+       $pkgemuldir  ->  $emuldir
 
+It seems there is something else located at $emuldir.
 ==============================================================================
 EOF
+               else
+                       ${MKDIR} -p `${DIRNAME} $emuldir` && 
+                       ${LN} -fs $pkgemuldir $emuldir
+               fi
+       fi
+       ;;
+esac
diff -r ce3143f72e69 -r 5290e4428fdd emulators/freebsd_lib/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/freebsd_lib/MESSAGE     Mon Jun 19 23:20:59 2006 +0000
@@ -0,0 +1,8 @@
+==============================================================================
+$NetBSD: MESSAGE,v 1.1 2006/06/19 23:20:59 jlam Exp $
+
+Do not forget to include COMPAT_FREEBSD in your kernel configuration
+file.  FreeBSD binaries require this option in order to work.
+
+Note that FreeBSD ELF binaries are not yet supported with this package.
+==============================================================================
diff -r ce3143f72e69 -r 5290e4428fdd emulators/osf1_lib/INSTALL
--- a/emulators/osf1_lib/INSTALL        Mon Jun 19 23:19:24 2006 +0000
+++ b/emulators/osf1_lib/INSTALL        Mon Jun 19 23:20:59 2006 +0000
@@ -1,33 +1,31 @@
-#!/bin/sh
-# $NetBSD: INSTALL,v 1.1 2001/10/31 23:53:11 zuntum Exp $
-
-emul=osf1
-if [ "$2" != "POST-INSTALL" ]; then exit 0; fi
+# $NetBSD: INSTALL,v 1.2 2006/06/19 23:22:29 jlam Exp $
 
-cat <<EOF
-==============================================================================
+case "${STAGE}" in
+POST-INSTALL)
+       emulsubdir=osf1
 
-Do not forget to include COMPAT_OSF1 in your kernel configuration
-file.  (OSF/1 binaries require this option in order to work.)
-EOF
+       emuldir="/emul/$emulsubdir"
+       pkgemuldir="${PKG_PREFIX}/emul/$emulsubdir"
 
-if [ "`cd /etc && cd ${PKG_PREFIX}/emul/$emul 2>/dev/null && pwd -P`" != \
-     "`cd / && cd /emul/$emul 2>/dev/null && pwd -P`" ]; then
-       if [ -e /emul/$emul -o -L /emul/$emul ] || \
-          [ \( -e /emul -o -L /emul \) -a ! -d /emul ]; then
-               cat <<-EOF
+       emuldir_pwd=`cd $emulsubdir 2>/dev/null && ${PWD_CMD}`
+       pkgemuldir_pwd=`cd $pkgemulsubdir 2>/dev/null && ${PWD_CMD}`
 
-               IMPORTANT:  You must create a symbolic link from /emul/$emul to
-               ${PKG_PREFIX}/emul/$emul in order for this package to work properly.
-               (It seems there is something else located at /emul/$emul.)
-               EOF
-       else
-               mkdir -p /emul
-               ln -sf ${PKG_PREFIX}/emul/$emul /emul/$emul
-       fi
-fi
+       if ${TEST} "$emuldir_pwd" != "$pkgemuldir_pwd"; then
+               if ${TEST} -e $emuldir -o -L $emuldir ||
+                  ${TEST} \( -e /emul -o -L /emul \) -a ! -d /emul; then
+                       ${CAT} << EOF
+==============================================================================
+You must create a symbolic link for ${PKGNAME} to work properly:
 
-cat <<EOF
+       $pkgemuldir  ->  $emuldir
 
+It seems there is something else located at $emuldir.
 ==============================================================================
 EOF
+               else
+                       ${MKDIR} -p `${DIRNAME} $emuldir` && 
+                       ${LN} -fs $pkgemuldir $emuldir
+               fi
+       fi
+       ;;
+esac
diff -r ce3143f72e69 -r 5290e4428fdd emulators/osf1_lib/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/osf1_lib/MESSAGE        Mon Jun 19 23:20:59 2006 +0000
@@ -0,0 +1,6 @@
+==============================================================================
+$NetBSD: MESSAGE,v 1.1 2006/06/19 23:22:29 jlam Exp $
+
+Do not forget to include COMPAT_OSF1 in your kernel configuration file.
+OSF/1 binaries require this option in order to work.
+==============================================================================
diff -r ce3143f72e69 -r 5290e4428fdd emulators/osf1_lib/Makefile
--- a/emulators/osf1_lib/Makefile       Mon Jun 19 23:19:24 2006 +0000
+++ b/emulators/osf1_lib/Makefile       Mon Jun 19 23:20:59 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2006/05/22 22:22:03 jlam Exp $
+# $NetBSD: Makefile,v 1.13 2006/06/19 23:22:29 jlam Exp $
 
 DISTNAME=      netscape-4.7-3.alpha
 PKGNAME=       osf1_lib-1.1
@@ -29,8 +29,6 @@
 EXTRACT_ONLY=  # empty
 NO_CONFIGURE=  yes
 NO_BUILD=      yes
-INSTALL_SRC=   ${PKGDIR}/INSTALL
-DEINSTALL_SRC= # empty
 
 RPMARGS=       -i usr/lib -i usr/bin ${DISTDIR}/${DISTFILES}
 
@@ -46,7 +44,4 @@
        (cd ${EMULDIR}; ${MKDIR} usr/lib/X11)
        (cd ${EMULDIR}/usr/lib/X11; ${LN} -fs ${X11BASE}/lib/X11/locale .)
 
-post-install:
-       PKG_PREFIX="${PREFIX}" ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
-
 .include "../../mk/bsd.pkg.mk"



Home | Main Index | Thread Index | Old Index