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/03dc1b3a7fa1
branches:  trunk
changeset: 514879:03dc1b3a7fa1
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Mon Jun 19 23:27:34 2006 +0000

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

Also, remove the unused show-shlib-type target.

diffstat:

 emulators/suse_base/INSTALL           |  82 +++++++++-------------------------
 emulators/suse_base/MESSAGE.DragonFly |   7 ++
 emulators/suse_base/MESSAGE.FreeBSD   |   7 ++
 emulators/suse_base/MESSAGE.NetBSD    |   7 ++
 emulators/suse_base/Makefile          |   3 +-
 emulators/suse_linux/Makefile.common  |  15 ++++-
 6 files changed, 55 insertions(+), 66 deletions(-)

diffs (177 lines):

diff -r 61f87d376b20 -r 03dc1b3a7fa1 emulators/suse_base/INSTALL
--- a/emulators/suse_base/INSTALL       Mon Jun 19 23:24:21 2006 +0000
+++ b/emulators/suse_base/INSTALL       Mon Jun 19 23:27:34 2006 +0000
@@ -1,68 +1,30 @@
-#!/bin/sh
-# $NetBSD: INSTALL,v 1.4 2004/04/14 11:31:10 xtraeme Exp $
-
-if [ "$2" != "POST-INSTALL" ]; then exit 0; fi
-emul=linux
-OPSYS=`/usr/bin/uname -s`
-
-cat <<EOF
-==============================================================================
-
-EOF
+# $NetBSD: INSTALL,v 1.5 2006/06/19 23:27:34 jlam Exp $
 
-if [ "$OPSYS" = "NetBSD" ]; then
-       cat <<-EOF
-       Do not forget to include COMPAT_LINUX (and EXEC_ELF32 on NetBSD systems older
-       than 1.5) in your kernel configuration file.  (Linux binaries require these
-       options in order to work.)
-       EOF
-fi
+case "${STAGE}" in
+POST-INSTALL)
+       emulsubdir=linux
 
