Permalink
Browse files

Make these install into /usr on most platforms, and into /emul/aout/usr

on platforms transitioning to ELF (currently only i386).  The /emul/aout
installation occurs much like the suse_linux and freebsd_lib packages.

Also add SHLIB_HANDLING=NO to ensure library links aren't clobbered.

This should fix PR#9011.
  • Loading branch information...
1 parent 09eb88e commit cf71657611cbc64fa53d671c0ca99604399d1c65 jlam committed Oct 13, 2000
View
34 emulators/compat12/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2000/02/05 18:33:29 wiz Exp $
+# $NetBSD: Makefile,v 1.16 2000/10/13 23:36:37 jlam Exp $
#
DISTNAME= compat12-${MACHINE_ARCH}
@@ -12,15 +12,37 @@ HOMEPAGE= http://www.netbsd.org/Releases/formal-1.2/index.html
ONLY_FOR_PLATFORM= NetBSD-*-i386 NetBSD-*-m68k NetBSD-*-ns32k \
NetBSD-*-sparc
-NO_BUILD=
+NO_MTREE= # defined
+SHLIB_HANDLING= NO
+
+DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
+INSTALL_FILE= ${WRKDIR}/INSTALL
.include "../../mk/bsd.prefs.mk"
-# This installs in /usr to avoid dynamic linker annoyances
-LOCALBASE= /usr
-NO_MTREE=
+# This installs in /usr (or /emul/aout/usr) to avoid dynamic linker annoyances
+.if ${MACHINE_ARCH} == "i386" && ${OBJECT_FMT} == "ELF"
+EMULSUBDIR= emul/aout
+COMPAT_LIBDIR= ${EMULSUBDIR}/usr/lib
+.else
+LOCALBASE= /usr
+COMPAT_LIBDIR= lib
+.endif
+
+PLIST_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR}
+
+do-build:
+ ${SED} -e "s,@COMPAT_LIBDIR@,${COMPAT_LIBDIR},g" \
+ < ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
+ ${SED} -e "s,@MACHINE_ARCH@,${MACHINE_ARCH},g" \
+ -e "s,@OBJECT_FMT@,${OBJECT_FMT},g" \
+ < ${PKGDIR}/INSTALL > ${INSTALL_FILE}
do-install:
- ${INSTALL_DATA} ${WRKDIR}/lib*.so* ${PREFIX}/lib/
+ ${INSTALL_DATA_DIR} ${PREFIX}/${COMPAT_LIBDIR}
+ ${INSTALL_DATA} ${WRKDIR}/lib*.so* ${PREFIX}/${COMPAT_LIBDIR}
+
+post-install:
+ PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
.include "../../mk/bsd.pkg.mk"
View
21 emulators/compat12/pkg/DEINSTALL
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# $NetBSD: DEINSTALL,v 1.1 2000/10/13 23:36:39 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+case ${STAGE} in
+DEINSTALL)
+ ;;
+POST-DEINSTALL)
+ COMPAT_LIBDIR=@COMPAT_LIBDIR@
+
+ rmdir -p ${PKG_PREFIX}/${COMPAT_LIBDIR} 2>/dev/null || true
+ ;;
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
View
56 emulators/compat12/pkg/INSTALL
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# $NetBSD: INSTALL,v 1.1 2000/10/13 23:36:39 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+case ${STAGE} in
+PRE-INSTALL)
+ ;;
+POST-INSTALL)
+ MACHINE_ARCH=@MACHINE_ARCH@
+ OBJECT_FMT=@OBJECT_FMT@
+
+ # Only create the symlink on certain platform/object combinations.
+ #
+ create_emul_symlink=0
+ if [ "${MACHINE_ARCH}" = "i386" -a "${OBJECT_FMT}" = "ELF" ]
+ then
+ create_emul_symlink=1
+ fi
+
+ if [ ${create_emul_symlink} = 1 ]
+ then
+ # Create a symlink from /emul/aout --> ${PKG_PREFIX}/emul/out
+ # if it doesn't already exist. Warn if we can't do this.
+ #
+ emul=aout
+ 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
+ ;;
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
View
10 emulators/compat12/pkg/PLIST
@@ -1,5 +1,5 @@
-@comment $NetBSD: PLIST,v 1.1 1998/08/13 02:17:39 tv Exp $
-lib/libedit.so.0.0
-lib/libg++.so.2.0
-lib/libg++.so.3.0
-lib/libutil.so.3.2
+@comment $NetBSD: PLIST,v 1.2 2000/10/13 23:36:39 jlam Exp $
+${COMPAT_LIBDIR}/libedit.so.0.0
+${COMPAT_LIBDIR}/libg++.so.2.0
+${COMPAT_LIBDIR}/libg++.so.3.0
+${COMPAT_LIBDIR}/libutil.so.3.2
View
36 emulators/compat13/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2000/02/05 18:33:30 wiz Exp $
+# $NetBSD: Makefile,v 1.6 2000/10/13 23:36:40 jlam Exp $
#
DISTNAME= compat13-${MACHINE_ARCH}
@@ -14,18 +14,38 @@ ONLY_FOR_PLATFORM= NetBSD-*-alpha NetBSD-*-arm32 NetBSD-*-i386 \
NetBSD-*-sparc
NOT_FOR_PLATFORM= NetBSD-1.3*-*
-NO_BUILD=
+NO_MTREE= # defined
+SHLIB_HANDLING= NO
+
+DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
+INSTALL_FILE= ${WRKDIR}/INSTALL
.include "../../mk/bsd.prefs.mk"
-# This installs in /usr to avoid dynamic linker annoyances
+# This installs in /usr (or /emul/aout/usr) to avoid dynamic linker annoyances
+.if ${MACHINE_ARCH} == "i386" && ${OBJECT_FMT} == "ELF"
+EMULSUBDIR= emul/aout
+COMPAT_LIBDIR= ${EMULSUBDIR}/usr/lib
+.else
LOCALBASE= /usr
-NO_MTREE=
+COMPAT_LIBDIR= lib
+.endif
+
+PLIST_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR}
+
+do-build:
+ ${SED} -e "s,@MACHINE_ARCH@,${MACHINE_ARCH},g" \
+ -e "s,@COMPAT_LIBDIR@,${COMPAT_LIBDIR},g" \
+ < ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
+ ${SED} -e "s,@MACHINE_ARCH@,${MACHINE_ARCH},g" \
+ -e "s,@OBJECT_FMT@,${OBJECT_FMT},g" \
+ < ${PKGDIR}/INSTALL > ${INSTALL_FILE}
do-install:
- ${INSTALL_DATA} ${WRKDIR}/lib*.so* ${PREFIX}/lib/
-.if (${MACHINE_ARCH} == "mipsel")
- ${LN} -sf ld.elf_so /usr/libexec/ld.so
-.endif
+ ${INSTALL_DATA_DIR} ${PREFIX}/${COMPAT_LIBDIR}
+ ${INSTALL_DATA} ${WRKDIR}/lib*.so* ${PREFIX}/${COMPAT_LIBDIR}
+
+post-install:
+ PKG_PREFIX=${PREFIX} ${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
.include "../../mk/bsd.pkg.mk"
View
28 emulators/compat13/pkg/DEINSTALL
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# $NetBSD: DEINSTALL,v 1.1 2000/10/13 23:36:40 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+case ${STAGE} in
+DEINSTALL)
+ ;;
+POST-DEINSTALL)
+ MACHINE_ARCH=@MACHINE_ARCH@
+ COMPAT_LIBDIR=@COMPAT_LIBDIR@
+
+ if [ "${MACHINE_ARCH}" = "mipsel" ]
+ then
+ rm -f ${PKG_PREFIX}/libexec/ld.so
+ rmdir -p ${PKG_PREFIX}/libexec 2>/dev/null || true
+ fi
+
+ rmdir -p ${PKG_PREFIX}/${COMPAT_LIBDIR} 2>/dev/null || true
+ ;;
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
View
61 emulators/compat13/pkg/INSTALL
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# $NetBSD: INSTALL,v 1.1 2000/10/13 23:36:40 jlam Exp $
+
+PKGNAME=$1
+STAGE=$2
+
+case ${STAGE} in
+PRE-INSTALL)
+ ;;
+POST-INSTALL)
+ MACHINE_ARCH=@MACHINE_ARCH@
+ OBJECT_FMT=@OBJECT_FMT@
+
+ if [ "${MACHINE_ARCH}" = "mipsel" ]
+ then
+ ln -sf ld.elf_so /usr/libexec/ld.so
+ fi
+
+ # Only create the symlink on certain platform/object combinations.
+ #
+ create_emul_symlink=0
+ if [ "${MACHINE_ARCH}" = "i386" -a "${OBJECT_FMT}" = "ELF" ]
+ then
+ create_emul_symlink=1
+ fi
+
+ if [ ${create_emul_symlink} = 1 ]
+ then
+ # Create a symlink from /emul/aout --> ${PKG_PREFIX}/emul/out
+ # if it doesn't already exist. Warn if we can't do this.
+ #
+ emul=aout
+ 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
+ ;;
+*)
+ echo "Unexpected argument: ${STAGE}"
+ exit 1
+ ;;
+esac
+exit 0
View
12 emulators/compat13/pkg/PLIST
@@ -1,7 +1,5 @@
-@comment $NetBSD: PLIST,v 1.2 1999/04/27 11:52:38 tv Exp $
-lib/libedit.so.1.0
-lib/libg++.so.4.0
-lib/libstdc++.so.0.1
-lib/libutil.so.4.2
-@exec [ `sysctl -n hw.machine_arch` != mipsel ] || ln -sf ld.elf_so /usr/libexec/ld.so
-@unexec [ `sysctl -n hw.machine_arch` != mipsel ] || rm -f /usr/libexec/ld.so
+@comment $NetBSD: PLIST,v 1.3 2000/10/13 23:36:40 jlam Exp $
+${COMPAT_LIBDIR}/libedit.so.1.0
+${COMPAT_LIBDIR}/libg++.so.4.0
+${COMPAT_LIBDIR}/libstdc++.so.0.1
+${COMPAT_LIBDIR}/libutil.so.4.2

0 comments on commit cf71657

Please sign in to comment.