-if [ "$OPSYS" = "FreeBSD" ]; then 
-       cat <<-EOF
-       Do not forget to include COMPAT_LINUX in your kernel configuration file.
-       You also need to load "linux.ko" kernel module (using kldload(8) or by
-       setting linux_enable="yes" in /etc/rc.conf.
-       EOF
-fi
+       emuldir="@OPSYS_EMULDIR@"
+       pkgemuldir="${PKG_PREFIX}/emul/$emulsubdir"
 
-if [ "$OPSYS" = "NetBSD" ]; then
-    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
-
-               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
-fi
+       emuldir_pwd=`cd $emulsubdir 2>/dev/null && ${PWD_CMD}`
+       pkgemuldir_pwd=`cd $pkgemulsubdir 2>/dev/null && ${PWD_CMD}`
 
-if [ "$OPSYS" = "FreeBSD" ]; then
-    if [ "`cd /etc && cd ${PKG_PREFIX}/emul/$emul 2>/dev/null && pwd -P`" != \
-       "`cd / && cd /compat/$emul 2>/dev/null && pwd -P`" ]; then
-           if [ -e /compat/$emul -o -L /compat/$emul ] || \
-               [ \( -e /compat -o -L /compat \) -a ! -d /compat ]; then
-               cat <<-EOF
-                       
-               IMPORTANT:  You must create a symbolic link from /compat/$emul to
-               ${PKG_PREFIX}/emul/$emul in order for this package to work properly.
-               (It seems there is something else located at /compat/$emul.)
-               EOF
-           else
-               mkdir -p /compat
-               ln -sf ${PKG_PREFIX}/emul/$emul /compat/$emul
-           fi
-    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 61f87d376b20 -r 03dc1b3a7fa1 emulators/suse_base/MESSAGE.DragonFly
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/suse_base/MESSAGE.DragonFly     Mon Jun 19 23:27:34 2006 +0000
@@ -0,0 +1,7 @@
+==============================================================================
+$NetBSD: MESSAGE.DragonFly,v 1.1 2006/06/19 23:27:34 jlam Exp $
+
+Do not forget to include COMPAT_LINUX in your kernel configuration file.
+You will also need to load the "linux.ko" kernel module (using kldload(8)
+or by setting linux_enable=yes in /etc/rc.conf.
+==============================================================================
diff -r 61f87d376b20 -r 03dc1b3a7fa1 emulators/suse_base/MESSAGE.FreeBSD
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/suse_base/MESSAGE.FreeBSD       Mon Jun 19 23:27:34 2006 +0000
@@ -0,0 +1,7 @@
+==============================================================================
+$NetBSD: MESSAGE.FreeBSD,v 1.1 2006/06/19 23:27:34 jlam Exp $
+
+Do not forget to include COMPAT_LINUX in your kernel configuration file.
+You will also need to load the "linux.ko" kernel module (using kldload(8)
+or by setting linux_enable=yes in /etc/rc.conf.
+==============================================================================
diff -r 61f87d376b20 -r 03dc1b3a7fa1 emulators/suse_base/MESSAGE.NetBSD
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/suse_base/MESSAGE.NetBSD        Mon Jun 19 23:27:34 2006 +0000
@@ -0,0 +1,7 @@
+==============================================================================
+$NetBSD: MESSAGE.NetBSD,v 1.1 2006/06/19 23:27:34 jlam Exp $
+
+Do not forget to include COMPAT_LINUX in your kernel configuration file.
+On NetBSD<1.6, you will also need to include the EXEC_ELF32 option.
+Linux binaries require these options in order to work.
+==============================================================================
diff -r 61f87d376b20 -r 03dc1b3a7fa1 emulators/suse_base/Makefile
--- a/emulators/suse_base/Makefile      Mon Jun 19 23:24:21 2006 +0000
+++ b/emulators/suse_base/Makefile      Mon Jun 19 23:27:34 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.61 2006/06/17 19:30:55 rillig Exp $
+# $NetBSD: Makefile,v 1.62 2006/06/19 23:27:34 jlam Exp $
 
 DISTNAME=              suse_base-${SUSE_VERSION}
 PKGREVISION=           10
@@ -85,7 +85,6 @@
                < ${LINUX_LDD} > ${LINUX_LDD}.new
        ${MV} ${LINUX_LDD}.new ${LINUX_LDD}
        ${CHMOD} +x ${LINUX_LDD}
-       @${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${INSTALL_FILE} - POST-INSTALL
 
 .include "../../emulators/suse_linux/Makefile.common"
 .include "../../mk/bsd.pkg.mk"
diff -r 61f87d376b20 -r 03dc1b3a7fa1 emulators/suse_linux/Makefile.common
--- a/emulators/suse_linux/Makefile.common      Mon Jun 19 23:24:21 2006 +0000
+++ b/emulators/suse_linux/Makefile.common      Mon Jun 19 23:27:34 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.22 2005/12/12 14:43:25 joerg Exp $
+# $NetBSD: Makefile.common,v 1.23 2006/06/19 23:27:34 jlam Exp $
 
 .include "../../emulators/suse_linux/vars.mk"
 .include "../../emulators/suse_linux/arch.mk"
@@ -24,6 +24,16 @@
 EMULSUBDIR=            emul/linux
 EMULDIR=               ${PREFIX}/${EMULSUBDIR}
 
+# Set location of OPSYS-specific emulation directory
+.if ${OPSYS} == "NetBSD"
+OPSYS_EMULDIR=         /${EMULSUBDIR}
+.elif (${OPSYS} == "FreeBSD") || (${OPSYS} == "DragonFly")
+OPSYS_EMULDIR=         /compat/${EMULSUBDIR:T}
+.else
+OPSYS_EMULDIR=         /${EMULSUBDIR}
+.endif
+FILES_SUBST+=          OPSYS_EMULDIR=${OPSYS_EMULDIR:Q}
+
 RPM2PKG=               ${PREFIX}/sbin/rpm2pkg
 BUILD_DEPENDS+=                rpm2pkg>=2.1:../../pkgtools/rpm2pkg
 
@@ -59,6 +69,3 @@
          ${ECHO} "@unexec %D/${EMULSUBDIR}/sbin/ldconfig -r %D/${EMULSUBDIR} 2>/dev/null" >>${PLIST_SRC}; \
        fi
 .endif
-
-show-shlib-type:
-       @${ECHO} linux-${MACHINE_ARCH}



Home | Main Index | Thread Index | Old Index