summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2007-08-21 22:49:02 +0000
committerjlam <jlam@pkgsrc.org>2007-08-21 22:49:02 +0000
commitdb8ad0f80a4eb394cdb0ff25f81e0d7c15d7090e (patch)
treec963fbe349aa6c3a854fc36e80c1b467ee94113c /emulators
parent8bdca16249cd925c644587cc60bcaed6e681ef4b (diff)
downloadpkgsrc-db8ad0f80a4eb394cdb0ff25f81e0d7c15d7090e.tar.gz
* Support netbsd-* as a valid platform in EMUL_PLATFORMS. Use the
pkgsrc/emulator/compat* and pkgsrc/emulator/netbsd32_compat* packages to provide the necessary shared libraries to run dynamically linked NetBSD binaries from the days of yore. * Add some additional compat* packages for completeness: compat15, compat20, compat30 * Modify the compat* packages so that "compatNM" only provides files that aren't in "NetBSD-N.(M+1)". For example, compat12 only provides files that don't exist in NetBSD-1.3.x, compat13 only provides files that don't exist in NetBSD-1.4.x, etc. As a result, if you are running NetBSD-3.0/alpha and want to run a 1.3 dynamically linked binary, there is an automatic dependency chain that causes the following packages to be installed: compat13, compat14, compat15, compat16, compat20 There are some deviations from this dependency chain on platforms that have changed executable formats, e.g. i386, m68, sparc, etc. However, in general pkgsrc will require that you have the necessary COMPAT_* options in your kernel to match the installed compat* packages. This restriction is an artificial one imposed by pkgsrc, but allows for a single set of distfiles to be used on all versions of NetBSD. * Provide compat* package support for every supported architecture of NetBSD. Verily, it is now possible to run 1.2 binaries on NetBSD-1.5.3/pc532 by installing the compat12 package from pkgsrc. Rejoice, one and all! * The netbsd32_compat* packages mirror the corresponding compat* packages for use by sparc64 and x86_64 to allow running 32-bit binaries with COMPAT_NETBSD32 kernel support. The "extras" packages supply the additional shared libraries from the corresponding release of NetBSD so that the set of files in /emul/netbsd32 will be complete. * pkgsrc/emulators/compat_netbsd contains infrastructure files shared by all of the compat* packages.
Diffstat (limited to 'emulators')
-rw-r--r--emulators/Makefile17
-rw-r--r--emulators/compat12/DEINSTALL14
-rw-r--r--emulators/compat12/DESCR7
-rw-r--r--emulators/compat12/INSTALL50
-rw-r--r--emulators/compat12/MESSAGE7
-rw-r--r--emulators/compat12/Makefile61
-rw-r--r--emulators/compat12/PLIST5
-rw-r--r--emulators/compat12/PLIST.a.out7
-rw-r--r--emulators/compat12/PLIST.i3862
-rw-r--r--emulators/compat12/PLIST.m68k3
-rw-r--r--emulators/compat12/PLIST.ns32k2
-rw-r--r--emulators/compat12/PLIST.sparc2
-rw-r--r--emulators/compat12/distinfo26
-rw-r--r--emulators/compat12/emulator.mk51
-rw-r--r--emulators/compat13/DEINSTALL21
-rw-r--r--emulators/compat13/DESCR6
-rw-r--r--emulators/compat13/INSTALL55
-rw-r--r--emulators/compat13/MESSAGE7
-rw-r--r--emulators/compat13/Makefile67
-rw-r--r--emulators/compat13/PLIST5
-rw-r--r--emulators/compat13/PLIST.ELF15
-rw-r--r--emulators/compat13/PLIST.a.out8
-rw-r--r--emulators/compat13/PLIST.alpha3
-rw-r--r--emulators/compat13/PLIST.i3863
-rw-r--r--emulators/compat13/PLIST.m68k2
-rw-r--r--emulators/compat13/PLIST.mipsel3
-rw-r--r--emulators/compat13/PLIST.sparc2
-rw-r--r--emulators/compat13/distinfo47
-rw-r--r--emulators/compat13/emulator.mk47
-rw-r--r--emulators/compat14/DEINSTALL22
-rw-r--r--emulators/compat14/DESCR7
-rw-r--r--emulators/compat14/INSTALL56
-rw-r--r--emulators/compat14/MESSAGE7
-rw-r--r--emulators/compat14/Makefile88
-rw-r--r--emulators/compat14/PLIST48
-rw-r--r--emulators/compat14/PLIST.ELF15
-rw-r--r--emulators/compat14/PLIST.a.out9
-rw-r--r--emulators/compat14/PLIST.alpha22
-rw-r--r--emulators/compat14/PLIST.arm10
-rw-r--r--emulators/compat14/PLIST.i38640
-rw-r--r--emulators/compat14/PLIST.m68k10
-rw-r--r--emulators/compat14/PLIST.ns32k2
-rw-r--r--emulators/compat14/PLIST.powerpc22
-rw-r--r--emulators/compat14/PLIST.sparc35
-rw-r--r--emulators/compat14/PLIST.vax10
-rw-r--r--emulators/compat14/distinfo35
-rw-r--r--emulators/compat14/emulator.mk47
-rw-r--r--emulators/compat15-extras/DESCR4
-rw-r--r--emulators/compat15-extras/Makefile24
-rw-r--r--emulators/compat15-extras/PLIST62
-rw-r--r--emulators/compat15-extras/PLIST.i3867
-rw-r--r--emulators/compat15-extras/PLIST.sparc5
-rw-r--r--emulators/compat15-extras/distinfo8
-rw-r--r--emulators/compat15/DESCR2
-rw-r--r--emulators/compat15/MESSAGE7
-rw-r--r--emulators/compat15/Makefile64
-rw-r--r--emulators/compat15/PLIST.ELF53
-rw-r--r--emulators/compat15/PLIST.a.out47
-rw-r--r--emulators/compat15/PLIST.alpha8
-rw-r--r--emulators/compat15/PLIST.arm17
-rw-r--r--emulators/compat15/PLIST.i38614
-rw-r--r--emulators/compat15/PLIST.m68k17
-rw-r--r--emulators/compat15/PLIST.mipsel8
-rw-r--r--emulators/compat15/PLIST.powerpc14
-rw-r--r--emulators/compat15/PLIST.sparc8
-rw-r--r--emulators/compat15/PLIST.sparc642
-rw-r--r--emulators/compat15/PLIST.vax16
-rw-r--r--emulators/compat15/distinfo32
-rw-r--r--emulators/compat15/emulator.mk57
-rw-r--r--emulators/compat16-extras/DESCR4
-rw-r--r--emulators/compat16-extras/Makefile24
-rw-r--r--emulators/compat16-extras/PLIST100
-rw-r--r--emulators/compat16-extras/PLIST.i38698
-rw-r--r--emulators/compat16-extras/PLIST.sparc4
-rw-r--r--emulators/compat16-extras/distinfo8
-rw-r--r--emulators/compat16/DESCR4
-rw-r--r--emulators/compat16/MESSAGE8
-rw-r--r--emulators/compat16/Makefile63
-rw-r--r--emulators/compat16/PLIST33
-rw-r--r--emulators/compat16/PLIST.alpha11
-rw-r--r--emulators/compat16/PLIST.arm11
-rw-r--r--emulators/compat16/PLIST.i386149
-rw-r--r--emulators/compat16/PLIST.m68k11
-rw-r--r--emulators/compat16/PLIST.mipseb11
-rw-r--r--emulators/compat16/PLIST.mipsel11
-rw-r--r--emulators/compat16/PLIST.powerpc9
-rw-r--r--emulators/compat16/PLIST.sparc11
-rw-r--r--emulators/compat16/PLIST.sparc6411
-rw-r--r--emulators/compat16/PLIST.vax7
-rw-r--r--emulators/compat16/distinfo35
-rw-r--r--emulators/compat16/emulator.mk43
-rw-r--r--emulators/compat20-extras/DESCR4
-rw-r--r--emulators/compat20-extras/Makefile25
-rw-r--r--emulators/compat20-extras/PLIST295
-rw-r--r--emulators/compat20-extras/PLIST.i3869
-rw-r--r--emulators/compat20-extras/PLIST.sparc5
-rw-r--r--emulators/compat20-extras/distinfo8
-rw-r--r--emulators/compat20/DESCR2
-rw-r--r--emulators/compat20/MESSAGE7
-rw-r--r--emulators/compat20/Makefile53
-rw-r--r--emulators/compat20/PLIST7
-rw-r--r--emulators/compat20/distinfo41
-rw-r--r--emulators/compat20/emulator.mk44
-rw-r--r--emulators/compat30-extras/DESCR4
-rw-r--r--emulators/compat30-extras/Makefile28
-rw-r--r--emulators/compat30-extras/PLIST381
-rw-r--r--emulators/compat30-extras/PLIST.i38618
-rw-r--r--emulators/compat30-extras/PLIST.sparc10
-rw-r--r--emulators/compat30-extras/PLIST.vax8
-rw-r--r--emulators/compat30-extras/distinfo11
-rw-r--r--emulators/compat30/DESCR2
-rw-r--r--emulators/compat30/MESSAGE7
-rw-r--r--emulators/compat30/Makefile63
-rw-r--r--emulators/compat30/PLIST49
-rw-r--r--emulators/compat30/PLIST.alpha8
-rw-r--r--emulators/compat30/PLIST.arm8
-rw-r--r--emulators/compat30/PLIST.i3868
-rw-r--r--emulators/compat30/PLIST.m68k8
-rw-r--r--emulators/compat30/PLIST.mipseb8
-rw-r--r--emulators/compat30/PLIST.mipsel8
-rw-r--r--emulators/compat30/PLIST.powerpc8
-rw-r--r--emulators/compat30/PLIST.sh3eb8
-rw-r--r--emulators/compat30/PLIST.sh3el8
-rw-r--r--emulators/compat30/PLIST.sparc8
-rw-r--r--emulators/compat30/PLIST.sparc648
-rw-r--r--emulators/compat30/PLIST.x86_648
-rw-r--r--emulators/compat30/distinfo41
-rw-r--r--emulators/compat30/emulator.mk44
-rw-r--r--emulators/compat_netbsd/DEINSTALL9
-rw-r--r--emulators/compat_netbsd/INSTALL.ELF137
-rw-r--r--emulators/compat_netbsd/INSTALL.a.out140
-rw-r--r--emulators/compat_netbsd/INSTALL.emulaout134
-rw-r--r--emulators/compat_netbsd/INSTALL.emulnetbsd32110
-rw-r--r--emulators/compat_netbsd/Makefile.common123
-rw-r--r--emulators/netbsd32_compat14/DEINSTALL19
-rw-r--r--emulators/netbsd32_compat14/DESCR5
-rw-r--r--emulators/netbsd32_compat14/INSTALL51
-rw-r--r--emulators/netbsd32_compat14/Makefile56
-rw-r--r--emulators/netbsd32_compat14/PLIST39
-rw-r--r--emulators/netbsd32_compat14/PLIST.x86_643
-rw-r--r--emulators/netbsd32_compat14/distinfo8
-rw-r--r--emulators/netbsd32_compat15-extras/Makefile5
-rw-r--r--emulators/netbsd32_compat15/DEINSTALL20
-rw-r--r--emulators/netbsd32_compat15/DESCR5
-rw-r--r--emulators/netbsd32_compat15/INSTALL50
-rw-r--r--emulators/netbsd32_compat15/Makefile64
-rw-r--r--emulators/netbsd32_compat15/PLIST117
-rw-r--r--emulators/netbsd32_compat15/distinfo5
-rw-r--r--emulators/netbsd32_compat16-extras/Makefile5
-rw-r--r--emulators/netbsd32_compat16/DEINSTALL18
-rw-r--r--emulators/netbsd32_compat16/DESCR5
-rw-r--r--emulators/netbsd32_compat16/INSTALL51
-rw-r--r--emulators/netbsd32_compat16/Makefile66
-rw-r--r--emulators/netbsd32_compat16/PLIST128
-rw-r--r--emulators/netbsd32_compat16/PLIST.sparc648
-rw-r--r--emulators/netbsd32_compat16/PLIST.x86_644
-rw-r--r--emulators/netbsd32_compat16/distinfo7
-rw-r--r--emulators/netbsd32_compat20-extras/Makefile5
-rw-r--r--emulators/netbsd32_compat20/Makefile5
-rw-r--r--emulators/netbsd32_compat30-extras/Makefile5
-rw-r--r--emulators/netbsd32_compat30/Makefile5
161 files changed, 3483 insertions, 1363 deletions
diff --git a/emulators/Makefile b/emulators/Makefile
index ce6e53d46c5..43f6e907e41 100644
--- a/emulators/Makefile
+++ b/emulators/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.162 2007/08/16 14:01:38 jlam Exp $
+# $NetBSD: Makefile,v 1.163 2007/08/21 22:49:03 jlam Exp $
#
COMMENT= Emulators for other operating systems
@@ -24,7 +24,15 @@ SUBDIR+= ckmame
SUBDIR+= compat12
SUBDIR+= compat13
SUBDIR+= compat14
+SUBDIR+= compat15
+SUBDIR+= compat15-extras
SUBDIR+= compat16
+SUBDIR+= compat16-extras
+SUBDIR+= compat20
+SUBDIR+= compat20-extras
+SUBDIR+= compat30
+SUBDIR+= compat30-extras
+#SUBDIR+= compat_netbsd # only contains Makefile fragments
SUBDIR+= cygwin_esound
SUBDIR+= cygwin_lib
SUBDIR+= darcnes
@@ -63,9 +71,14 @@ SUBDIR+= makeppf
SUBDIR+= mednafen
SUBDIR+= minivmac
SUBDIR+= mmix
-SUBDIR+= netbsd32_compat14
SUBDIR+= netbsd32_compat15
+SUBDIR+= netbsd32_compat15-extras
SUBDIR+= netbsd32_compat16
+SUBDIR+= netbsd32_compat16-extras
+SUBDIR+= netbsd32_compat20
+SUBDIR+= netbsd32_compat20-extras
+SUBDIR+= netbsd32_compat30
+SUBDIR+= netbsd32_compat30-extras
SUBDIR+= openmsx
SUBDIR+= or1ksim
SUBDIR+= osf1_lib
diff --git a/emulators/compat12/DEINSTALL b/emulators/compat12/DEINSTALL
deleted file mode 100644
index 5bb3b58fdf7..00000000000
--- a/emulators/compat12/DEINSTALL
+++ /dev/null
@@ -1,14 +0,0 @@
-# $NetBSD: DEINSTALL,v 1.2 2003/08/30 18:53:07 jlam Exp $
-
-case ${STAGE} in
-POST-DEINSTALL)
- COMPAT_LIBDIR=@COMPAT_LIBDIR@
-
- ${RMDIR} -p ${PKG_PREFIX}/${COMPAT_LIBDIR} 2>/dev/null || ${TRUE}
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/compat12/DESCR b/emulators/compat12/DESCR
index 3d5301a947f..53b97b9704b 100644
--- a/emulators/compat12/DESCR
+++ b/emulators/compat12/DESCR
@@ -1,5 +1,2 @@
-This package supplies the user files necessary for full compatibility with
-dynamically linked executables compiled under NetBSD 1.1 through 1.2.1.
-You still need the option COMPAT_12 in your kernel configuration (and
-probably others; see options(4) for more information) to make use of
-NetBSD 1.2 binaries.
+This package supplies the user files needed to run dynamically linked
+executables compiled under NetBSD 1.1 through 1.2.
diff --git a/emulators/compat12/INSTALL b/emulators/compat12/INSTALL
deleted file mode 100644
index 41d5c283040..00000000000
--- a/emulators/compat12/INSTALL
+++ /dev/null
@@ -1,50 +0,0 @@
-# $NetBSD: INSTALL,v 1.2 2003/08/30 18:53:07 jlam Exp $
-
-case ${STAGE} in
-POST-INSTALL)
- MACHINE_ARCH=@MACHINE_ARCH@
- OBJECT_FMT=@OBJECT_FMT@
-
- # Only create the symlink on certain platform/object combinations.
- #
- create_emul_symlink=0
- if [ "${OBJECT_FMT}" = "ELF" ] && \
- [ "${MACHINE_ARCH}" = "i386" -o "${MACHINE_ARCH}" = "sparc" ]
- 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
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/compat12/MESSAGE b/emulators/compat12/MESSAGE
new file mode 100644
index 00000000000..ab811cd3b1f
--- /dev/null
+++ b/emulators/compat12/MESSAGE
@@ -0,0 +1,7 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2007/08/21 22:49:03 jlam Exp $
+
+The COMPAT_12 option must be included in the kernel configuration (and
+possibly others; see options(4) for more information) to make use of
+NetBSD 1.2 binaries.
+===========================================================================
diff --git a/emulators/compat12/Makefile b/emulators/compat12/Makefile
index c0e8a99c274..b495acb9c95 100644
--- a/emulators/compat12/Makefile
+++ b/emulators/compat12/Makefile
@@ -1,44 +1,31 @@
-# $NetBSD: Makefile,v 1.32 2006/10/19 19:37:38 wiz Exp $
-#
+# $NetBSD: Makefile,v 1.33 2007/08/21 22:49:04 jlam Exp $
-DISTNAME= compat12-${MACHINE_ARCH}
-PKGNAME= compat12-1.2.1
-CATEGORIES= emulators
-MASTER_SITES= ${MASTER_SITE_LOCAL}
+DISTNAME= compat12 # overridden below
+NETBSD_VERSION= 1.2
+PKGREVISION= 1
-MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.NetBSD.org/Releases/formal-1.2/index.html
-COMMENT= Shared libraries for NetBSD 1.2 (and earlier) compatibility
-
-ONLY_FOR_PLATFORM= NetBSD-*-i386 NetBSD-*-m68k NetBSD-*-ns32k \
- NetBSD-*-sparc
-NO_SRC_ON_FTP= Already in MASTER_SITE_LOCAL
-
-NO_BUILD= yes
-NO_MTREE= yes
-CHECK_SHLIBS_SUPPORTED= no
-
-FILES_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR:Q}
-FILES_SUBST+= MACHINE_ARCH=${MACHINE_ARCH:Q}
-FILES_SUBST+= OBJECT_FMT=${OBJECT_FMT:Q}
-FILES_SUBST+= LDCONFIG=${LDCONFIG:Q}
-
-.include "../../mk/bsd.prefs.mk"
-
-# This installs in /usr (or /emul/aout/usr) to avoid dynamic linker annoyances
-.if ${OBJECT_FMT} == "ELF" && \
- (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "sparc")
-EMULSUBDIR= emul/aout
-COMPAT_LIBDIR= ${EMULSUBDIR}/usr/lib
-.elif ${OPSYS} == "NetBSD"
-LOCALBASE= /usr
-COMPAT_LIBDIR= lib
-.endif
+COMMENT= Shared libraries for NetBSD 1.2 compatibility
+
+EMUL_PLATFORMS= netbsd-i386 netbsd-m68k netbsd-ns32k netbsd-sparc
+
+ONLY_FOR_PLATFORM= NetBSD-1.2[A-Z]*-* NetBSD-1.[3-9]*-* \
+ NetBSD-[2-9]*-* NetBSD-[1-9][0-9]*-*
-PLIST_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR:Q}
+.include "../../emulators/compat_netbsd/Makefile.common"
-do-install:
- ${INSTALL_DATA_DIR} ${PREFIX}/${COMPAT_LIBDIR}
- ${INSTALL_DATA} ${WRKDIR}/lib*.so* ${PREFIX}/${COMPAT_LIBDIR}
+.if (${EMUL_PLATFORM} == "netbsd-ns32k")
+DISTNAME= compat12-${EMUL_ARCH}-1.2
+.else
+DISTNAME= compat12-${EMUL_ARCH}-1.2.1
+.endif
+
+# We need to depend on the compat13 package to supply shared libraries
+# missing from compat12 on NetBSD>1.3.
+#
+.if empty(OS_VERSION:M0.[0-9]*) && empty(OS_VERSION:M1.[0-2]*) && \
+ empty(OS_VERSION:M1.3) && empty(OS_VERSION:M1.3.*)
+DEPENDS+= compat13>=1.3:../../emulators/compat13
+.endif
.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/compat12/PLIST b/emulators/compat12/PLIST
deleted file mode 100644
index dbf2bf5e0e5..00000000000
--- a/emulators/compat12/PLIST
+++ /dev/null
@@ -1,5 +0,0 @@
-@comment $NetBSD: PLIST,v 1.1 2001/10/31 23:52:20 zuntum 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
diff --git a/emulators/compat12/PLIST.a.out b/emulators/compat12/PLIST.a.out
new file mode 100644
index 00000000000..cf0d0e35810
--- /dev/null
+++ b/emulators/compat12/PLIST.a.out
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST.a.out,v 1.1 2007/08/21 22:49:04 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libedit.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libg++.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libg++.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.3.2
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr
diff --git a/emulators/compat12/PLIST.i386 b/emulators/compat12/PLIST.i386
new file mode 100644
index 00000000000..fa3cdabe3cc
--- /dev/null
+++ b/emulators/compat12/PLIST.i386
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.i386,v 1.1 2007/08/21 22:49:04 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.2.0
diff --git a/emulators/compat12/PLIST.m68k b/emulators/compat12/PLIST.m68k
new file mode 100644
index 00000000000..37eb2228d0b
--- /dev/null
+++ b/emulators/compat12/PLIST.m68k
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST.m68k,v 1.1 2007/08/21 22:49:04 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.4.0
diff --git a/emulators/compat12/PLIST.ns32k b/emulators/compat12/PLIST.ns32k
new file mode 100644
index 00000000000..4d55f4260ac
--- /dev/null
+++ b/emulators/compat12/PLIST.ns32k
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.ns32k,v 1.1 2007/08/21 22:49:04 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.4.0
diff --git a/emulators/compat12/PLIST.sparc b/emulators/compat12/PLIST.sparc
new file mode 100644
index 00000000000..4fd75a9191b
--- /dev/null
+++ b/emulators/compat12/PLIST.sparc
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.sparc,v 1.1 2007/08/21 22:49:05 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.4.0
diff --git a/emulators/compat12/distinfo b/emulators/compat12/distinfo
index a0a1efa216f..e932d7558bd 100644
--- a/emulators/compat12/distinfo
+++ b/emulators/compat12/distinfo
@@ -1,14 +1,14 @@
-$NetBSD: distinfo,v 1.4 2005/10/23 14:32:06 rillig Exp $
+$NetBSD: distinfo,v 1.5 2007/08/21 22:49:05 jlam Exp $
-SHA1 (compat12-i386.tar.gz) = bce1f72c4fd9cdbe25a219a65ee0af7dd5257f16
-RMD160 (compat12-i386.tar.gz) = 63ea39032c6ea1a514aea0e80494d3910b31b33f
-Size (compat12-i386.tar.gz) = 285376 bytes
-SHA1 (compat12-m68k.tar.gz) = d319f63b47dbf28692796be296bbf7fcba2e5b4f
-RMD160 (compat12-m68k.tar.gz) = 55bb1555c20f617f950a917c2ebdf35ae5a7bcea
-Size (compat12-m68k.tar.gz) = 277202 bytes
-SHA1 (compat12-ns32k.tar.gz) = 66cb355f99369d2ce0a0e07c0f97593d57a5c2f1
-RMD160 (compat12-ns32k.tar.gz) = 688e2b2b812945861a289a8bc8459c7b1116bdee
-Size (compat12-ns32k.tar.gz) = 267367 bytes
-SHA1 (compat12-sparc.tar.gz) = 4af06ed70c66af5d676b292fe24dd0f945337916
-RMD160 (compat12-sparc.tar.gz) = e8e6d4a8b090e1f4bac9783ed49813bda70d52b7
-Size (compat12-sparc.tar.gz) = 298095 bytes
+SHA1 (compat12-i386-1.2.1.tar.bz2) = 84a9c002fc3a67f5a6eccbaee395f01980d562f8
+RMD160 (compat12-i386-1.2.1.tar.bz2) = 38c9d8dd303f6e8d14837cbc205bb5bbeb23449c
+Size (compat12-i386-1.2.1.tar.bz2) = 243236 bytes
+SHA1 (compat12-m68k-1.2.1.tar.bz2) = 0cccfcff8e7fea3177fa963afbed44aa16923cb0
+RMD160 (compat12-m68k-1.2.1.tar.bz2) = 1ca54e91cb4d0025d30e30ed1fe02438d82a6b82
+Size (compat12-m68k-1.2.1.tar.bz2) = 240457 bytes
+SHA1 (compat12-ns32k-1.2.tar.bz2) = dfcd0f03e554dec5622a4e1a12b27cdbf467714b
+RMD160 (compat12-ns32k-1.2.tar.bz2) = 3d0b27a62b825a297b9592730302f7492d94274e
+Size (compat12-ns32k-1.2.tar.bz2) = 235752 bytes
+SHA1 (compat12-sparc-1.2.1.tar.bz2) = fe9b7b34b71332cdf1cf7a86f10ea1ce7be015b6
+RMD160 (compat12-sparc-1.2.1.tar.bz2) = d7d19aa0d5ed30185f16b4504474a82183f3a40a
+Size (compat12-sparc-1.2.1.tar.bz2) = 255268 bytes
diff --git a/emulators/compat12/emulator.mk b/emulators/compat12/emulator.mk
new file mode 100644
index 00000000000..e94e38bfcdb
--- /dev/null
+++ b/emulators/compat12/emulator.mk
@@ -0,0 +1,51 @@
+# $NetBSD: emulator.mk,v 1.1 2007/08/21 22:49:05 jlam Exp $
+#
+# This file is included by netbsd-compat.mk in the emulator framework.
+#
+# Variables set by this file:
+#
+# EMUL_DISTRO
+# The NetBSD distribution used to provide the files.
+#
+# EMUL_EXEC_FMT
+# The executable format of the emulated operating system.
+#
+# EMULSUBDIR
+# Path relative to ${PREFIX} where the files and directories are
+# located, e.g. emul/aout.
+#
+# OPSYS_EMULDIR
+# Path through which the platform expects to find a "chroot"
+# installation of the files and directories, e.g. /emul/aout.
+#
+# DEPENDS_${EMUL_DISTRO}.*
+# A table that maps "modules" to NetBSD package dependencies.
+#
+
+EMUL_DISTRO= netbsd-1.2
+
+# i386 and sparc switched from a.out to ELF post-1.4.
+# arm, m68k and vax switched from a.out to ELF post-1.5.
+# ns32k never switched from a.out.
+#
+.if (${EMUL_ARCH} == "arm") || (${EMUL_ARCH} == "i386") || \
+ (${EMUL_ARCH} == "m68k") || (${EMUL_ARCH} == "ns32k") || \
+ (${EMUL_ARCH} == "sparc") || (${EMUL_ARCH} == "vax")
+EMUL_EXEC_FMT= a.out
+.else
+EMUL_EXEC_FMT= ELF
+.endif
+
+.if (${NATIVE_EXEC_FMT} == "ELF") && (${EMUL_EXEC_FMT} == "a.out")
+EMULSUBDIR= emul/aout
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.aout}
+.else
+EMULSUBDIR= emul/netbsd
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.netbsd}
+.endif
+
+# We need a dependency only for NetBSD>=1.3.
+.if empty(OS_VERSION:M0.[0-9]*) && empty(OS_VERSION:M1.[0-1]*) && \
+ empty(OS_VERSION:M1.2) && empty(OS_VERSION:M1.2.*)
+DEPENDS_netbsd-1.2.base?= compat12>=1.2:../../emulators/compat12
+.endif
diff --git a/emulators/compat13/DEINSTALL b/emulators/compat13/DEINSTALL
deleted file mode 100644
index 71e6814ac9d..00000000000
--- a/emulators/compat13/DEINSTALL
+++ /dev/null
@@ -1,21 +0,0 @@
-# $NetBSD: DEINSTALL,v 1.2 2003/08/30 18:57:03 jlam Exp $
-
-case ${STAGE} in
-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}
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/compat13/DESCR b/emulators/compat13/DESCR
index 555ddc7bf08..94bb0fab95c 100644
--- a/emulators/compat13/DESCR
+++ b/emulators/compat13/DESCR
@@ -1,4 +1,2 @@
-This package supplies the user files necessary for full compatibility with
-dynamically linked executables compiled under NetBSD 1.3. You still need
-the option COMPAT_13 in your kernel configuration (and probably others;
-see options(4) for more information) to make use of NetBSD 1.3 binaries.
+This package supplies the user files needed to run dynamically linked
+executables compiled under NetBSD 1.3.
diff --git a/emulators/compat13/INSTALL b/emulators/compat13/INSTALL
deleted file mode 100644
index f3e467cb325..00000000000
--- a/emulators/compat13/INSTALL
+++ /dev/null
@@ -1,55 +0,0 @@
-# $NetBSD: INSTALL,v 1.2 2003/08/30 18:57:03 jlam Exp $
-
-case ${STAGE} in
-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 [ "${OBJECT_FMT}" = "ELF" ] && \
- [ "${MACHINE_ARCH}" = "i386" -o "${MACHINE_ARCH}" = "sparc" ]
- 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
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/compat13/MESSAGE b/emulators/compat13/MESSAGE
new file mode 100644
index 00000000000..12089785dc3
--- /dev/null
+++ b/emulators/compat13/MESSAGE
@@ -0,0 +1,7 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2007/08/21 22:49:06 jlam Exp $
+
+The COMPAT_13 option must be included in the kernel configuration (and
+possibly others; see options(4) for more information) to make use of
+NetBSD 1.3 binaries.
+===========================================================================
diff --git a/emulators/compat13/Makefile b/emulators/compat13/Makefile
index b9684342741..9fa24679568 100644
--- a/emulators/compat13/Makefile
+++ b/emulators/compat13/Makefile
@@ -1,53 +1,32 @@
-# $NetBSD: Makefile,v 1.28 2006/10/19 19:37:38 wiz Exp $
-#
+# $NetBSD: Makefile,v 1.29 2007/08/21 22:49:06 jlam Exp $
-DISTNAME= compat13-${MACHINE_ARCH}${PKGMINOR}
-PKGNAME= compat13-1.3.3
-PKGREVISION= 2
-CATEGORIES= emulators
-MASTER_SITES= ${MASTER_SITE_LOCAL}
+DISTNAME= compat13 # overridden below
+NETBSD_VERSION= 1.3
+PKGREVISION= 3
-MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.NetBSD.org/Releases/formal-1.3/index.html
-COMMENT= Shared libraries for NetBSD 1.3 (and earlier) compatibility
-
-ONLY_FOR_PLATFORM= NetBSD-*-alpha NetBSD-*-arm NetBSD-*-arm32 \
- NetBSD-*-i386 NetBSD-*-m68k NetBSD-*-mipsel \
- NetBSD-*-ns32k NetBSD-*-sparc
-NOT_FOR_PLATFORM= NetBSD-1.3*-*
-NO_SRC_ON_FTP= Already in MASTER_SITE_LOCAL
-
-NO_MTREE= yes
-NO_BUILD= yes
-CHECK_SHLIBS_SUPPORTED= no
-
-FILES_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR:Q}
-FILES_SUBST+= MACHINE_ARCH=${MACHINE_ARCH:Q}
-FILES_SUBST+= OBJECT_FMT=${OBJECT_FMT:Q}
-FILES_SUBST+= LDCONFIG=${LDCONFIG:Q}
-
-.include "../../mk/bsd.prefs.mk"
-
-# This installs in /usr (or /emul/aout/usr) to avoid dynamic linker annoyances
-.if ${OBJECT_FMT} == "ELF" && \
- (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "sparc")
-EMULSUBDIR= emul/aout
-COMPAT_LIBDIR= ${EMULSUBDIR}/usr/lib
-.elif ${OPSYS} == "NetBSD"
-LOCALBASE= /usr
-COMPAT_LIBDIR= lib
-.endif
+COMMENT= Shared libraries for NetBSD 1.3 compatibility
+
+EMUL_PLATFORMS= netbsd-alpha netbsd-arm netbsd-i386 netbsd-m68k \
+ netbsd-mipsel netbsd-ns32k netbsd-sparc
+
+ONLY_FOR_PLATFORM= NetBSD-1.3[A-Z]*-* NetBSD-1.[4-9]*-* \
+ NetBSD-[2-9]*-* NetBSD-[1-9][0-9]*-*
-.if ${MACHINE_ARCH} == "alpha"
-PKGMINOR= nb1
+.include "../../emulators/compat_netbsd/Makefile.common"
+
+.if (${EMUL_PLATFORM} == "netbsd-arm")
+DISTNAME= compat13-${EMUL_ARCH}-1.3.2
.else
-PKGMINOR=
+DISTNAME= compat13-${EMUL_ARCH}-1.3.3
.endif
-PLIST_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR:Q}
-
-do-install:
- ${INSTALL_DATA_DIR} ${PREFIX}/${COMPAT_LIBDIR}
- ${INSTALL_DATA} ${WRKDIR}/lib*.so* ${PREFIX}/${COMPAT_LIBDIR}
+# We need to depend on the compat14 package to supply shared libraries
+# missing from compat13 on NetBSD>1.4.
+#
+.if empty(OS_VERSION:M0.[0-9]*) && empty(OS_VERSION:M1.[0-3]*) && \
+ empty(OS_VERSION:M1.4) && empty(OS_VERSION:M1.4.*)
+DEPENDS+= compat14>=1.4:../../emulators/compat14
+.endif
.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/compat13/PLIST b/emulators/compat13/PLIST
deleted file mode 100644
index f474e8dee17..00000000000
--- a/emulators/compat13/PLIST
+++ /dev/null
@@ -1,5 +0,0 @@
-@comment $NetBSD: PLIST,v 1.1 2001/10/31 23:52:25 zuntum 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
diff --git a/emulators/compat13/PLIST.ELF b/emulators/compat13/PLIST.ELF
new file mode 100644
index 00000000000..5e59b3a4c0c
--- /dev/null
+++ b/emulators/compat13/PLIST.ELF
@@ -0,0 +1,15 @@
+@comment $NetBSD: PLIST.ELF,v 1.1 2007/08/21 22:49:06 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libamu.so.0
+${EMULSUBDIRSLASH}usr/lib/libamu.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.0
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libedit.so.1
+${EMULSUBDIRSLASH}usr/lib/libedit.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libg++.so.4
+${EMULSUBDIRSLASH}usr/lib/libg++.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libutil.so.4
+${EMULSUBDIRSLASH}usr/lib/libutil.so.4.2
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr
diff --git a/emulators/compat13/PLIST.a.out b/emulators/compat13/PLIST.a.out
new file mode 100644
index 00000000000..cbb260e2b64
--- /dev/null
+++ b/emulators/compat13/PLIST.a.out
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.a.out,v 1.1 2007/08/21 22:49:06 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libamu.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libedit.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libg++.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libutil.so.4.2
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr
diff --git a/emulators/compat13/PLIST.alpha b/emulators/compat13/PLIST.alpha
deleted file mode 100644
index a26f534715f..00000000000
--- a/emulators/compat13/PLIST.alpha
+++ /dev/null
@@ -1,3 +0,0 @@
-@comment $NetBSD: PLIST.alpha,v 1.1 2001/10/31 23:55:50 zuntum Exp $
-${COMPAT_LIBDIR}/libcurses.so.2.1
-${COMPAT_LIBDIR}/libcurses.so.2
diff --git a/emulators/compat13/PLIST.i386 b/emulators/compat13/PLIST.i386
new file mode 100644
index 00000000000..3a0c1f12ed9
--- /dev/null
+++ b/emulators/compat13/PLIST.i386
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST.i386,v 1.1 2007/08/21 22:49:07 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.4.0
diff --git a/emulators/compat13/PLIST.m68k b/emulators/compat13/PLIST.m68k
new file mode 100644
index 00000000000..acd4151bc8b
--- /dev/null
+++ b/emulators/compat13/PLIST.m68k
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.m68k,v 1.1 2007/08/21 22:49:07 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.0.0
diff --git a/emulators/compat13/PLIST.mipsel b/emulators/compat13/PLIST.mipsel
new file mode 100644
index 00000000000..b1ff70ee988
--- /dev/null
+++ b/emulators/compat13/PLIST.mipsel
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST.mipsel,v 1.1 2007/08/21 22:49:07 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.4
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.4.0
diff --git a/emulators/compat13/PLIST.sparc b/emulators/compat13/PLIST.sparc
new file mode 100644
index 00000000000..dabaabef6cb
--- /dev/null
+++ b/emulators/compat13/PLIST.sparc
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.sparc,v 1.1 2007/08/21 22:49:07 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.0.0
diff --git a/emulators/compat13/distinfo b/emulators/compat13/distinfo
index b4547cb8c32..127657ab272 100644
--- a/emulators/compat13/distinfo
+++ b/emulators/compat13/distinfo
@@ -1,26 +1,23 @@
-$NetBSD: distinfo,v 1.6 2006/05/11 18:58:40 veego Exp $
+$NetBSD: distinfo,v 1.7 2007/08/21 22:49:07 jlam Exp $
-SHA1 (compat13-alphanb1.tar.gz) = 4e1fc306eb880dc3ba8a0906406da082fd6e6ca5
-RMD160 (compat13-alphanb1.tar.gz) = c09fa92bdef88fe7e5dd5ca28dfe13d0e045b840
-Size (compat13-alphanb1.tar.gz) = 478199 bytes
-SHA1 (compat13-arm.tar.gz) = 0dcae05d5ec15968665a71ab0a058f3b2a3d2f87
-RMD160 (compat13-arm.tar.gz) = 28232358015d5ab0a06ad0b5a7600426223d58b6
-Size (compat13-arm.tar.gz) = 247143 bytes
-SHA1 (compat13-arm32.tar.gz) = 0dcae05d5ec15968665a71ab0a058f3b2a3d2f87
-RMD160 (compat13-arm32.tar.gz) = 28232358015d5ab0a06ad0b5a7600426223d58b6
-Size (compat13-arm32.tar.gz) = 247143 bytes
-SHA1 (compat13-i386.tar.gz) = 4a33dd2381e790e3e71fccf4bb9f65a7d0859b9a
-RMD160 (compat13-i386.tar.gz) = e50d869813cd19bb079d8457a5b9f8e521b9e94e
-Size (compat13-i386.tar.gz) = 236494 bytes
-SHA1 (compat13-m68k.tar.gz) = a438a2d5f11106e431a8bba3061727069c5ec360
-RMD160 (compat13-m68k.tar.gz) = 6069d3e7790510eb7b6a3e543f670c9d3ecc89a2
-Size (compat13-m68k.tar.gz) = 231047 bytes
-SHA1 (compat13-mipsel.tar.gz) = 6dc5fefcd47db2d967b250ec628ac00495c35117
-RMD160 (compat13-mipsel.tar.gz) = 37b3e542dc407b21eb536effc64dd127a51a6d66
-Size (compat13-mipsel.tar.gz) = 411250 bytes
-SHA1 (compat13-ns32k.tar.gz) = 98068ed599e6ac2e79ea3ce1b7fb3df4510fc171
-RMD160 (compat13-ns32k.tar.gz) = f9f101da7df71bff97376a8aa4c0635450650f53
-Size (compat13-ns32k.tar.gz) = 223997 bytes
-SHA1 (compat13-sparc.tar.gz) = 67797480c5828792b434c5b06ab1ea02be3ad6b5
-RMD160 (compat13-sparc.tar.gz) = 0dbe2059a89039b20648bf6ca56e4df65ff66524
-Size (compat13-sparc.tar.gz) = 244099 bytes
+SHA1 (compat13-alpha-1.3.3.tar.bz2) = 86fe2ff55a7328f57937e23fe7bac0172409e34a
+RMD160 (compat13-alpha-1.3.3.tar.bz2) = 92d82b602c89abe22297330cb464fce7df543b32
+Size (compat13-alpha-1.3.3.tar.bz2) = 613383 bytes
+SHA1 (compat13-arm-1.3.2.tar.bz2) = cd36b50172be875f52e3217fd9620a56c8d2a4ab
+RMD160 (compat13-arm-1.3.2.tar.bz2) = 8d3e149d855586b604d141d01d5f98c740ba5a89
+Size (compat13-arm-1.3.2.tar.bz2) = 228628 bytes
+SHA1 (compat13-i386-1.3.3.tar.bz2) = 63d3d11db6336fb53483cc5944145c4e4591218c
+RMD160 (compat13-i386-1.3.3.tar.bz2) = a449a828a92a74fb61972f43c42caace5e798aa6
+Size (compat13-i386-1.3.3.tar.bz2) = 331383 bytes
+SHA1 (compat13-m68k-1.3.3.tar.bz2) = 85086dda93e1b7b03218f62ed98e56d61b166279
+RMD160 (compat13-m68k-1.3.3.tar.bz2) = a788e1901f5ee7f3c525910960088737b911d946
+Size (compat13-m68k-1.3.3.tar.bz2) = 345858 bytes
+SHA1 (compat13-mipsel-1.3.3.tar.bz2) = c50530683d6f0c0a11480325c355f90071865faf
+RMD160 (compat13-mipsel-1.3.3.tar.bz2) = 6aab300b2dc90f32138c38637366c5ff0f9f0cc6
+Size (compat13-mipsel-1.3.3.tar.bz2) = 598916 bytes
+SHA1 (compat13-ns32k-1.3.3.tar.bz2) = f0138bb3d0d97f0b0e288ae244a8741d2c2c02b9
+RMD160 (compat13-ns32k-1.3.3.tar.bz2) = 603ba24e38200adf2ef5b5bd1e7ed037c75f1912
+Size (compat13-ns32k-1.3.3.tar.bz2) = 313797 bytes
+SHA1 (compat13-sparc-1.3.3.tar.bz2) = 66281f29e50ce98091c8262fc25f86a6f42a5642
+RMD160 (compat13-sparc-1.3.3.tar.bz2) = fbd3731cd6155c8a125340a7233ea114b95550ec
+Size (compat13-sparc-1.3.3.tar.bz2) = 380197 bytes
diff --git a/emulators/compat13/emulator.mk b/emulators/compat13/emulator.mk
new file mode 100644
index 00000000000..7a5dc8f8f57
--- /dev/null
+++ b/emulators/compat13/emulator.mk
@@ -0,0 +1,47 @@
+# $NetBSD: emulator.mk,v 1.1 2007/08/21 22:49:07 jlam Exp $
+#
+# This file is included by netbsd-compat.mk in the emulator framework.
+#
+# Variables set by this file:
+#
+# EMUL_DISTRO
+# The NetBSD distribution used to provide the files.
+#
+# EMUL_EXEC_FMT
+# The executable format of the emulated operating system.
+#
+# EMULSUBDIR
+# Path relative to ${PREFIX} where the files and directories are
+# located, e.g. emul/aout.
+#
+# DEPENDS_${EMUL_DISTRO}.*
+# A table that maps "modules" to NetBSD package dependencies.
+#
+
+EMUL_DISTRO= netbsd-1.3
+
+# i386 and sparc switched from a.out to ELF post-1.4.
+# arm, m68k and vax switched from a.out to ELF post-1.5.
+# ns32k never switched from a.out.
+#
+.if (${EMUL_ARCH} == "arm") || (${EMUL_ARCH} == "i386") || \
+ (${EMUL_ARCH} == "m68k") || (${EMUL_ARCH} == "ns32k") || \
+ (${EMUL_ARCH} == "sparc") || (${EMUL_ARCH} == "vax")
+EMUL_EXEC_FMT= a.out
+.else
+EMUL_EXEC_FMT= ELF
+.endif
+
+.if (${NATIVE_EXEC_FMT} == "ELF") && (${EMUL_EXEC_FMT} == "a.out")
+EMULSUBDIR= emul/aout
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.aout}
+.else
+EMULSUBDIR= emul/netbsd
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.netbsd}
+.endif
+
+# We need a dependency only for NetBSD>1.3.x.
+.if empty(OS_VERSION:M0.[0-9]*) && empty(OS_VERSION:M1.[0-2]*) && \
+ empty(OS_VERSION:M1.3) && empty(OS_VERSION:M1.3.*)
+DEPENDS_netbsd-1.3.base?= compat13>=1.3:../../emulators/compat13
+.endif
diff --git a/emulators/compat14/DEINSTALL b/emulators/compat14/DEINSTALL
deleted file mode 100644
index a836e07aaf7..00000000000
--- a/emulators/compat14/DEINSTALL
+++ /dev/null
@@ -1,22 +0,0 @@
-# $NetBSD: DEINSTALL,v 1.2 2003/08/30 19:02:33 jlam Exp $
-
-case ${STAGE} in
-POST-DEINSTALL)
- MACHINE_ARCH=@MACHINE_ARCH@
- COMPAT_LIBDIR=@COMPAT_LIBDIR@
- COMPAT_XLIBDIR=@COMPAT_XLIBDIR@
-
- 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} ${PKG_PREFIX}/${COMPAT_XLIBDIR} 2>/dev/null || ${TRUE}
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/compat14/DESCR b/emulators/compat14/DESCR
index 6bfe6baf113..330e1b5bf60 100644
--- a/emulators/compat14/DESCR
+++ b/emulators/compat14/DESCR
@@ -1,5 +1,2 @@
-This package supplies the user files necessary for full compatibility with
-dynamically linked executables compiled under NetBSD 1.4. You still need
-the option COMPAT_14 in your kernel configuration (and probably others;
-see options(4) for more information) to make use of NetBSD 1.4 binaries.
-This package includes the crypto-enabled "domestic" set libraries.
+This package supplies the user files needed to run dynamically linked
+executables compiled under NetBSD 1.4.
diff --git a/emulators/compat14/INSTALL b/emulators/compat14/INSTALL
deleted file mode 100644
index b37ac594721..00000000000
--- a/emulators/compat14/INSTALL
+++ /dev/null
@@ -1,56 +0,0 @@
-# $NetBSD: INSTALL,v 1.2 2003/08/30 19:02:33 jlam Exp $
-
-case ${STAGE} in
-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. Note
- # that sparc64 a.out compatibility lives in /emul/aout, not /emul/netbsd32.
- #
- create_emul_symlink=0
- if [ "${OBJECT_FMT}" = "ELF" ] && \
- [ "${MACHINE_ARCH}" = "i386" -o "${MACHINE_ARCH}" = "sparc" ]
- then
- create_emul_symlink=1
- fi
-
- if [ ${create_emul_symlink} = 1 ]
- then
- # Create a symlink from /emul/aout --> ${PKG_PREFIX}/emul/aout
- # 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
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/compat14/MESSAGE b/emulators/compat14/MESSAGE
new file mode 100644
index 00000000000..366b0eafc44
--- /dev/null
+++ b/emulators/compat14/MESSAGE
@@ -0,0 +1,7 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2007/08/21 22:49:08 jlam Exp $
+
+The COMPAT_14 option must be included in the kernel configuration (and
+possibly others; see options(4) for more information) to make use of
+NetBSD 1.4 binaries.
+===========================================================================
diff --git a/emulators/compat14/Makefile b/emulators/compat14/Makefile
index 04b5fae2e79..444ba0c931b 100644
--- a/emulators/compat14/Makefile
+++ b/emulators/compat14/Makefile
@@ -1,59 +1,53 @@
-# $NetBSD: Makefile,v 1.20 2007/08/16 14:00:12 jlam Exp $
-#
-
-DISTNAME= compat14-crypto-${MACHINE_ARCH}-${VERSION}
-PKGNAME= compat14-${VERSION}
-PKGREVISION= 1
-CATEGORIES= emulators
-MASTER_SITES= ${MASTER_SITE_LOCAL}
+# $NetBSD: Makefile,v 1.21 2007/08/21 22:49:08 jlam Exp $
-MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= http://www.NetBSD.org/Releases/formal-1.4/index.html
-COMMENT= Shared libraries for NetBSD 1.4 (and earlier) compatibility
+DISTNAME= compat14 # overridden below
+NETBSD_VERSION= 1.4
+PKGREVISION= 2
-VERSION= 1.4.3.1
+CONFLICTS= compat14-crypto-[0-9]*
-CONFLICTS= compat14-[0-9]*
+HOMEPAGE= http://www.NetBSD.org/Releases/formal-1.4/index.html
+COMMENT= Shared libraries for NetBSD 1.4 compatibility
-ONLY_FOR_PLATFORM= NetBSD-*-sparc NetBSD-*-i386
-NOT_FOR_PLATFORM= NetBSD-1.3*-* NetBSD-1.4*-*
-NO_SRC_ON_FTP= Already in MASTER_SITE_LOCAL
+EMUL_PLATFORMS= netbsd-alpha netbsd-arm netbsd-i386 netbsd-m68k \
+ netbsd-mipsel netbsd-ns32k netbsd-powerpc \
+ netbsd-sparc netbsd-vax
-CRYPTO= YES
+ONLY_FOR_PLATFORM= NetBSD-1.4[A-Z]*-* NetBSD-1.[5-9]*-* \
+ NetBSD-[2-9]*-* NetBSD-[1-9][0-9]*-*
-CHECK_SHLIBS_SUPPORTED= no
-BUILD_DIRS= # empty
+.include "../../emulators/compat_netbsd/Makefile.common"
-FILES_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR:Q}
-FILES_SUBST+= COMPAT_XLIBDIR=${COMPAT_XLIBDIR:Q}
-FILES_SUBST+= MACHINE_ARCH=${MACHINE_ARCH:Q}
-FILES_SUBST+= OBJECT_FMT=${OBJECT_FMT:Q}
-FILES_SUBST+= LDCONFIG=${LDCONFIG:Q}
+.if (${EMUL_PLATFORM} == "netbsd-ns32k")
+DISTNAME= compat14-${EMUL_ARCH}-1.4.2
+.elif (${EMUL_PLATFORM} == "netbsd-i386") || \
+ (${EMUL_PLATFORM} == "netbsd-sparc")
+DISTNAME= compat14-${EMUL_ARCH}-1.4.3.1
+.else
+DISTNAME= compat14-${EMUL_ARCH}-1.4.3
+.endif
-.include "../../mk/bsd.prefs.mk"
+# For COMPAT_NETBSD32, we need to depend on the compat15 package to supply
+# /usr/libexec/ld.so (either directly or indirectly) so that the a.out
+# shared libraries can be used.
+#
+.if ((${EMUL_ARCH} == "i386") && (${MACHINE_ARCH} == "x86_64")) || \
+ ((${EMUL_ARCH} == "sparc") && (${MACHINE_ARCH} == "sparc64"))
+DEPENDS+= netbsd32_compat15>=1.5:../../emulators/netbsd32_compat15
-# This installs in /usr (or /emul/aout/usr) to avoid dynamic linker annoyances
-.if ${OBJECT_FMT} == "ELF" && \
- (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "sparc")
-EMULSUBDIR= emul/aout
-COMPAT_LIBDIR= ${EMULSUBDIR}/usr/lib
-COMPAT_XLIBDIR= ${EMULSUBDIR}/usr/X11R6/lib
-.elif ${OPSYS} == "NetBSD"
-LOCALBASE= /usr
-COMPAT_LIBDIR= lib
-COMPAT_XLIBDIR= X11R6/lib
+# i386 and sparc switched from a.out to ELF after NetBSD-1.4, and
+# they don't need any other packages to supply missing a.out shared
+# libraries.
+#
+.elif (${EMUL_ARCH} == "i386") || (${EMUL_ARCH} == "sparc")
+#DEPENDS+= # no additional dependencies
+#
+# We need to depend on the compat15 package to supply shared libraries
+# missing from compat14 on NetBSD>1.5.
+#
+.elif empty(OS_VERSION:M0.[0-9]*) && empty(OS_VERSION:M1.[0-4]*) && \
+ empty(OS_VERSION:M1.5) && empty(OS_VERSION:M1.5.*)
+DEPENDS+= compat15>=1.5:../../emulators/compat15
.endif
-PLIST_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR:Q} COMPAT_XLIBDIR=${COMPAT_XLIBDIR:Q}
-
-# note that the INSTALL_DATA for the lib*.so symlinks will copy the file, not the symlink.
-# FIXME.
-do-install:
- ${INSTALL_DATA_DIR} ${PREFIX}/${COMPAT_LIBDIR}
- ${INSTALL_DATA} ${WRKDIR}/lib/lib*.so* ${PREFIX}/${COMPAT_LIBDIR}
- if [ -d ${WRKDIR}/X11R6/lib ]; then \
- ${INSTALL_DATA_DIR} ${PREFIX}/${COMPAT_XLIBDIR}; \
- ${INSTALL_DATA} ${WRKDIR}/X11R6/lib/lib*.so* ${PREFIX}/${COMPAT_XLIBDIR}; \
- fi
-
.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/compat14/PLIST b/emulators/compat14/PLIST
deleted file mode 100644
index 8625bf3ae25..00000000000
--- a/emulators/compat14/PLIST
+++ /dev/null
@@ -1,48 +0,0 @@
-@comment $NetBSD: PLIST,v 1.2 2007/08/16 14:00:12 jlam Exp $
-${COMPAT_LIBDIR}/libacl.so.2.0
-${COMPAT_LIBDIR}/libamu.so.1.1
-${COMPAT_LIBDIR}/libbfd.so.3.0
-${COMPAT_LIBDIR}/libbz2.so.0.0
-${COMPAT_LIBDIR}/libc.so.12.40.2
-${COMPAT_LIBDIR}/libcom_err.so.2.0
-${COMPAT_LIBDIR}/libcrypt.so.0.0
-${COMPAT_LIBDIR}/libcurses.so.2.2
-${COMPAT_LIBDIR}/libdes.so.2.0
-${COMPAT_LIBDIR}/libedit.so.2.2
-${COMPAT_LIBDIR}/libg2c.so.0.0
-${COMPAT_LIBDIR}/libgnumalloc.so.0.0
-${COMPAT_LIBDIR}/libkadm.so.2.0
-${COMPAT_LIBDIR}/libkafs.so.3.0
-${COMPAT_LIBDIR}/libkdb.so.2.0
-${COMPAT_LIBDIR}/libkrb.so.2.0
-${COMPAT_LIBDIR}/libkstream.so.0.0
-${COMPAT_LIBDIR}/libkvm.so.5.0
-${COMPAT_LIBDIR}/libm.so.0.1
-${COMPAT_LIBDIR}/libntp.so.0.0
-${COMPAT_LIBDIR}/libobjc.so.0.0
-${COMPAT_LIBDIR}/libossaudio.so.0.0
-${COMPAT_LIBDIR}/libpcap.so.0.0
-${COMPAT_LIBDIR}/libposix.so.0.1
-${COMPAT_LIBDIR}/libresolv.so.1.0
-${COMPAT_LIBDIR}/libskey.so.0.0
-${COMPAT_LIBDIR}/libss.so.2.0
-${COMPAT_LIBDIR}/libstdc++.so.2.0
-${COMPAT_LIBDIR}/libtelnet.so.1.0
-${COMPAT_LIBDIR}/libtermcap.so.0.0
-${COMPAT_LIBDIR}/libtermlib.so.0.0
-${COMPAT_LIBDIR}/libutil.so.5.0
-${COMPAT_LIBDIR}/libwrap.so.0.0
-${COMPAT_LIBDIR}/libz.so.0.1
-${COMPAT_XLIBDIR}/libICE.so.6.3
-${COMPAT_XLIBDIR}/libPEX5.so.6.0
-${COMPAT_XLIBDIR}/libSM.so.6.0
-${COMPAT_XLIBDIR}/libX11.so.6.1
-${COMPAT_XLIBDIR}/libXIE.so.6.0
-${COMPAT_XLIBDIR}/libXaw.so.6.1
-${COMPAT_XLIBDIR}/libXext.so.6.3
-${COMPAT_XLIBDIR}/libXi.so.6.0
-${COMPAT_XLIBDIR}/libXmu.so.6.0
-${COMPAT_XLIBDIR}/libXp.so.6.2
-${COMPAT_XLIBDIR}/libXt.so.6.0
-${COMPAT_XLIBDIR}/libXtst.so.6.1
-${COMPAT_XLIBDIR}/liboldX.so.6.0
diff --git a/emulators/compat14/PLIST.ELF b/emulators/compat14/PLIST.ELF
new file mode 100644
index 00000000000..d6f8637ff51
--- /dev/null
+++ b/emulators/compat14/PLIST.ELF
@@ -0,0 +1,15 @@
+@comment $NetBSD: PLIST.ELF,v 1.1 2007/08/21 22:49:09 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.3
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.2
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.2.2
+${EMULSUBDIRSLASH}usr/lib/libntp.so.0
+${EMULSUBDIRSLASH}usr/lib/libntp.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.0
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libskey.so.0
+${EMULSUBDIRSLASH}usr/lib/libskey.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libtelnet.so.1
+${EMULSUBDIRSLASH}usr/lib/libtelnet.so.1.0
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr
diff --git a/emulators/compat14/PLIST.a.out b/emulators/compat14/PLIST.a.out
new file mode 100644
index 00000000000..63dd73326dd
--- /dev/null
+++ b/emulators/compat14/PLIST.a.out
@@ -0,0 +1,9 @@
+@comment $NetBSD: PLIST.a.out,v 1.1 2007/08/21 22:49:09 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.2.2
+${EMULSUBDIRSLASH}usr/lib/libntp.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libskey.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libtelnet.so.1.0
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr
diff --git a/emulators/compat14/PLIST.alpha b/emulators/compat14/PLIST.alpha
new file mode 100644
index 00000000000..6015ed087dd
--- /dev/null
+++ b/emulators/compat14/PLIST.alpha
@@ -0,0 +1,22 @@
+@comment $NetBSD: PLIST.alpha,v 1.1 2007/08/21 22:49:09 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libacl.so
+${EMULSUBDIRSLASH}usr/lib/libacl.so.2
+${EMULSUBDIRSLASH}usr/lib/libacl.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.2
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libdes.so.2
+${EMULSUBDIRSLASH}usr/lib/libdes.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.2
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.3
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.2
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.2
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.0
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libntp.so
+${EMULSUBDIRSLASH}usr/lib/libss.so.2
+${EMULSUBDIRSLASH}usr/lib/libss.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libtelnet.so
diff --git a/emulators/compat14/PLIST.arm b/emulators/compat14/PLIST.arm
new file mode 100644
index 00000000000..8034ab7e26c
--- /dev/null
+++ b/emulators/compat14/PLIST.arm
@@ -0,0 +1,10 @@
+@comment $NetBSD: PLIST.arm,v 1.1 2007/08/21 22:49:09 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libacl.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libdes.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libss.so.2.0
diff --git a/emulators/compat14/PLIST.i386 b/emulators/compat14/PLIST.i386
index ce15faaf68d..33208fdf026 100644
--- a/emulators/compat14/PLIST.i386
+++ b/emulators/compat14/PLIST.i386
@@ -1,3 +1,37 @@
-@comment $NetBSD: PLIST.i386,v 1.1 2001/10/31 23:56:39 zuntum Exp $
-${COMPAT_LIBDIR}/libi386.so.0.2
-${COMPAT_LIBDIR}/libkeycap.so.0.0
+@comment $NetBSD: PLIST.i386,v 1.2 2007/08/21 22:49:09 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libamu.so.1.1
+${EMULSUBDIRSLASH}usr/lib/libbz2.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libc.so.12.40.2
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libedit.so.2.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libi386.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libkeycap.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libm.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libposix.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libresolv.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libwrap.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libz.so.0.1
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat14/PLIST.m68k b/emulators/compat14/PLIST.m68k
new file mode 100644
index 00000000000..40eccac611c
--- /dev/null
+++ b/emulators/compat14/PLIST.m68k
@@ -0,0 +1,10 @@
+@comment $NetBSD: PLIST.m68k,v 1.1 2007/08/21 22:49:09 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libacl.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libdes.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libss.so.2.0
diff --git a/emulators/compat14/PLIST.ns32k b/emulators/compat14/PLIST.ns32k
new file mode 100644
index 00000000000..e4ca08a9dce
--- /dev/null
+++ b/emulators/compat14/PLIST.ns32k
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.ns32k,v 1.1 2007/08/21 22:49:10 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5.0
diff --git a/emulators/compat14/PLIST.powerpc b/emulators/compat14/PLIST.powerpc
new file mode 100644
index 00000000000..f9ddcf39584
--- /dev/null
+++ b/emulators/compat14/PLIST.powerpc
@@ -0,0 +1,22 @@
+@comment $NetBSD: PLIST.powerpc,v 1.1 2007/08/21 22:49:10 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libacl.so
+${EMULSUBDIRSLASH}usr/lib/libacl.so.2
+${EMULSUBDIRSLASH}usr/lib/libacl.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.2
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libdes.so.2
+${EMULSUBDIRSLASH}usr/lib/libdes.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.2
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.3
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.2
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.2
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.0
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libntp.so
+${EMULSUBDIRSLASH}usr/lib/libss.so.2
+${EMULSUBDIRSLASH}usr/lib/libss.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libtelnet.so
diff --git a/emulators/compat14/PLIST.sparc b/emulators/compat14/PLIST.sparc
new file mode 100644
index 00000000000..e2c74e06440
--- /dev/null
+++ b/emulators/compat14/PLIST.sparc
@@ -0,0 +1,35 @@
+@comment $NetBSD: PLIST.sparc,v 1.1 2007/08/21 22:49:10 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libamu.so.1.1
+${EMULSUBDIRSLASH}usr/lib/libbz2.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libc.so.12.40.2
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libedit.so.2.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libm.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libposix.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libresolv.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libwrap.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libz.so.0.1
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat14/PLIST.vax b/emulators/compat14/PLIST.vax
new file mode 100644
index 00000000000..5b018a55171
--- /dev/null
+++ b/emulators/compat14/PLIST.vax
@@ -0,0 +1,10 @@
+@comment $NetBSD: PLIST.vax,v 1.1 2007/08/21 22:49:10 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libacl.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libdes.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libss.so.2.0
diff --git a/emulators/compat14/distinfo b/emulators/compat14/distinfo
index bdd73c3f04b..78e9f6ad899 100644
--- a/emulators/compat14/distinfo
+++ b/emulators/compat14/distinfo
@@ -1,8 +1,29 @@
-$NetBSD: distinfo,v 1.5 2007/08/16 14:00:12 jlam Exp $
+$NetBSD: distinfo,v 1.6 2007/08/21 22:49:10 jlam Exp $
-SHA1 (compat14-crypto-i386-1.4.3.1.tar.gz) = 2b35c35de47b8c0be42813cb6e56e154e98ebfd5
-RMD160 (compat14-crypto-i386-1.4.3.1.tar.gz) = 5a28f1c5218eccd925bba73b7c9a1a2d3fd6c2b8
-Size (compat14-crypto-i386-1.4.3.1.tar.gz) = 1729167 bytes
-SHA1 (compat14-crypto-sparc-1.4.3.1.tar.gz) = 41d5937f5e1f40193c6363a9978fe6373d43e679
-RMD160 (compat14-crypto-sparc-1.4.3.1.tar.gz) = bbe9bcbf05328cb9829d192ef6a0be1479b9cdbe
-Size (compat14-crypto-sparc-1.4.3.1.tar.gz) = 1921545 bytes
+SHA1 (compat14-alpha-1.4.3.tar.bz2) = bfe5677223ce346a9ef583ebaf27d41c03b0d577
+RMD160 (compat14-alpha-1.4.3.tar.bz2) = 9d10e1f6a18c0f0846758d80ae0108290d4de4a2
+Size (compat14-alpha-1.4.3.tar.bz2) = 469926 bytes
+SHA1 (compat14-arm-1.4.3.tar.bz2) = cf9f841972fba1fe48560cfdb1fc7b537e78ae7a
+RMD160 (compat14-arm-1.4.3.tar.bz2) = 36d467e1c736f69fc3a093a30c516e037826fcb5
+Size (compat14-arm-1.4.3.tar.bz2) = 261806 bytes
+SHA1 (compat14-i386-1.4.3.1.tar.bz2) = fca6b404fdf9eab8aad38dd1448ee0c346dcfe63
+RMD160 (compat14-i386-1.4.3.1.tar.bz2) = 3b1efa8a32c63b185ff23bbc667382ebd92d7c27
+Size (compat14-i386-1.4.3.1.tar.bz2) = 1625949 bytes
+SHA1 (compat14-m68k-1.4.3.tar.bz2) = d9df93aff85bcc24f82771424371c93447e55772
+RMD160 (compat14-m68k-1.4.3.tar.bz2) = 4cba150c156f515d136061f968d8179bce3a7cd0
+Size (compat14-m68k-1.4.3.tar.bz2) = 300752 bytes
+SHA1 (compat14-mipsel-1.4.3.tar.bz2) = cbd5a56df55c117287f8094419ad481ce5068d98
+RMD160 (compat14-mipsel-1.4.3.tar.bz2) = 9699bfefdb68e454f256435d9e4589d8ac134a09
+Size (compat14-mipsel-1.4.3.tar.bz2) = 359349 bytes
+SHA1 (compat14-ns32k-1.4.2.tar.bz2) = db5c562004e04430866c54e3f1af668e83b907c0
+RMD160 (compat14-ns32k-1.4.2.tar.bz2) = cbf09ecb80c69b9d2c46dfd87415a09ea940f73b
+Size (compat14-ns32k-1.4.2.tar.bz2) = 176515 bytes
+SHA1 (compat14-powerpc-1.4.3.tar.bz2) = 1916b8cbbc1532403c1b4792917fe2d0f1a4eab0
+RMD160 (compat14-powerpc-1.4.3.tar.bz2) = 0d840651e87541eabb855083f6471d7e1ec7d1a9
+Size (compat14-powerpc-1.4.3.tar.bz2) = 329221 bytes
+SHA1 (compat14-sparc-1.4.3.1.tar.bz2) = 957a5d6d9984e7fc88456fab6ba70284dd96f93c
+RMD160 (compat14-sparc-1.4.3.1.tar.bz2) = d2a4cf9a3a23578861ffb86b8b49312e92da0a90
+Size (compat14-sparc-1.4.3.1.tar.bz2) = 1761570 bytes
+SHA1 (compat14-vax-1.4.3.tar.bz2) = 7fdcc0a40e67d3e0039d2ab56f82a6c9a0d5c6cd
+RMD160 (compat14-vax-1.4.3.tar.bz2) = 72660922b00f791410462217afdf7c37b6b1581d
+Size (compat14-vax-1.4.3.tar.bz2) = 501646 bytes
diff --git a/emulators/compat14/emulator.mk b/emulators/compat14/emulator.mk
new file mode 100644
index 00000000000..ef52ba25cb0
--- /dev/null
+++ b/emulators/compat14/emulator.mk
@@ -0,0 +1,47 @@
+# $NetBSD: emulator.mk,v 1.1 2007/08/21 22:49:10 jlam Exp $
+#
+# This file is included by netbsd-compat.mk in the emulator framework.
+#
+# Variables set by this file:
+#
+# EMUL_DISTRO
+# The NetBSD distribution used to provide the files.
+#
+# EMUL_EXEC_FMT
+# The executable format of the emulated operating system.
+#
+# EMULSUBDIR
+# Path relative to ${PREFIX} where the files and directories are
+# located, e.g. emul/aout.
+#
+# DEPENDS_${EMUL_DISTRO}.*
+# A table that maps "modules" to NetBSD package dependencies.
+#
+
+EMUL_DISTRO= netbsd-1.4
+
+# i386 and sparc switched from a.out to ELF post-1.4.
+# arm, m68k and vax switched from a.out to ELF post-1.5.
+# ns32k never switched from a.out.
+#
+.if (${EMUL_ARCH} == "arm") || (${EMUL_ARCH} == "i386") || \
+ (${EMUL_ARCH} == "m68k") || (${EMUL_ARCH} == "ns32k") || \
+ (${EMUL_ARCH} == "sparc") || (${EMUL_ARCH} == "vax")
+EMUL_EXEC_FMT= a.out
+.else
+EMUL_EXEC_FMT= ELF
+.endif
+
+.if (${NATIVE_EXEC_FMT} == "ELF") && (${EMUL_EXEC_FMT} == "a.out")
+EMULSUBDIR= emul/aout
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.aout}
+.else
+EMULSUBDIR= emul/netbsd
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.netbsd}
+.endif
+
+# We need a dependency only for NetBSD>1.4.x.
+.if empty(OS_VERSION:M0.[0-9]*) && empty(OS_VERSION:M1.[0-3]*) && \
+ empty(OS_VERSION:M1.4) && empty(OS_VERSION:M1.4.*)
+DEPENDS_netbsd-1.4.base?= compat14>=1.4:../../emulators/compat14
+.endif
diff --git a/emulators/compat15-extras/DESCR b/emulators/compat15-extras/DESCR
new file mode 100644
index 00000000000..112909fe75e
--- /dev/null
+++ b/emulators/compat15-extras/DESCR
@@ -0,0 +1,4 @@
+This package supplies the extra user files needed to run dynamically
+linked executables compiled under NetBSD 1.5, including user files
+that might be found in NetBSD versions beyond 1.5 that are missing
+from the pkgsrc/emulators/compat15 package.
diff --git a/emulators/compat15-extras/Makefile b/emulators/compat15-extras/Makefile
new file mode 100644
index 00000000000..28c4335e16a
--- /dev/null
+++ b/emulators/compat15-extras/Makefile
@@ -0,0 +1,24 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:13 jlam Exp $
+
+DISTNAME= compat15-extras # overridden below
+NETBSD_VERSION= 1.5
+
+HOMEPAGE= http://www.NetBSD.org/Releases/formal-1.5/index.html
+COMMENT= Additional shared libraries for NetBSD 1.5 compatibility
+
+EMUL_PLATFORMS= netbsd-i386 netbsd-sparc
+
+.include "../../emulators/compat_netbsd/Makefile.common"
+
+DISTNAME= compat15-extras-${EMUL_ARCH}-1.5.3
+
+# This package should only be installed for COMPAT_NETBSD32 emulation
+# on machines running NetBSD-1.5.
+#
+.if defined(NETBSD_COMPAT32)
+ACCEPTABLE_NETBSD= NetBSD-1.4[A-Z]* NetBSD-1.5 NetBSD-1.5.*
+.else
+NOT_FOR_PLATFORM= NetBSD-*-${MACHINE_ARCH}
+.endif
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/compat15-extras/PLIST b/emulators/compat15-extras/PLIST
new file mode 100644
index 00000000000..004358454a4
--- /dev/null
+++ b/emulators/compat15-extras/PLIST
@@ -0,0 +1,62 @@
+@comment $NetBSD: PLIST,v 1.1 2007/08/21 22:49:14 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libc.so.12
+${EMULSUBDIRSLASH}usr/lib/libc.so.12.62.1
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so.0
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libedit.so.2
+${EMULSUBDIRSLASH}usr/lib/libedit.so.2.3
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so.0
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libipsec.so.2
+${EMULSUBDIRSLASH}usr/lib/libipsec.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5.1
+${EMULSUBDIRSLASH}usr/lib/libm.so.0
+${EMULSUBDIRSLASH}usr/lib/libm.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so.0
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.1
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.1.1
+${EMULSUBDIRSLASH}usr/lib/libposix.so.0
+${EMULSUBDIRSLASH}usr/lib/libposix.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libresolv.so.1
+${EMULSUBDIRSLASH}usr/lib/libresolv.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libskey.so.1
+${EMULSUBDIRSLASH}usr/lib/libskey.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so.0
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so.0.4
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so.0
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so.0.4
+${EMULSUBDIRSLASH}usr/lib/libwrap.so.0
+${EMULSUBDIRSLASH}usr/lib/libwrap.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libz.so.0
+${EMULSUBDIRSLASH}usr/lib/libz.so.0.2
+${EMULSUBDIRSLASH}usr/libexec/ld.elf_so
+${EMULSUBDIRSLASH}usr/libexec/ld.so
+@dirrm ${EMULSUBDIRSLASH}usr/libexec
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
+@dirrm ${EMULSUBDIRSLASH}usr
diff --git a/emulators/compat15-extras/PLIST.i386 b/emulators/compat15-extras/PLIST.i386
new file mode 100644
index 00000000000..c6f31bb8879
--- /dev/null
+++ b/emulators/compat15-extras/PLIST.i386
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST.i386,v 1.1 2007/08/21 22:49:14 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libi386.so
+${EMULSUBDIRSLASH}usr/lib/libi386.so.0
+${EMULSUBDIRSLASH}usr/lib/libi386.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libm387.so
+${EMULSUBDIRSLASH}usr/lib/libm387.so.0
+${EMULSUBDIRSLASH}usr/lib/libm387.so.0.0
diff --git a/emulators/compat15-extras/PLIST.sparc b/emulators/compat15-extras/PLIST.sparc
new file mode 100644
index 00000000000..fb915a81fb4
--- /dev/null
+++ b/emulators/compat15-extras/PLIST.sparc
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST.sparc,v 1.1 2007/08/21 22:49:14 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
diff --git a/emulators/compat15-extras/distinfo b/emulators/compat15-extras/distinfo
new file mode 100644
index 00000000000..bb8b775ffab
--- /dev/null
+++ b/emulators/compat15-extras/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2007/08/21 22:49:14 jlam Exp $
+
+SHA1 (compat15-extras-i386-1.5.3.tar.bz2) = 173494b4a4b8fd6d3092166d6a4c6584aff217ad
+RMD160 (compat15-extras-i386-1.5.3.tar.bz2) = 8451dd563e19a53a41a3788c8c35b2d75c038cfa
+Size (compat15-extras-i386-1.5.3.tar.bz2) = 1213791 bytes
+SHA1 (compat15-extras-sparc-1.5.3.tar.bz2) = 671d77c3ef09786643952b0b642abe4d7d0aa829
+RMD160 (compat15-extras-sparc-1.5.3.tar.bz2) = 8f6121486a493c57945d031601b951a39d7d7d47
+Size (compat15-extras-sparc-1.5.3.tar.bz2) = 1423867 bytes
diff --git a/emulators/compat15/DESCR b/emulators/compat15/DESCR
new file mode 100644
index 00000000000..1a241b83961
--- /dev/null
+++ b/emulators/compat15/DESCR
@@ -0,0 +1,2 @@
+This package supplies the user files needed to run dynamically linked
+executables compiled under NetBSD 1.5.
diff --git a/emulators/compat15/MESSAGE b/emulators/compat15/MESSAGE
new file mode 100644
index 00000000000..24b8a6fa101
--- /dev/null
+++ b/emulators/compat15/MESSAGE
@@ -0,0 +1,7 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2007/08/21 22:49:11 jlam Exp $
+
+The COMPAT_15 option must be included in the kernel configuration (and
+possibly others; see options(4) for more information) to make use of
+NetBSD 1.5 binaries.
+===========================================================================
diff --git a/emulators/compat15/Makefile b/emulators/compat15/Makefile
new file mode 100644
index 00000000000..e5cf8deae0a
--- /dev/null
+++ b/emulators/compat15/Makefile
@@ -0,0 +1,64 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:11 jlam Exp $
+
+DISTNAME= compat15 # overridden below
+NETBSD_VERSION= 1.5
+
+HOMEPAGE= http://www.NetBSD.org/Releases/formal-1.5/index.html
+COMMENT= Shared libraries for NetBSD 1.5 compatibility
+
+.if defined(NETBSD_COMPAT32)
+EMUL_PLATFORMS= netbsd-i386 netbsd-sparc
+
+ACCEPTABLE_NETBSD= NetBSD-1.4[A-Z]* NetBSD-1.5 NetBSD-1.5.* \
+ NetBSD-1.5[A-Z]* NetBSD-1.[6-9]* NetBSD-[2-9]* \
+ NetBSD-[1-9][0-9]*
+.else
+EMUL_PLATFORMS= netbsd-alpha netbsd-arm netbsd-i386 netbsd-m68k \
+ netbsd-mipsel netbsd-ns32k netbsd-powerpc \
+ netbsd-sparc netbsd-sparc64 netbsd-vax
+
+ONLY_FOR_PLATFORM= NetBSD-1.5[A-Z]*-* NetBSD-1.[6-9]*-* \
+ NetBSD-[2-9]*-* NetBSD-[1-9][0-9]*-*
+.endif
+
+.include "../../emulators/compat_netbsd/Makefile.common"
+
+.if (${EMUL_PLATFORM} == "netbsd-sparc64")
+DISTNAME= compat15-${EMUL_ARCH}-1.5.2
+.else
+DISTNAME= compat15-${EMUL_ARCH}-${COMPAT_VERSION}
+.endif
+COMPAT_VERSION= 1.5.3
+
+# For COMPAT_NETBSD32, we need to depend on the compat15-extras package
+# on NetBSD-1.5 to supply the missing shared libraries; otherwise, we
+# just depend on the compat16 for the missing shared libraries.
+#
+.if defined(NETBSD_COMPAT32)
+COMPAT_EXTRAS= # empty
+. for _netbsd_ in ${ACCEPTABLE_NETBSD}
+COMPAT_EXTRAS= netbsd32_compat15-extras-${COMPAT_VERSION}{,nb*}:../../emulators/netbsd32_compat15-extras
+. endfor
+. if !empty(COMPAT_EXTRAS)
+DEPENDS+= ${COMPAT_EXTRAS}
+. else
+DEPENDS+= netbsd32_compat16>=1.6:../../emulators/netbsd32_compat16
+. endif
+#
+# arm, m68k and vax switched from a.out to ELF after NetBSD-1.5, and
+# they don't need any other packages to supply missing a.out shared
+# libraries.
+#
+.elif (${EMUL_ARCH} == "arm") || (${EMUL_ARCH} == "m68k") || \
+ (${EMUL_ARCH} == "vax")
+#DEPENDS+= # no additional dependencies
+#
+# We need to depend on the compat16 package to supply shared libraries
+# missing from compat15 on NetBSD>1.6.
+#
+.elif empty(OS_VERSION:M0.[0-9]*) && empty(OS_VERSION:M1.[0-5]*) && \
+ empty(OS_VERSION:M1.6) && empty(OS_VERSION:M1.6.*)
+DEPENDS+= compat16>=1.6:../../emulators/compat16
+.endif
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/compat15/PLIST.ELF b/emulators/compat15/PLIST.ELF
new file mode 100644
index 00000000000..d11bca94bbc
--- /dev/null
+++ b/emulators/compat15/PLIST.ELF
@@ -0,0 +1,53 @@
+@comment $NetBSD: PLIST.ELF,v 1.1 2007/08/21 22:49:11 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libamu.so.1
+${EMULSUBDIRSLASH}usr/lib/libamu.so.1.1
+${EMULSUBDIRSLASH}usr/lib/libasn1.so.4
+${EMULSUBDIRSLASH}usr/lib/libasn1.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libbz2.so.0
+${EMULSUBDIRSLASH}usr/lib/libbz2.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.3
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.3.1
+${EMULSUBDIRSLASH}usr/lib/libcrypto.so.0
+${EMULSUBDIRSLASH}usr/lib/libcrypto.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.3
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.3.6
+${EMULSUBDIRSLASH}usr/lib/libdes.so.5
+${EMULSUBDIRSLASH}usr/lib/libdes.so.5.1
+${EMULSUBDIRSLASH}usr/lib/libgssapi.so.3
+${EMULSUBDIRSLASH}usr/lib/libgssapi.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libhdb.so.7
+${EMULSUBDIRSLASH}usr/lib/libhdb.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.4
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libkadm5clnt.so.6
+${EMULSUBDIRSLASH}usr/lib/libkadm5clnt.so.6.1
+${EMULSUBDIRSLASH}usr/lib/libkadm5srv.so.7
+${EMULSUBDIRSLASH}usr/lib/libkadm5srv.so.7.1
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.4
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.4.1
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.4
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.4
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libkrb5.so.15
+${EMULSUBDIRSLASH}usr/lib/libkrb5.so.15.0
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.1
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libmenu.so.1
+${EMULSUBDIRSLASH}usr/lib/libmenu.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libroken.so.11
+${EMULSUBDIRSLASH}usr/lib/libroken.so.11.0
+${EMULSUBDIRSLASH}usr/lib/libsl.so.1
+${EMULSUBDIRSLASH}usr/lib/libsl.so.1.1
+${EMULSUBDIRSLASH}usr/lib/libss.so.3
+${EMULSUBDIRSLASH}usr/lib/libss.so.3.1
+${EMULSUBDIRSLASH}usr/lib/libssl.so.1
+${EMULSUBDIRSLASH}usr/lib/libssl.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libtelnet.so.3
+${EMULSUBDIRSLASH}usr/lib/libtelnet.so.3.1
+${EMULSUBDIRSLASH}usr/lib/libusb.so.0
+${EMULSUBDIRSLASH}usr/lib/libusb.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.5
+${EMULSUBDIRSLASH}usr/lib/libutil.so.5.2.1
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr
diff --git a/emulators/compat15/PLIST.a.out b/emulators/compat15/PLIST.a.out
new file mode 100644
index 00000000000..0b15954ed87
--- /dev/null
+++ b/emulators/compat15/PLIST.a.out
@@ -0,0 +1,47 @@
+@comment $NetBSD: PLIST.a.out,v 1.1 2007/08/21 22:49:11 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libamu.so.1.1
+${EMULSUBDIRSLASH}usr/lib/libasn1.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libbz2.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libc.so.12.62.1
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.3.1
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libcrypto.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.3.6
+${EMULSUBDIRSLASH}usr/lib/libdes.so.5.1
+${EMULSUBDIRSLASH}usr/lib/libedit.so.2.3
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libgssapi.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libhdb.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libipsec.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libkadm5clnt.so.6.1
+${EMULSUBDIRSLASH}usr/lib/libkadm5srv.so.7.1
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.4.1
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libkrb5.so.15.0
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5.1
+${EMULSUBDIRSLASH}usr/lib/libm.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libmenu.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.1.1
+${EMULSUBDIRSLASH}usr/lib/libposix.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libresolv.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libroken.so.11.0
+${EMULSUBDIRSLASH}usr/lib/libskey.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libsl.so.1.1
+${EMULSUBDIRSLASH}usr/lib/libss.so.3.1
+${EMULSUBDIRSLASH}usr/lib/libssl.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libtelnet.so.3.1
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so.0.4
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so.0.4
+${EMULSUBDIRSLASH}usr/lib/libusb.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.5.2.1
+${EMULSUBDIRSLASH}usr/lib/libwrap.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libz.so.0.2
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr
diff --git a/emulators/compat15/PLIST.alpha b/emulators/compat15/PLIST.alpha
new file mode 100644
index 00000000000..28cc023bfed
--- /dev/null
+++ b/emulators/compat15/PLIST.alpha
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.alpha,v 1.1 2007/08/21 22:49:11 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.5.2.1
diff --git a/emulators/compat15/PLIST.arm b/emulators/compat15/PLIST.arm
new file mode 100644
index 00000000000..d586164475c
--- /dev/null
+++ b/emulators/compat15/PLIST.arm
@@ -0,0 +1,17 @@
+@comment $NetBSD: PLIST.arm,v 1.1 2007/08/21 22:49:11 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libarm32.so.0.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat15/PLIST.i386 b/emulators/compat15/PLIST.i386
new file mode 100644
index 00000000000..6f93fedee1b
--- /dev/null
+++ b/emulators/compat15/PLIST.i386
@@ -0,0 +1,14 @@
+@comment $NetBSD: PLIST.i386,v 1.1 2007/08/21 22:49:12 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.5.2.1
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat15/PLIST.m68k b/emulators/compat15/PLIST.m68k
new file mode 100644
index 00000000000..362fb6cf9b6
--- /dev/null
+++ b/emulators/compat15/PLIST.m68k
@@ -0,0 +1,17 @@
+@comment $NetBSD: PLIST.m68k,v 1.1 2007/08/21 22:49:12 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libm68k.so.0.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat15/PLIST.mipsel b/emulators/compat15/PLIST.mipsel
new file mode 100644
index 00000000000..1854973e3a9
--- /dev/null
+++ b/emulators/compat15/PLIST.mipsel
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.mipsel,v 1.1 2007/08/21 22:49:12 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.5.2.1
diff --git a/emulators/compat15/PLIST.powerpc b/emulators/compat15/PLIST.powerpc
new file mode 100644
index 00000000000..4fd43935cfe
--- /dev/null
+++ b/emulators/compat15/PLIST.powerpc
@@ -0,0 +1,14 @@
+@comment $NetBSD: PLIST.powerpc,v 1.1 2007/08/21 22:49:12 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.5.2.1
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat15/PLIST.sparc b/emulators/compat15/PLIST.sparc
new file mode 100644
index 00000000000..df07c981497
--- /dev/null
+++ b/emulators/compat15/PLIST.sparc
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.sparc,v 1.1 2007/08/21 22:49:12 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.5.2.1
diff --git a/emulators/compat15/PLIST.sparc64 b/emulators/compat15/PLIST.sparc64
new file mode 100644
index 00000000000..53cf5e16a52
--- /dev/null
+++ b/emulators/compat15/PLIST.sparc64
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.sparc64,v 1.1 2007/08/21 22:49:12 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libutil.so.5.2
diff --git a/emulators/compat15/PLIST.vax b/emulators/compat15/PLIST.vax
new file mode 100644
index 00000000000..09a80f6c6fb
--- /dev/null
+++ b/emulators/compat15/PLIST.vax
@@ -0,0 +1,16 @@
+@comment $NetBSD: PLIST.vax,v 1.1 2007/08/21 22:49:13 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat15/distinfo b/emulators/compat15/distinfo
new file mode 100644
index 00000000000..eeb69362217
--- /dev/null
+++ b/emulators/compat15/distinfo
@@ -0,0 +1,32 @@
+$NetBSD: distinfo,v 1.1 2007/08/21 22:49:13 jlam Exp $
+
+SHA1 (compat15-alpha-1.5.3.tar.bz2) = 42b28c846a90126d5c994286dcfcde91d0b0e91b
+RMD160 (compat15-alpha-1.5.3.tar.bz2) = 7a93ac1f755f3e9702a9950531fc72bbc597e2e5
+Size (compat15-alpha-1.5.3.tar.bz2) = 1412510 bytes
+SHA1 (compat15-arm-1.5.3.tar.bz2) = 8276b2566993085d4c12f8fa4ebbb0fa7f3354e1
+RMD160 (compat15-arm-1.5.3.tar.bz2) = 092dcf5df1f6a2c4451c5adf82011d596584521d
+Size (compat15-arm-1.5.3.tar.bz2) = 2738008 bytes
+SHA1 (compat15-i386-1.5.3.tar.bz2) = 96cc83cccd046c6698012d704327a5deda9d740a
+RMD160 (compat15-i386-1.5.3.tar.bz2) = c1caaeadf8045128fce54294ae09d34dd03c8535
+Size (compat15-i386-1.5.3.tar.bz2) = 1008025 bytes
+SHA1 (compat15-m68k-1.5.3.tar.bz2) = ee4e095c3673a8fcf39d38540b70083a37b54f71
+RMD160 (compat15-m68k-1.5.3.tar.bz2) = 081fa60c92926d3105579cfbcf89b2720f1c2d10
+Size (compat15-m68k-1.5.3.tar.bz2) = 2183410 bytes
+SHA1 (compat15-mipsel-1.5.3.tar.bz2) = 4d3f22df172ef223d1fe66bb478cc9d223943de0
+RMD160 (compat15-mipsel-1.5.3.tar.bz2) = d7be8fb7190f4c1eab40bc5164bf5bd6dd319e18
+Size (compat15-mipsel-1.5.3.tar.bz2) = 1307378 bytes
+SHA1 (compat15-ns32k-1.5.3.tar.bz2) = 1ad38e67dcab726dcd61d15220a6c47fa2001045
+RMD160 (compat15-ns32k-1.5.3.tar.bz2) = ab3be90a62a84c8ec4b47b307026ee3b4a7932c4
+Size (compat15-ns32k-1.5.3.tar.bz2) = 1524809 bytes
+SHA1 (compat15-powerpc-1.5.3.tar.bz2) = 577b0de89fc2db4117273bab13e91928e8f31fd3
+RMD160 (compat15-powerpc-1.5.3.tar.bz2) = 061cedfef2e28c10a07ab401519934494c9d3f4c
+Size (compat15-powerpc-1.5.3.tar.bz2) = 1055544 bytes
+SHA1 (compat15-sparc-1.5.3.tar.bz2) = e72764d9ee1ac4795497b3b24505f19f46c98418
+RMD160 (compat15-sparc-1.5.3.tar.bz2) = e2c320d8dedb42cad978029e0a69f3574f5fdfaa
+Size (compat15-sparc-1.5.3.tar.bz2) = 965134 bytes
+SHA1 (compat15-sparc64-1.5.2.tar.bz2) = 502d94a8be4d0939f3e8bc55a09b99bbe92f5a72
+RMD160 (compat15-sparc64-1.5.2.tar.bz2) = 50d126dc6213c02687aaf7dcb16a7e3236c82b34
+Size (compat15-sparc64-1.5.2.tar.bz2) = 760818 bytes
+SHA1 (compat15-vax-1.5.3.tar.bz2) = 56786b222e22be8230224da66e4b12da0759c4cc
+RMD160 (compat15-vax-1.5.3.tar.bz2) = d402595ce921bf50fa9b0d63ec5ed5b3abb84880
+Size (compat15-vax-1.5.3.tar.bz2) = 2060891 bytes
diff --git a/emulators/compat15/emulator.mk b/emulators/compat15/emulator.mk
new file mode 100644
index 00000000000..338f49e0430
--- /dev/null
+++ b/emulators/compat15/emulator.mk
@@ -0,0 +1,57 @@
+# $NetBSD: emulator.mk,v 1.1 2007/08/21 22:49:13 jlam Exp $
+#
+# This file is included by netbsd-compat.mk in the emulator framework.
+#
+# Variables set by this file:
+#
+# EMUL_DISTRO
+# The NetBSD distribution used to provide the files.
+#
+# EMUL_EXEC_FMT
+# The executable format of the emulated operating system.
+#
+# EMULSUBDIR
+# Path relative to ${PREFIX} where the files and directories are
+# located, e.g. emul/aout.
+#
+# DEPENDS_${EMUL_DISTRO}.*
+# A table that maps "modules" to NetBSD package dependencies.
+#
+
+EMUL_DISTRO= netbsd-1.5
+
+# arm, m68k and vax switched from a.out to ELF post-1.5.
+# ns32k never switched from a.out.
+#
+.if (${EMUL_ARCH} == "arm") || (${EMUL_ARCH} == "m68k") || \
+ (${EMUL_ARCH} == "ns32k") || (${EMUL_ARCH} == "vax")
+EMUL_EXEC_FMT= a.out
+.else
+EMUL_EXEC_FMT= ELF
+.endif
+
+.if (${NATIVE_EXEC_FMT} == "ELF") && (${EMUL_EXEC_FMT} == "a.out")
+EMULSUBDIR= emul/aout
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.aout}
+.else
+EMULSUBDIR= emul/netbsd
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.netbsd}
+.endif
+
+# For COMPAT_NETBSD32, we always need the dependency to supply 32-bit
+# shared libaries for NetBSD-1.5.
+#
+.if ((${EMUL_ARCH} == "i386") && (${MACHINE_ARCH} == "x86_64")) || \
+ ((${EMUL_ARCH} == "sparc") && (${MACHINE_ARCH} == "sparc64"))
+EMULSUBDIR= emul/netbsd32
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.netbsd32}
+
+DEPENDS_netbsd-1.5.base?= netbsd32_compat15>=1.5:../../emulators/netbsd32_compat15
+#
+# We need to depend on the compat15 package to supply missing shared
+# libraries only on NetBSD>1.5.
+#
+.elif empty(OS_VERSION:M0.[0-9]*) && empty(OS_VERSION:M1.[0-4]*) && \
+ empty(OS_VERSION:M1.5) && empty(OS_VERSION:M1.5.*)
+DEPENDS_netbsd-1.5.base?= compat15>=1.5:../../emulators/compat15
+.endif
diff --git a/emulators/compat16-extras/DESCR b/emulators/compat16-extras/DESCR
new file mode 100644
index 00000000000..c7af558b8ec
--- /dev/null
+++ b/emulators/compat16-extras/DESCR
@@ -0,0 +1,4 @@
+This package supplies the extra user files needed to run dynamically
+linked executables compiled under NetBSD 1.6, including user files
+that might be found in NetBSD versions beyond 1.6 that are missing
+from the pkgsrc/emulators/compat16 package.
diff --git a/emulators/compat16-extras/Makefile b/emulators/compat16-extras/Makefile
new file mode 100644
index 00000000000..2bedad4d3a2
--- /dev/null
+++ b/emulators/compat16-extras/Makefile
@@ -0,0 +1,24 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:17 jlam Exp $
+
+DISTNAME= compat16-extras # overridden below
+NETBSD_VERSION= 1.6
+
+HOMEPAGE= http://www.NetBSD.org/Releases/formal-1.6/index.html
+COMMENT= Additional shared libraries for NetBSD 1.6 compatibility
+
+EMUL_PLATFORMS= netbsd-i386 netbsd-sparc
+
+.include "../../emulators/compat_netbsd/Makefile.common"
+
+DISTNAME= compat16-extras-${EMUL_ARCH}-1.6.2
+
+# This package should only be installed for COMPAT_NETBSD32 emulation
+# on machines running NetBSD-1.6.
+#
+.if defined(NETBSD_COMPAT32)
+ACCEPTABLE_NETBSD= NetBSD-1.5[A-Z]* NetBSD-1.6 NetBSD-1.6.*
+.else
+NOT_FOR_PLATFORM= NetBSD-*-${MACHINE_ARCH}
+.endif
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/compat16-extras/PLIST b/emulators/compat16-extras/PLIST
new file mode 100644
index 00000000000..8de7dc71417
--- /dev/null
+++ b/emulators/compat16-extras/PLIST
@@ -0,0 +1,100 @@
+@comment $NetBSD: PLIST,v 1.1 2007/08/21 22:49:17 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6.0
+${EMULSUBDIRSLASH}usr/lib/i18n/libBIG5.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libBIG5.so.4.0
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUC.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUC.so.4.0
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUCTW.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUCTW.so.4.0
+${EMULSUBDIRSLASH}usr/lib/i18n/libISO2022.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libISO2022.so.4.0
+${EMULSUBDIRSLASH}usr/lib/i18n/libMSKanji.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libMSKanji.so.4.0
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF8.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF8.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libamu.so.2
+${EMULSUBDIRSLASH}usr/lib/libamu.so.2.1
+${EMULSUBDIRSLASH}usr/lib/libasn1.so.6
+${EMULSUBDIRSLASH}usr/lib/libasn1.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libbz2.so.1
+${EMULSUBDIRSLASH}usr/lib/libbz2.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libc.so.12
+${EMULSUBDIRSLASH}usr/lib/libc.so.12.83.2
+${EMULSUBDIRSLASH}usr/lib/libcdk.so.1
+${EMULSUBDIRSLASH}usr/lib/libcdk.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.4
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.4.1
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so.0
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libedit.so.2
+${EMULSUBDIRSLASH}usr/lib/libedit.so.2.6
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so.0
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libintl.so.0
+${EMULSUBDIRSLASH}usr/lib/libintl.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libipsec.so.2
+${EMULSUBDIRSLASH}usr/lib/libipsec.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.5
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.5
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.2
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5.1
+${EMULSUBDIRSLASH}usr/lib/libm.so.0
+${EMULSUBDIRSLASH}usr/lib/libm.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so.0
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.1
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.1.2
+${EMULSUBDIRSLASH}usr/lib/libpci.so.0
+${EMULSUBDIRSLASH}usr/lib/libpci.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libposix.so.0
+${EMULSUBDIRSLASH}usr/lib/libposix.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libresolv.so.1
+${EMULSUBDIRSLASH}usr/lib/libresolv.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libroken.so.12
+${EMULSUBDIRSLASH}usr/lib/libroken.so.12.2
+${EMULSUBDIRSLASH}usr/lib/libskey.so.1
+${EMULSUBDIRSLASH}usr/lib/libskey.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libsl.so.2
+${EMULSUBDIRSLASH}usr/lib/libsl.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libss.so.4
+${EMULSUBDIRSLASH}usr/lib/libss.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so.0
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so.0.5
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so.0
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so.0.5
+${EMULSUBDIRSLASH}usr/lib/libusbhid.so.1
+${EMULSUBDIRSLASH}usr/lib/libusbhid.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libwrap.so.0
+${EMULSUBDIRSLASH}usr/lib/libwrap.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libz.so.0
+${EMULSUBDIRSLASH}usr/lib/libz.so.0.2
+${EMULSUBDIRSLASH}usr/libexec/ld.elf_so
+${EMULSUBDIRSLASH}usr/libexec/ld.so
+@dirrm ${EMULSUBDIRSLASH}usr/libexec
+@dirrm ${EMULSUBDIRSLASH}usr/lib/i18n
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
+@dirrm ${EMULSUBDIRSLASH}usr
diff --git a/emulators/compat16-extras/PLIST.i386 b/emulators/compat16-extras/PLIST.i386
new file mode 100644
index 00000000000..650621f12f0
--- /dev/null
+++ b/emulators/compat16-extras/PLIST.i386
@@ -0,0 +1,98 @@
+@comment $NetBSD: PLIST.i386,v 1.1 2007/08/21 22:49:17 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libFS.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libFS.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libFS.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGL.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGL.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGL.so.1.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLU.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLU.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLU.so.1.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libOSMesa.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libOSMesa.so.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libOSMesa.so.4.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXRes.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXRes.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXRes.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXTrap.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXTrap.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXTrap.so.6.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.7
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.7.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXcursor.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXcursor.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXcursor.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfont.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfont.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfont.so.1.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfontcache.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfontcache.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfontcache.so.1.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.1.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.2.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXinerama.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXinerama.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXinerama.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmuu.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmuu.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmuu.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXpm.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXpm.so.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXpm.so.4.11
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrandr.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrandr.so.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrandr.so.2.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrender.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrender.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrender.so.1.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXss.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXss.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXss.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXv.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXv.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXv.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXvMC.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXvMC.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXvMC.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86dga.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86dga.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86dga.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86misc.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86misc.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86misc.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86vm.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86vm.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86vm.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdps.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdps.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdps.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdpstk.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdpstk.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdpstk.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libexpat.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontconfig.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontconfig.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontconfig.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontenc.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontenc.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontenc.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfreetype.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfreetype.so.9
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfreetype.so.9.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libpsres.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libpsres.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libpsres.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbfile.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbfile.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbfile.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbui.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbui.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbui.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libm387.so.0
+${EMULSUBDIRSLASH}usr/lib/libm387.so.0.0
diff --git a/emulators/compat16-extras/PLIST.sparc b/emulators/compat16-extras/PLIST.sparc
new file mode 100644
index 00000000000..1a56d52fd14
--- /dev/null
+++ b/emulators/compat16-extras/PLIST.sparc
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST.sparc,v 1.1 2007/08/21 22:49:17 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6.0
diff --git a/emulators/compat16-extras/distinfo b/emulators/compat16-extras/distinfo
new file mode 100644
index 00000000000..e9fbf420d45
--- /dev/null
+++ b/emulators/compat16-extras/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2007/08/21 22:49:17 jlam Exp $
+
+SHA1 (compat16-extras-i386-1.6.2.tar.bz2) = 99bea740ae6f158e9af3da28e763e2b747437b8f
+RMD160 (compat16-extras-i386-1.6.2.tar.bz2) = 8dd72d861531bd00db90d462244986415076399c
+Size (compat16-extras-i386-1.6.2.tar.bz2) = 3506953 bytes
+SHA1 (compat16-extras-sparc-1.6.2.tar.bz2) = aa59568f73bbdb6d6f5dc2f97b94006cf58e7834
+RMD160 (compat16-extras-sparc-1.6.2.tar.bz2) = 507b051de677a85111d0de45a6c218271b571ba2
+Size (compat16-extras-sparc-1.6.2.tar.bz2) = 1595142 bytes
diff --git a/emulators/compat16/DESCR b/emulators/compat16/DESCR
index 8103a3feea2..07ce1562445 100644
--- a/emulators/compat16/DESCR
+++ b/emulators/compat16/DESCR
@@ -1,2 +1,2 @@
-This package supplies the user files necessary for full compatibility
-with dynamically linked executables compiled under NetBSD 1.6.
+This package supplies the user files needed to run dynamically linked
+executables compiled under NetBSD 1.6.
diff --git a/emulators/compat16/MESSAGE b/emulators/compat16/MESSAGE
index 5721a8b720a..da35136bd33 100644
--- a/emulators/compat16/MESSAGE
+++ b/emulators/compat16/MESSAGE
@@ -1,7 +1,7 @@
===========================================================================
-$NetBSD: MESSAGE,v 1.1.1.1 2003/12/14 04:17:18 grant Exp $
-
-You will need the option COMPAT_16 in your kernel configuration to make
-use of NetBSD 1.6 binaries.
+$NetBSD: MESSAGE,v 1.2 2007/08/21 22:49:14 jlam Exp $
+The COMPAT_16 option must be included in the kernel configuration (and
+possibly others; see options(4) for more information) to make use of
+NetBSD 1.6 binaries.
===========================================================================
diff --git a/emulators/compat16/Makefile b/emulators/compat16/Makefile
index 6a317abffd1..cbe99ab77ab 100644
--- a/emulators/compat16/Makefile
+++ b/emulators/compat16/Makefile
@@ -1,32 +1,53 @@
-# $NetBSD: Makefile,v 1.9 2006/10/19 19:37:38 wiz Exp $
-#
+# $NetBSD: Makefile,v 1.10 2007/08/21 22:49:14 jlam Exp $
-DISTNAME= compat16-${MACHINE_ARCH}-${VERSION}
-PKGNAME= compat16-${VERSION}
-CATEGORIES= emulators
-MASTER_SITES= ${MASTER_SITE_LOCAL}
-EXTRACT_SUFX= .tar.bz2
+DISTNAME= compat16 # overridden below
+NETBSD_VERSION= 1.6
-MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.NetBSD.org/Releases/formal-1.6/index.html
-COMMENT= Shared libraries for NetBSD 1.6 (and earlier) compatibility
+COMMENT= Shared libraries for NetBSD 1.6 compatibility
-VERSION= 1.6.0
+.if defined(NETBSD_COMPAT32)
+EMUL_PLATFORMS= netbsd-i386 netbsd-sparc
-ONLY_FOR_PLATFORM= NetBSD-1.6[A-Z]*-i386 NetBSD-[2-9]*-i386
-NO_SRC_ON_FTP= Already in MASTER_SITE_LOCAL
+ACCEPTABLE_NETBSD= NetBSD-1.5[A-Z]* NetBSD-1.6 NetBSD-1.6.* \
+ NetBSD-1.6[A-Z]* NetBSD-[2-9]* \
+ NetBSD-[1-9][0-9]*
+.else
+EMUL_PLATFORMS= netbsd-alpha netbsd-arm netbsd-i386 netbsd-m68k \
+ netbsd-mipseb netbsd-mipsel netbsd-powerpc \
+ netbsd-sparc netbsd-sparc64 netbsd-vax
-NO_MTREE= yes
-NO_BUILD= yes
-NO_CONFIGURE= yes
-CHECK_SHLIBS_SUPPORTED= no
+ONLY_FOR_PLATFORM= NetBSD-1.6[A-Z]*-* NetBSD-[2-9]*-* \
+ NetBSD-[1-9][0-9]*-*
+.endif
-EMULSUBDIR= emul/netbsd16
+.include "../../emulators/compat_netbsd/Makefile.common"
-PLIST_SUBST+= EMULSUBDIR=${EMULSUBDIR:Q}
+DISTNAME= compat16-${EMUL_ARCH}-${COMPAT_VERSION}
+COMPAT_VERSION= 1.6.2
-do-install:
- ${INSTALL_DATA_DIR} ${PREFIX}/${EMULSUBDIR}
- (cd ${WRKDIR}; ${PAX} -rw usr ${PREFIX}/${EMULSUBDIR})
+# For COMPAT_NETBSD32, we need to depend on the compat16-extras package
+# on NetBSD-1.6 to supply the missing shared libraries; otherwise, we
+# just depend on the compat20 package for the missing shared libraries.
+#
+.if defined(NETBSD_COMPAT32)
+COMPAT_EXTRAS= # empty
+. for _netbsd_ in ${ACCEPTABLE_NETBSD}
+COMPAT_EXTRAS= netbsd32_compat16-extras-${COMPAT_VERSION}{,nb*}:../../emulators/netbsd32_compat16-extras
+. endfor
+. if !empty(COMPAT_EXTRAS)
+DEPENDS+= ${COMPAT_EXTRAS}
+. else
+DEPENDS+= netbsd32_compat20>=2.0:../../emulators/netbsd32_compat20
+. endif
+#
+# We need to depend on the compat20 package to supply shared libraries
+# missing from compat16 on NetBSD>2.x.
+#
+.elif empty(OS_VERSION:M[0-1].*) && empty(OS_VERSION:M2.[0-9]) && \
+ empty(OS_VERSION:M2.[0-9].*) && empty(OS_VERSION:M2.[1-8][0-9].*) && \
+ empty(OS_VERSION:M2.9[0-8]*)
+DEPENDS+= compat20>=2.0:../../emulators/compat20
+.endif
.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/compat16/PLIST b/emulators/compat16/PLIST
new file mode 100644
index 00000000000..a3766cb8f48
--- /dev/null
+++ b/emulators/compat16/PLIST
@@ -0,0 +1,33 @@
+@comment $NetBSD: PLIST,v 1.1 2007/08/21 22:49:14 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libcrypto.so.1
+${EMULSUBDIRSLASH}usr/lib/libcrypto.so.1.1
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.5
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libdes.so.6
+${EMULSUBDIRSLASH}usr/lib/libdes.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libform.so.3
+${EMULSUBDIRSLASH}usr/lib/libform.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libgssapi.so.4
+${EMULSUBDIRSLASH}usr/lib/libgssapi.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libhdb.so.8
+${EMULSUBDIRSLASH}usr/lib/libhdb.so.8.0
+${EMULSUBDIRSLASH}usr/lib/libkadm5clnt.so.7
+${EMULSUBDIRSLASH}usr/lib/libkadm5clnt.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libkadm5srv.so.8
+${EMULSUBDIRSLASH}usr/lib/libkadm5srv.so.8.0
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.5
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.5.1
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.5
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.5.1
+${EMULSUBDIRSLASH}usr/lib/libkrb5.so.18
+${EMULSUBDIRSLASH}usr/lib/libkrb5.so.18.0
+${EMULSUBDIRSLASH}usr/lib/libmenu.so.4
+${EMULSUBDIRSLASH}usr/lib/libmenu.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libssl.so.2
+${EMULSUBDIRSLASH}usr/lib/libssl.so.2.1
+${EMULSUBDIRSLASH}usr/lib/libtelnet.so.4
+${EMULSUBDIRSLASH}usr/lib/libtelnet.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.6
+${EMULSUBDIRSLASH}usr/lib/libutil.so.6.0.1
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr
diff --git a/emulators/compat16/PLIST.alpha b/emulators/compat16/PLIST.alpha
new file mode 100644
index 00000000000..11757a877e0
--- /dev/null
+++ b/emulators/compat16/PLIST.alpha
@@ -0,0 +1,11 @@
+@comment $NetBSD: PLIST.alpha,v 1.1 2007/08/21 22:49:15 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat16/PLIST.arm b/emulators/compat16/PLIST.arm
new file mode 100644
index 00000000000..2e9b26cceeb
--- /dev/null
+++ b/emulators/compat16/PLIST.arm
@@ -0,0 +1,11 @@
+@comment $NetBSD: PLIST.arm,v 1.1 2007/08/21 22:49:15 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat16/PLIST.i386 b/emulators/compat16/PLIST.i386
index 18ee63171ee..8e8b7d44e8c 100644
--- a/emulators/compat16/PLIST.i386
+++ b/emulators/compat16/PLIST.i386
@@ -1,138 +1,11 @@
-@comment $NetBSD: PLIST.i386,v 1.1.1.1 2003/12/14 04:17:18 grant Exp $
-${EMULSUBDIR}/usr/lib/libamu.so.2
-${EMULSUBDIR}/usr/lib/libamu.so.2.1
-${EMULSUBDIR}/usr/lib/libasn1.so.6
-${EMULSUBDIR}/usr/lib/libasn1.so.6.0
-${EMULSUBDIR}/usr/lib/libbz2.so.1
-${EMULSUBDIR}/usr/lib/libbz2.so.1.0
-${EMULSUBDIR}/usr/lib/libc.so.12
-${EMULSUBDIR}/usr/lib/libc.so.12.83
-${EMULSUBDIR}/usr/lib/libcdk.so.1
-${EMULSUBDIR}/usr/lib/libcdk.so.1.0
-${EMULSUBDIR}/usr/lib/libcom_err.so.4
-${EMULSUBDIR}/usr/lib/libcom_err.so.4.1
-${EMULSUBDIR}/usr/lib/libcrypt.so.0
-${EMULSUBDIR}/usr/lib/libcrypt.so.0.0
-${EMULSUBDIR}/usr/lib/libcrypto.so.1
-${EMULSUBDIR}/usr/lib/libcrypto.so.1.1
-${EMULSUBDIR}/usr/lib/libcurses.so.5
-${EMULSUBDIR}/usr/lib/libcurses.so.5.0
-${EMULSUBDIR}/usr/lib/libdes.so.6
-${EMULSUBDIR}/usr/lib/libdes.so.6.0
-${EMULSUBDIR}/usr/lib/i18n/libBIG5.so.4
-${EMULSUBDIR}/usr/lib/i18n/libBIG5.so.4.0
-${EMULSUBDIR}/usr/lib/i18n/libEUC.so.4
-${EMULSUBDIR}/usr/lib/i18n/libEUC.so.4.0
-${EMULSUBDIR}/usr/lib/i18n/libEUCTW.so.4
-${EMULSUBDIR}/usr/lib/i18n/libEUCTW.so.4.0
-${EMULSUBDIR}/usr/lib/i18n/libISO2022.so.4
-${EMULSUBDIR}/usr/lib/i18n/libISO2022.so.4.0
-${EMULSUBDIR}/usr/lib/i18n/libMSKanji.so.4
-${EMULSUBDIR}/usr/lib/i18n/libMSKanji.so.4.0
-${EMULSUBDIR}/usr/lib/i18n/libUTF8.so.4
-${EMULSUBDIR}/usr/lib/i18n/libUTF8.so.4.0
-${EMULSUBDIR}/usr/lib/libedit.so.2
-${EMULSUBDIR}/usr/lib/libedit.so.2.6
-${EMULSUBDIR}/usr/lib/libform.so.3
-${EMULSUBDIR}/usr/lib/libform.so.3.0
-${EMULSUBDIR}/usr/lib/libgnumalloc.so.0
-${EMULSUBDIR}/usr/lib/libgnumalloc.so.0.0
-${EMULSUBDIR}/usr/lib/libgssapi.so.4
-${EMULSUBDIR}/usr/lib/libgssapi.so.4.0
-${EMULSUBDIR}/usr/lib/libhdb.so.8
-${EMULSUBDIR}/usr/lib/libhdb.so.8.0
-${EMULSUBDIR}/usr/lib/libintl.so.0
-${EMULSUBDIR}/usr/lib/libintl.so.0.0
-${EMULSUBDIR}/usr/lib/libipsec.so.2
-${EMULSUBDIR}/usr/lib/libipsec.so.2.0
-${EMULSUBDIR}/usr/lib/libkadm.so.5
-${EMULSUBDIR}/usr/lib/libkadm.so.5.0
-${EMULSUBDIR}/usr/lib/libkadm5clnt.so.7
-${EMULSUBDIR}/usr/lib/libkadm5clnt.so.7.0
-${EMULSUBDIR}/usr/lib/libkadm5srv.so.8
-${EMULSUBDIR}/usr/lib/libkadm5srv.so.8.0
-${EMULSUBDIR}/usr/lib/libkafs.so.5
-${EMULSUBDIR}/usr/lib/libkafs.so.5.1
-${EMULSUBDIR}/usr/lib/libkdb.so.5
-${EMULSUBDIR}/usr/lib/libkdb.so.5.0
-${EMULSUBDIR}/usr/lib/libkrb.so.5
-${EMULSUBDIR}/usr/lib/libkrb.so.5.1
-${EMULSUBDIR}/usr/lib/libkrb5.so.18
-${EMULSUBDIR}/usr/lib/libkrb5.so.18.0
-${EMULSUBDIR}/usr/lib/libkstream.so.2
-${EMULSUBDIR}/usr/lib/libkstream.so.2.0
-${EMULSUBDIR}/usr/lib/libkvm.so.5
-${EMULSUBDIR}/usr/lib/libkvm.so.5.1
-${EMULSUBDIR}/usr/lib/libm.so.0
-${EMULSUBDIR}/usr/lib/libm.so.0.1
-${EMULSUBDIR}/usr/lib/libmenu.so.4
-${EMULSUBDIR}/usr/lib/libmenu.so.4.0
-${EMULSUBDIR}/usr/lib/libobjc.so.1
-${EMULSUBDIR}/usr/lib/libobjc.so.1.0
-${EMULSUBDIR}/usr/lib/libossaudio.so.0
-${EMULSUBDIR}/usr/lib/libossaudio.so.0.0
-${EMULSUBDIR}/usr/lib/libpcap.so.1
-${EMULSUBDIR}/usr/lib/libpcap.so.1.2
-${EMULSUBDIR}/usr/lib/libpci.so.0
-${EMULSUBDIR}/usr/lib/libpci.so.0.0
-${EMULSUBDIR}/usr/lib/libposix.so.0
-${EMULSUBDIR}/usr/lib/libposix.so.0.1
-${EMULSUBDIR}/usr/lib/libresolv.so.1
-${EMULSUBDIR}/usr/lib/libresolv.so.1.0
-${EMULSUBDIR}/usr/lib/libroken.so.12
-${EMULSUBDIR}/usr/lib/libroken.so.12.2
-${EMULSUBDIR}/usr/lib/libskey.so.1
-${EMULSUBDIR}/usr/lib/libskey.so.1.0
-${EMULSUBDIR}/usr/lib/libsl.so.2
-${EMULSUBDIR}/usr/lib/libsl.so.2.0
-${EMULSUBDIR}/usr/lib/libss.so.4
-${EMULSUBDIR}/usr/lib/libss.so.4.0
-${EMULSUBDIR}/usr/lib/libssl.so.2
-${EMULSUBDIR}/usr/lib/libssl.so.2.1
-${EMULSUBDIR}/usr/lib/libstdc++.so.4
-${EMULSUBDIR}/usr/lib/libstdc++.so.4.0
-${EMULSUBDIR}/usr/lib/libtelnet.so.4
-${EMULSUBDIR}/usr/lib/libtelnet.so.4.0
-${EMULSUBDIR}/usr/lib/libtermcap.so.0
-${EMULSUBDIR}/usr/lib/libtermcap.so.0.5
-${EMULSUBDIR}/usr/lib/libtermlib.so.0
-${EMULSUBDIR}/usr/lib/libtermlib.so.0.5
-${EMULSUBDIR}/usr/lib/libusbhid.so.1
-${EMULSUBDIR}/usr/lib/libusbhid.so.1.0
-${EMULSUBDIR}/usr/lib/libutil.so.6
-${EMULSUBDIR}/usr/lib/libutil.so.6.0
-${EMULSUBDIR}/usr/lib/libwrap.so.0
-${EMULSUBDIR}/usr/lib/libwrap.so.0.2
-${EMULSUBDIR}/usr/lib/libz.so.0
-${EMULSUBDIR}/usr/lib/libz.so.0.2
-${EMULSUBDIR}/usr/libexec/ld.elf_so
-${EMULSUBDIR}/usr/libexec/ld.so
-${EMULSUBDIR}/usr/X11R6/lib/libICE.so.6
-${EMULSUBDIR}/usr/X11R6/lib/libICE.so.6.3
-${EMULSUBDIR}/usr/X11R6/lib/libSM.so.6
-${EMULSUBDIR}/usr/X11R6/lib/libSM.so.6.0
-${EMULSUBDIR}/usr/X11R6/lib/libX11.so.6
-${EMULSUBDIR}/usr/X11R6/lib/libX11.so.6.2
-${EMULSUBDIR}/usr/X11R6/lib/libXaw.so.6
-${EMULSUBDIR}/usr/X11R6/lib/libXaw.so.6.1
-${EMULSUBDIR}/usr/X11R6/lib/libXext.so.6
-${EMULSUBDIR}/usr/X11R6/lib/libXext.so.6.4
-${EMULSUBDIR}/usr/X11R6/lib/libXi.so.6
-${EMULSUBDIR}/usr/X11R6/lib/libXi.so.6.0
-${EMULSUBDIR}/usr/X11R6/lib/libXmu.so.6
-${EMULSUBDIR}/usr/X11R6/lib/libXmu.so.6.2
-${EMULSUBDIR}/usr/X11R6/lib/libXp.so.6
-${EMULSUBDIR}/usr/X11R6/lib/libXp.so.6.2
-${EMULSUBDIR}/usr/X11R6/lib/libXt.so.6
-${EMULSUBDIR}/usr/X11R6/lib/libXt.so.6.0
-${EMULSUBDIR}/usr/X11R6/lib/libXtst.so.6
-${EMULSUBDIR}/usr/X11R6/lib/libXtst.so.6.1
-${EMULSUBDIR}/usr/X11R6/lib/liboldX.so.6
-${EMULSUBDIR}/usr/X11R6/lib/liboldX.so.6.0
-@dirrm ${EMULSUBDIR}/usr/X11R6/lib
-@dirrm ${EMULSUBDIR}/usr/X11R6
-@dirrm ${EMULSUBDIR}/usr/libexec
-@dirrm ${EMULSUBDIR}/usr/lib/i18n
-@dirrm ${EMULSUBDIR}/usr/lib
-@dirrm ${EMULSUBDIR}/usr
-@dirrm ${EMULSUBDIR}
+@comment $NetBSD: PLIST.i386,v 1.2 2007/08/21 22:49:15 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libexpat.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libexpat.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libi386.so.0
+${EMULSUBDIRSLASH}usr/lib/libi386.so.0.4
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat16/PLIST.m68k b/emulators/compat16/PLIST.m68k
new file mode 100644
index 00000000000..92a69b32df4
--- /dev/null
+++ b/emulators/compat16/PLIST.m68k
@@ -0,0 +1,11 @@
+@comment $NetBSD: PLIST.m68k,v 1.1 2007/08/21 22:49:15 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat16/PLIST.mipseb b/emulators/compat16/PLIST.mipseb
new file mode 100644
index 00000000000..6f855c1ba29
--- /dev/null
+++ b/emulators/compat16/PLIST.mipseb
@@ -0,0 +1,11 @@
+@comment $NetBSD: PLIST.mipseb,v 1.1 2007/08/21 22:49:15 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat16/PLIST.mipsel b/emulators/compat16/PLIST.mipsel
new file mode 100644
index 00000000000..ce4c0f7d7b8
--- /dev/null
+++ b/emulators/compat16/PLIST.mipsel
@@ -0,0 +1,11 @@
+@comment $NetBSD: PLIST.mipsel,v 1.1 2007/08/21 22:49:16 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat16/PLIST.powerpc b/emulators/compat16/PLIST.powerpc
new file mode 100644
index 00000000000..828f2f94e14
--- /dev/null
+++ b/emulators/compat16/PLIST.powerpc
@@ -0,0 +1,9 @@
+@comment $NetBSD: PLIST.powerpc,v 1.1 2007/08/21 22:49:16 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libexpat.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libexpat.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat16/PLIST.sparc b/emulators/compat16/PLIST.sparc
new file mode 100644
index 00000000000..2997c64c3dc
--- /dev/null
+++ b/emulators/compat16/PLIST.sparc
@@ -0,0 +1,11 @@
+@comment $NetBSD: PLIST.sparc,v 1.1 2007/08/21 22:49:16 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat16/PLIST.sparc64 b/emulators/compat16/PLIST.sparc64
new file mode 100644
index 00000000000..055e437e78d
--- /dev/null
+++ b/emulators/compat16/PLIST.sparc64
@@ -0,0 +1,11 @@
+@comment $NetBSD: PLIST.sparc64,v 1.1 2007/08/21 22:49:16 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat16/PLIST.vax b/emulators/compat16/PLIST.vax
new file mode 100644
index 00000000000..466bb906e74
--- /dev/null
+++ b/emulators/compat16/PLIST.vax
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST.vax,v 1.1 2007/08/21 22:49:16 jlam Exp $
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libPEX5.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXIE.so.6.0
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
diff --git a/emulators/compat16/distinfo b/emulators/compat16/distinfo
index d9836c02ec8..9a42fd8a3c9 100644
--- a/emulators/compat16/distinfo
+++ b/emulators/compat16/distinfo
@@ -1,5 +1,32 @@
-$NetBSD: distinfo,v 1.2 2005/02/23 18:49:18 agc Exp $
+$NetBSD: distinfo,v 1.3 2007/08/21 22:49:16 jlam Exp $
-SHA1 (compat16-i386-1.6.0.tar.bz2) = 04c2fc19591941bb4ae79a2a909e5871b37dc33a
-RMD160 (compat16-i386-1.6.0.tar.bz2) = 175e64b53435ae1c2af3a143f3001ba6df7dad20
-Size (compat16-i386-1.6.0.tar.bz2) = 2478593 bytes
+SHA1 (compat16-alpha-1.6.2.tar.bz2) = 789d3e537baa34e65a21498d339f5b585b29dc18
+RMD160 (compat16-alpha-1.6.2.tar.bz2) = af52e20b46d0d5d73c35c2e427afe8dd4c9d048b
+Size (compat16-alpha-1.6.2.tar.bz2) = 1116516 bytes
+SHA1 (compat16-arm-1.6.2.tar.bz2) = 2d00b8cd382331f8d5b2f6bbdc2db10b89ef995e
+RMD160 (compat16-arm-1.6.2.tar.bz2) = d0cd2bbaf8b6dcabe2330bb4617198f61d81047e
+Size (compat16-arm-1.6.2.tar.bz2) = 946440 bytes
+SHA1 (compat16-i386-1.6.2.tar.bz2) = b86107e16b9634828714f7a157ca3d705e830e31
+RMD160 (compat16-i386-1.6.2.tar.bz2) = cecf04414196a3b529e19378b58bd23a97ce35aa
+Size (compat16-i386-1.6.2.tar.bz2) = 849911 bytes
+SHA1 (compat16-m68k-1.6.2.tar.bz2) = 93c993fffc6151cf19e2e60b5859d24e0c581b1f
+RMD160 (compat16-m68k-1.6.2.tar.bz2) = 0d10f5d64f6ec900f03e5d2bcd15344eeb4e76ff
+Size (compat16-m68k-1.6.2.tar.bz2) = 908817 bytes
+SHA1 (compat16-mipseb-1.6.2.tar.bz2) = 7a2570fbe9215929440f705f685dfb6a42d717da
+RMD160 (compat16-mipseb-1.6.2.tar.bz2) = 7969ebe25ec93ef99c42d34a6f6f450f35baf183
+Size (compat16-mipseb-1.6.2.tar.bz2) = 1267678 bytes
+SHA1 (compat16-mipsel-1.6.2.tar.bz2) = 58423bc439d5b89df6395ada06838632b1e78a8f
+RMD160 (compat16-mipsel-1.6.2.tar.bz2) = 09a3cef7e7c8df811e7ccd541644a83ad4c72174
+Size (compat16-mipsel-1.6.2.tar.bz2) = 1266504 bytes
+SHA1 (compat16-powerpc-1.6.2.tar.bz2) = 58f0c04b25d9772274f5fcdc837e9369bef820c6
+RMD160 (compat16-powerpc-1.6.2.tar.bz2) = cb71b8671f3e945741340732225b65ec94be6b62
+Size (compat16-powerpc-1.6.2.tar.bz2) = 980269 bytes
+SHA1 (compat16-sparc-1.6.2.tar.bz2) = 6b7eaa891d2ecb0b9c88f40669574d26060a2b9c
+RMD160 (compat16-sparc-1.6.2.tar.bz2) = af3002f85c787cbacc81406710b0b24c1d0426e6
+Size (compat16-sparc-1.6.2.tar.bz2) = 944819 bytes
+SHA1 (compat16-sparc64-1.6.2.tar.bz2) = 2d83596eee9354291c86fd2a380062356826da7f
+RMD160 (compat16-sparc64-1.6.2.tar.bz2) = 488d55db1fc3ca524289c3abffaf1d1080eb5c63
+Size (compat16-sparc64-1.6.2.tar.bz2) = 930975 bytes
+SHA1 (compat16-vax-1.6.2.tar.bz2) = 4c22f7caa6417ae05029110241a131c55141296b
+RMD160 (compat16-vax-1.6.2.tar.bz2) = b6f5daef6be3f74e977e20aba9033b83a26e1de8
+Size (compat16-vax-1.6.2.tar.bz2) = 715323 bytes
diff --git a/emulators/compat16/emulator.mk b/emulators/compat16/emulator.mk
new file mode 100644
index 00000000000..7bd8b3153eb
--- /dev/null
+++ b/emulators/compat16/emulator.mk
@@ -0,0 +1,43 @@
+# $NetBSD: emulator.mk,v 1.1 2007/08/21 22:49:16 jlam Exp $
+#
+# This file is included by netbsd-compat.mk in the emulator framework.
+#
+# Variables set by this file:
+#
+# EMUL_DISTRO
+# The NetBSD distribution used to provide the files.
+#
+# EMUL_EXEC_FMT
+# The executable format of the emulated operating system.
+#
+# EMULSUBDIR
+# Path relative to ${PREFIX} where the files and directories are
+# located, e.g. emul/aout.
+#
+# DEPENDS_${EMUL_DISTRO}.*
+# A table that maps "modules" to NetBSD package dependencies.
+#
+
+EMUL_DISTRO= netbsd-1.6
+
+EMUL_EXEC_FMT= ELF
+EMULSUBDIR= emul/netbsd
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.netbsd}
+
+# For COMPAT_NETBSD32, we always need the dependency to supply 32-bit
+# shared libaries for NetBSD-1.6.
+#
+.if ((${EMUL_ARCH} == "i386") && (${MACHINE_ARCH} == "x86_64")) || \
+ ((${EMUL_ARCH} == "sparc") && (${MACHINE_ARCH} == "sparc64"))
+EMULSUBDIR= emul/netbsd32
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.netbsd32}
+
+DEPENDS_netbsd-1.6.base?= netbsd32_compat16>=1.6:../../emulators/netbsd32_compat16
+#
+# We need to depend on the compat16 package to supply missing shared
+# libraries only on NetBSD>1.6.
+#
+.elif empty(OS_VERSION:M0.[0-9]*) && empty(OS_VERSION:M1.[0-5]*) && \
+ empty(OS_VERSION:M1.6) && empty(OS_VERSION:M1.6.*)
+DEPENDS_netbsd-1.6.base?= compat16>=1.6:../../emulators/compat16
+.endif
diff --git a/emulators/compat20-extras/DESCR b/emulators/compat20-extras/DESCR
new file mode 100644
index 00000000000..7cf138e20bb
--- /dev/null
+++ b/emulators/compat20-extras/DESCR
@@ -0,0 +1,4 @@
+This package supplies the extra user files needed to run dynamically
+linked executables compiled under NetBSD 2.0, including user files
+that might be found in NetBSD versions beyond 2.0 that are missing
+from the pkgsrc/emulators/compat20 package.
diff --git a/emulators/compat20-extras/Makefile b/emulators/compat20-extras/Makefile
new file mode 100644
index 00000000000..a36a34a3a30
--- /dev/null
+++ b/emulators/compat20-extras/Makefile
@@ -0,0 +1,25 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:19 jlam Exp $
+
+DISTNAME= compat20-extras # overridden below
+NETBSD_VERSION= 2.0
+
+HOMEPAGE= http://www.NetBSD.org/Releases/formal-2.0/index.html
+COMMENT= Additional shared libraries for NetBSD 2.0 compatibility
+
+EMUL_PLATFORMS= netbsd-i386 netbsd-sparc
+
+.include "../../emulators/compat_netbsd/Makefile.common"
+
+DISTNAME= compat20-extras-${EMUL_ARCH}-2.1
+
+# This package should only be installed for COMPAT_NETBSD32 emulation
+# on machines running NetBSD-2.x.
+#
+.if defined(NETBSD_COMPAT32)
+ACCEPTABLE_NETBSD= NetBSD-1.6[A-Z]* NetBSD-2.[0-9] \
+ NetBSD-2.[1-8][0-9].* NetBSD-2.9[0-8].*
+.else
+NOT_FOR_PLATFORM= NetBSD-*-${MACHINE_ARCH}
+.endif
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/compat20-extras/PLIST b/emulators/compat20-extras/PLIST
new file mode 100644
index 00000000000..14c0c172965
--- /dev/null
+++ b/emulators/compat20-extras/PLIST
@@ -0,0 +1,295 @@
+@comment $NetBSD: PLIST,v 1.1 2007/08/21 22:49:19 jlam Exp $
+${EMULSUBDIRSLASH}lib/libc.so.12
+${EMULSUBDIRSLASH}lib/libc.so.12.114.1
+${EMULSUBDIRSLASH}lib/libcrypt.so.0
+${EMULSUBDIRSLASH}lib/libcrypt.so.0.1
+${EMULSUBDIRSLASH}lib/libcrypto.so.2
+${EMULSUBDIRSLASH}lib/libcrypto.so.2.1
+${EMULSUBDIRSLASH}lib/libedit.so.2
+${EMULSUBDIRSLASH}lib/libedit.so.2.9
+${EMULSUBDIRSLASH}lib/libevent.so.0
+${EMULSUBDIRSLASH}lib/libevent.so.0.1
+${EMULSUBDIRSLASH}lib/libipsec.so.2
+${EMULSUBDIRSLASH}lib/libipsec.so.2.0
+${EMULSUBDIRSLASH}lib/libkvm.so.5
+${EMULSUBDIRSLASH}lib/libkvm.so.5.2
+${EMULSUBDIRSLASH}lib/libm.so.0
+${EMULSUBDIRSLASH}lib/libm.so.0.1.1
+${EMULSUBDIRSLASH}lib/libtermcap.so.0
+${EMULSUBDIRSLASH}lib/libtermcap.so.0.5
+${EMULSUBDIRSLASH}lib/libtermlib.so.0
+${EMULSUBDIRSLASH}lib/libtermlib.so.0.5
+${EMULSUBDIRSLASH}lib/libutil.so.7
+${EMULSUBDIRSLASH}lib/libutil.so.7.3
+${EMULSUBDIRSLASH}lib/libz.so.0
+${EMULSUBDIRSLASH}lib/libz.so.0.4
+${EMULSUBDIRSLASH}libexec/ld.elf_so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libFS.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libFS.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libFS.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGL.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGL.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGL.so.1.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLU.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLU.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLU.so.1.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLw.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLw.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLw.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libOSMesa.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libOSMesa.so.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libOSMesa.so.4.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXRes.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXRes.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXRes.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXTrap.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXTrap.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXTrap.so.6.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXau.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXau.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXau.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.7
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.7.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXcursor.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXcursor.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXcursor.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXdmcp.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXdmcp.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXdmcp.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfont.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfont.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfont.so.1.5
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfontcache.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfontcache.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfontcache.so.1.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.1.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.2.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXinerama.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXinerama.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXinerama.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmuu.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmuu.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmuu.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXpm.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXpm.so.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXpm.so.4.11
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrandr.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrandr.so.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrandr.so.2.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrender.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrender.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrender.so.1.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXss.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXss.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXss.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXv.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXv.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXv.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXvMC.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXvMC.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXvMC.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86dga.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86dga.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86dga.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86misc.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86misc.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86misc.so.1.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86vm.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86vm.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86vm.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdps.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdps.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdps.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdpstk.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdpstk.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdpstk.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libexpat.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libexpat.so.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libexpat.so.4.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontconfig.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontconfig.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontconfig.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontenc.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontenc.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontenc.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfreetype.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfreetype.so.9
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfreetype.so.9.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libpsres.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libpsres.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libpsres.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbfile.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbfile.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbfile.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbui.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbui.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbui.so.1.0
+${EMULSUBDIRSLASH}usr/lib/i18n/libBIG5.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libBIG5.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUC.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUC.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUCTW.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUCTW.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libGBK2K.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libGBK2K.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libISO2022.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libISO2022.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libMSKanji.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libMSKanji.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF1632.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF1632.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF8.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF8.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libiconv_none.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libiconv_none.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libiconv_std.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libiconv_std.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_646.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_646.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_none.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_none.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_parallel.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_parallel.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_serial.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_serial.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_std.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_std.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_zone.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_zone.so.4.3
+${EMULSUBDIRSLASH}usr/lib/libamu.so.2
+${EMULSUBDIRSLASH}usr/lib/libamu.so.2.1
+${EMULSUBDIRSLASH}usr/lib/libasn1.so.6
+${EMULSUBDIRSLASH}usr/lib/libasn1.so.6.1
+${EMULSUBDIRSLASH}usr/lib/libbsdmalloc.so.0
+${EMULSUBDIRSLASH}usr/lib/libbsdmalloc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libbz2.so.1
+${EMULSUBDIRSLASH}usr/lib/libbz2.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libc.so.12
+${EMULSUBDIRSLASH}usr/lib/libc.so.12.114.1
+${EMULSUBDIRSLASH}usr/lib/libcdk.so.1
+${EMULSUBDIRSLASH}usr/lib/libcdk.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.4
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.4.1
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so.0
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libcrypto.so.2
+${EMULSUBDIRSLASH}usr/lib/libcrypto.so.2.1
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.6
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.6.1
+${EMULSUBDIRSLASH}usr/lib/libdes.so.7
+${EMULSUBDIRSLASH}usr/lib/libdes.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libedit.so.2
+${EMULSUBDIRSLASH}usr/lib/libedit.so.2.9
+${EMULSUBDIRSLASH}usr/lib/libevent.so.0
+${EMULSUBDIRSLASH}usr/lib/libevent.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libgcc_s.so.1
+${EMULSUBDIRSLASH}usr/lib/libgcc_s.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so.0
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libgssapi.so.5
+${EMULSUBDIRSLASH}usr/lib/libgssapi.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libhdb.so.9
+${EMULSUBDIRSLASH}usr/lib/libhdb.so.9.0
+${EMULSUBDIRSLASH}usr/lib/libintl.so.0
+${EMULSUBDIRSLASH}usr/lib/libintl.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libipsec.so.2
+${EMULSUBDIRSLASH}usr/lib/libipsec.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.5
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libkadm5clnt.so.8
+${EMULSUBDIRSLASH}usr/lib/libkadm5clnt.so.8.0
+${EMULSUBDIRSLASH}usr/lib/libkadm5srv.so.9
+${EMULSUBDIRSLASH}usr/lib/libkadm5srv.so.9.0
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.6
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.5
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.6
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libkrb5.so.19
+${EMULSUBDIRSLASH}usr/lib/libkrb5.so.19.1
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.2
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5.2
+${EMULSUBDIRSLASH}usr/lib/libm.so.0
+${EMULSUBDIRSLASH}usr/lib/libm.so.0.1.1
+${EMULSUBDIRSLASH}usr/lib/libmagic.so.0
+${EMULSUBDIRSLASH}usr/lib/libmagic.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libmenu.so.5
+${EMULSUBDIRSLASH}usr/lib/libmenu.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.2
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so.0
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.1
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.1.3
+${EMULSUBDIRSLASH}usr/lib/libposix.so.0
+${EMULSUBDIRSLASH}usr/lib/libposix.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libpthread.so.0
+${EMULSUBDIRSLASH}usr/lib/libpthread.so.0.4
+${EMULSUBDIRSLASH}usr/lib/libpthread_dbg.so.0
+${EMULSUBDIRSLASH}usr/lib/libpthread_dbg.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libresolv.so.1
+${EMULSUBDIRSLASH}usr/lib/libresolv.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libroken.so.12
+${EMULSUBDIRSLASH}usr/lib/libroken.so.12.3
+${EMULSUBDIRSLASH}usr/lib/librt.so.0
+${EMULSUBDIRSLASH}usr/lib/librt.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libskey.so.1
+${EMULSUBDIRSLASH}usr/lib/libskey.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libsl.so.2
+${EMULSUBDIRSLASH}usr/lib/libsl.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libss.so.4
+${EMULSUBDIRSLASH}usr/lib/libss.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libssl.so.3
+${EMULSUBDIRSLASH}usr/lib/libssl.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so.0
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so.0.5
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so.0
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so.0.5
+${EMULSUBDIRSLASH}usr/lib/libusbhid.so.1
+${EMULSUBDIRSLASH}usr/lib/libusbhid.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so.7
+${EMULSUBDIRSLASH}usr/lib/libutil.so.7.3
+${EMULSUBDIRSLASH}usr/lib/libwrap.so.0
+${EMULSUBDIRSLASH}usr/lib/libwrap.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libz.so.0
+${EMULSUBDIRSLASH}usr/lib/libz.so.0.4
+${EMULSUBDIRSLASH}usr/libexec/ld.elf_so
+${EMULSUBDIRSLASH}usr/libexec/ld.so
+@dirrm ${EMULSUBDIRSLASH}usr/libexec
+@dirrm ${EMULSUBDIRSLASH}usr/lib/i18n
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
+@dirrm ${EMULSUBDIRSLASH}usr
+@dirrm ${EMULSUBDIRSLASH}libexec
+@dirrm ${EMULSUBDIRSLASH}lib
diff --git a/emulators/compat20-extras/PLIST.i386 b/emulators/compat20-extras/PLIST.i386
new file mode 100644
index 00000000000..8e5a124dc20
--- /dev/null
+++ b/emulators/compat20-extras/PLIST.i386
@@ -0,0 +1,9 @@
+@comment $NetBSD: PLIST.i386,v 1.1 2007/08/21 22:49:19 jlam Exp $
+${EMULSUBDIRSLASH}lib/libm387.so.0
+${EMULSUBDIRSLASH}lib/libm387.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libi386.so.1
+${EMULSUBDIRSLASH}usr/lib/libi386.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libm387.so.0
+${EMULSUBDIRSLASH}usr/lib/libm387.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libpmc.so.0
+${EMULSUBDIRSLASH}usr/lib/libpmc.so.0.0
diff --git a/emulators/compat20-extras/PLIST.sparc b/emulators/compat20-extras/PLIST.sparc
new file mode 100644
index 00000000000..9743a4b252c
--- /dev/null
+++ b/emulators/compat20-extras/PLIST.sparc
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST.sparc,v 1.1 2007/08/21 22:49:19 jlam Exp $
+${EMULSUBDIRSLASH}lib/libsparc_v8.so.0
+${EMULSUBDIRSLASH}lib/libsparc_v8.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libsparc_v8.so.0
+${EMULSUBDIRSLASH}usr/lib/libsparc_v8.so.0.0
diff --git a/emulators/compat20-extras/distinfo b/emulators/compat20-extras/distinfo
new file mode 100644
index 00000000000..eb0494ea7c3
--- /dev/null
+++ b/emulators/compat20-extras/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2007/08/21 22:49:19 jlam Exp $
+
+SHA1 (compat20-extras-i386-2.1.tar.bz2) = 8012c02de7401c2f78b7bf9388125730a1e78a1d
+RMD160 (compat20-extras-i386-2.1.tar.bz2) = d6e606964b69f18889c783a89d092aa66d8f7422
+Size (compat20-extras-i386-2.1.tar.bz2) = 4606393 bytes
+SHA1 (compat20-extras-sparc-2.1.tar.bz2) = 74398b762c5905e8ecd90b3c7bc5c6cf802a1721
+RMD160 (compat20-extras-sparc-2.1.tar.bz2) = 0ec0c2d93cb3265321e556e9a0da825ab900347d
+Size (compat20-extras-sparc-2.1.tar.bz2) = 4848626 bytes
diff --git a/emulators/compat20/DESCR b/emulators/compat20/DESCR
new file mode 100644
index 00000000000..d96d4ed6560
--- /dev/null
+++ b/emulators/compat20/DESCR
@@ -0,0 +1,2 @@
+This package supplies the user files needed to run dynamically linked
+executables compiled under NetBSD 2.0.
diff --git a/emulators/compat20/MESSAGE b/emulators/compat20/MESSAGE
new file mode 100644
index 00000000000..f63a6f6ea53
--- /dev/null
+++ b/emulators/compat20/MESSAGE
@@ -0,0 +1,7 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2007/08/21 22:49:18 jlam Exp $
+
+The COMPAT_20 option must be included in the kernel configuration (and
+possibly others; see options(4) for more information) to make use of
+NetBSD 2.0 binaries.
+===========================================================================
diff --git a/emulators/compat20/Makefile b/emulators/compat20/Makefile
new file mode 100644
index 00000000000..f10c98e2cb3
--- /dev/null
+++ b/emulators/compat20/Makefile
@@ -0,0 +1,53 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:18 jlam Exp $
+
+DISTNAME= compat20 # overridden below
+NETBSD_VERSION= 2.0
+
+HOMEPAGE= http://www.NetBSD.org/Releases/formal-2.0/index.html
+COMMENT= Shared libraries for NetBSD 2.0 compatibility
+
+.if defined(NETBSD_COMPAT32)
+EMUL_PLATFORMS= netbsd-i386 netbsd-sparc
+
+ACCEPTABLE_NETBSD= NetBSD-1.6[A-Z]* NetBSD-2.[0-9] \
+ NetBSD-2.[1-8][0-9]* NetBSD-2.9[0-8]* \
+ NetBSD-2.99.* NetBSD-[3-9]* NetBSD-[1-9][0-9]*
+.else
+EMUL_PLATFORMS= netbsd-alpha netbsd-arm netbsd-i386 netbsd-m68k \
+ netbsd-mipseb netbsd-mipsel netbsd-powerpc \
+ netbsd-sh3eb netbsd-sh3el netbsd-sparc \
+ netbsd-sparc64 netbsd-vax netbsd-x86_64
+
+ONLY_FOR_PLATFORM= NetBSD-2.99.*-* NetBSD-[3-9]*-* NetBSD-[1-9][0-9]*-*
+.endif
+
+.include "../../emulators/compat_netbsd/Makefile.common"
+
+DISTNAME= compat20-${EMUL_ARCH}-${COMPAT_VERSION}
+COMPAT_VERSION= 2.1
+
+# For COMPAT_NETBSD32, we need to depend on the compat20-extras package
+# on NetBSD-2.0 to supply the missing shared libraries; otherwise, we
+# just depend on the compat30 package for the missing shared libraries.
+#
+.if defined(NETBSD_COMPAT32)
+COMPAT_EXTRAS= # empty
+. for _netbsd_ in ${ACCEPTABLE_NETBSD}
+COMPAT_EXTRAS= netbsd32_compat20-extras-${COMPAT_VERSION}{,nb*}:../../emulators/netbsd32_compat20-extras
+. endfor
+. if !empty(COMPAT_EXTRAS)
+DEPENDS+= ${COMPAT_EXTRAS}
+. else
+DEPENDS+= netbsd32_compat30>=3.0:../../emulators/netbsd32_compat30
+. endif
+#
+# We need to depend on the compat30 package to supply shared libraries
+# missing from compat20 on NetBSD>3.x.
+#
+.elif empty(OS_VERSION:M[0-2].*) && empty(OS_VERSION:M3.[0-9]) && \
+ empty(OS_VERSION:M3.[0-9].*) && empty(OS_VERSION:M3.[1-8][0-9].*) && \
+ empty(OS_VERSION:M3.9[0-8]*)
+DEPENDS+= compat30>=3.0:../../emulators/compat30
+.endif
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/compat20/PLIST b/emulators/compat20/PLIST
new file mode 100644
index 00000000000..87bb7e8f582
--- /dev/null
+++ b/emulators/compat20/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1 2007/08/21 22:49:18 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libform.so.4
+${EMULSUBDIRSLASH}usr/lib/libform.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libpci.so.0
+${EMULSUBDIRSLASH}usr/lib/libpci.so.0.0
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr
diff --git a/emulators/compat20/distinfo b/emulators/compat20/distinfo
new file mode 100644
index 00000000000..7821a9e51a3
--- /dev/null
+++ b/emulators/compat20/distinfo
@@ -0,0 +1,41 @@
+$NetBSD: distinfo,v 1.1 2007/08/21 22:49:18 jlam Exp $
+
+SHA1 (compat20-alpha-2.1.tar.bz2) = 42446071fef6565083979b80412be9909547a2ae
+RMD160 (compat20-alpha-2.1.tar.bz2) = 565a8e7d9e8cd313739a8ec01f65bc3e2395e48f
+Size (compat20-alpha-2.1.tar.bz2) = 83426 bytes
+SHA1 (compat20-arm-2.1.tar.bz2) = 1c1778167a0669ddbcc8b18f43fbdb7c43272042
+RMD160 (compat20-arm-2.1.tar.bz2) = b794dda9f2c8195b438f23746d6bb8ba3872a734
+Size (compat20-arm-2.1.tar.bz2) = 70140 bytes
+SHA1 (compat20-i386-2.1.tar.bz2) = d2804112f0f68deef0075c12dcec750931622ded
+RMD160 (compat20-i386-2.1.tar.bz2) = e8fcf514e853f6d55aef9adc9a59af0b36c25712
+Size (compat20-i386-2.1.tar.bz2) = 70032 bytes
+SHA1 (compat20-m68k-2.1.tar.bz2) = 61b95f0dd02e0e6959075f064f945d677779c299
+RMD160 (compat20-m68k-2.1.tar.bz2) = 839db7aa4b2b5362cd1b3dc973c932ccb70665f1
+Size (compat20-m68k-2.1.tar.bz2) = 77997 bytes
+SHA1 (compat20-mipseb-2.1.tar.bz2) = 1cdfe07a0bced883ec9a165d026f494012736eaf
+RMD160 (compat20-mipseb-2.1.tar.bz2) = 25c398f6697f385fa3a3b01f8f396c0f39518b53
+Size (compat20-mipseb-2.1.tar.bz2) = 85642 bytes
+SHA1 (compat20-mipsel-2.1.tar.bz2) = 2c986d48fc687e86994003b92f389efb675ea97e
+RMD160 (compat20-mipsel-2.1.tar.bz2) = 662609fd815cf46d0331db9f3da81c758529c713
+Size (compat20-mipsel-2.1.tar.bz2) = 88686 bytes
+SHA1 (compat20-powerpc-2.1.tar.bz2) = 9334d01bbdd25f5a4143f0090458c145b2add36f
+RMD160 (compat20-powerpc-2.1.tar.bz2) = cbeae61f90614cc14efa6ae7681546ef0a8ef827
+Size (compat20-powerpc-2.1.tar.bz2) = 87483 bytes
+SHA1 (compat20-sh3eb-2.1.tar.bz2) = f046e0b91b752d9b698f3a42c92f48c9b0a371a5
+RMD160 (compat20-sh3eb-2.1.tar.bz2) = e589319e79ece2b309a9ff77d88df2c899fe5903
+Size (compat20-sh3eb-2.1.tar.bz2) = 80374 bytes
+SHA1 (compat20-sh3el-2.1.tar.bz2) = f310f27ea3b51f43b902ad9e7b7cd94617b978de
+RMD160 (compat20-sh3el-2.1.tar.bz2) = c14eb2f85a00c424aede18da0921a07656cdb4f7
+Size (compat20-sh3el-2.1.tar.bz2) = 80173 bytes
+SHA1 (compat20-sparc-2.1.tar.bz2) = 296b5edde3607a6373ee4ee1700218dba008f4cc
+RMD160 (compat20-sparc-2.1.tar.bz2) = 03277161e3d9685d3ba3215f535c04f07b4a9663
+Size (compat20-sparc-2.1.tar.bz2) = 71156 bytes
+SHA1 (compat20-sparc64-2.1.tar.bz2) = 858e01fb5cd426f6add5c3b9dfc087e9a9a64ce9
+RMD160 (compat20-sparc64-2.1.tar.bz2) = c7151bed2cfa5d96d94b04ce6215ef263ac7745d
+Size (compat20-sparc64-2.1.tar.bz2) = 72954 bytes
+SHA1 (compat20-vax-2.1.tar.bz2) = 5028934b1d234bc36ab4b555d82dfdcb021e6464
+RMD160 (compat20-vax-2.1.tar.bz2) = 7106dac6a3a4c19ffdfac1ebf807f7f50848a224
+Size (compat20-vax-2.1.tar.bz2) = 74833 bytes
+SHA1 (compat20-x86_64-2.1.tar.bz2) = fa1992c745c0768e4f6f1a4e8ba4399f9532a4f8
+RMD160 (compat20-x86_64-2.1.tar.bz2) = dfcdb3e1e979bbf0664d5df67265952ac10989ec
+Size (compat20-x86_64-2.1.tar.bz2) = 83540 bytes
diff --git a/emulators/compat20/emulator.mk b/emulators/compat20/emulator.mk
new file mode 100644
index 00000000000..2368932cd9e
--- /dev/null
+++ b/emulators/compat20/emulator.mk
@@ -0,0 +1,44 @@
+# $NetBSD: emulator.mk,v 1.1 2007/08/21 22:49:18 jlam Exp $
+#
+# This file is included by netbsd-compat.mk in the emulator framework.
+#
+# Variables set by this file:
+#
+# EMUL_DISTRO
+# The NetBSD distribution used to provide the files.
+#
+# EMUL_EXEC_FMT
+# The executable format of the emulated operating system.
+#
+# EMULSUBDIR
+# Path relative to ${PREFIX} where the files and directories are
+# located, e.g. emul/aout.
+#
+# DEPENDS_${EMUL_DISTRO}.*
+# A table that maps "modules" to NetBSD package dependencies.
+#
+
+EMUL_DISTRO= netbsd-2.0
+
+EMUL_EXEC_FMT= ELF
+EMULSUBDIR= emul/netbsd
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.netbsd}
+
+# For COMPAT_NETBSD32, we always need the dependency to supply 32-bit
+# shared libaries for NetBSD-2.0.
+#
+.if ((${EMUL_ARCH} == "i386") && (${MACHINE_ARCH} == "x86_64")) || \
+ ((${EMUL_ARCH} == "sparc") && (${MACHINE_ARCH} == "sparc64"))
+EMULSUBDIR= emul/netbsd32
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.netbsd32}
+
+DEPENDS_netbsd-2.0.base?= netbsd32_compat20>=2.0:../../emulators/netbsd32_compat20
+#
+# We need to depend on the compat20 package to supply missing shared
+# libraries only on NetBSD>2.0.
+#
+.elif empty(OS_VERSION:M[0-1].*) && empty(OS_VERSION:M2.[0-9]) && \
+ empty(OS_VERSION:M2.[0-9].*) && empty(OS_VERSION:M2.[1-8][0-9].*) && \
+ empty(OS_VERSION:M2.9[0-8]*)
+DEPENDS_netbsd-2.0.base?= compat20>=2.0:../../emulators/compat20
+.endif
diff --git a/emulators/compat30-extras/DESCR b/emulators/compat30-extras/DESCR
new file mode 100644
index 00000000000..7cf138e20bb
--- /dev/null
+++ b/emulators/compat30-extras/DESCR
@@ -0,0 +1,4 @@
+This package supplies the extra user files needed to run dynamically
+linked executables compiled under NetBSD 2.0, including user files
+that might be found in NetBSD versions beyond 2.0 that are missing
+from the pkgsrc/emulators/compat20 package.
diff --git a/emulators/compat30-extras/Makefile b/emulators/compat30-extras/Makefile
new file mode 100644
index 00000000000..b0101ac279e
--- /dev/null
+++ b/emulators/compat30-extras/Makefile
@@ -0,0 +1,28 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:23 jlam Exp $
+
+DISTNAME= compat30-extras # overridden below
+NETBSD_VERSION= 3.0
+
+HOMEPAGE= http://www.NetBSD.org/Releases/formal-3.0/index.html
+COMMENT= Additional shared libraries for NetBSD 3.0 compatibility
+
+EMUL_PLATFORMS= netbsd-i386 netbsd-sparc netbsd-vax
+
+.include "../../emulators/compat_netbsd/Makefile.common"
+
+DISTNAME= compat30-extras-${EMUL_ARCH}-3.1
+
+# This package should only be installed for COMPAT_NETBSD32 emulation
+# on machines running NetBSD-3.x, or on vax running NetBSD-4.x which
+# lacks any shared libraries.
+#
+.if defined(NETBSD_COMPAT32)
+ACCEPTABLE_NETBSD= NetBSD-2.99.* NetBSD-3.[0-9] \
+ NetBSD-3.[1-8][0-9].* NetBSD-3.9[0-8].*
+.else
+ACCEPTABLE_NETBSD= NetBSD-3.99.* NetBSD-4.[0-9] \
+ NetBSD-4.[1-8][0-9].* NetBSD-4.9[0-8].*
+ONLY_FOR_PLATFORM= ${ACCEPTABLE_OPSYS:S/$/-vax/}
+.endif
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/compat30-extras/PLIST b/emulators/compat30-extras/PLIST
new file mode 100644
index 00000000000..33a33fcf6b6
--- /dev/null
+++ b/emulators/compat30-extras/PLIST
@@ -0,0 +1,381 @@
+@comment $NetBSD: PLIST,v 1.1 2007/08/21 22:49:24 jlam Exp $
+${EMULSUBDIRSLASH}lib/libc.so
+${EMULSUBDIRSLASH}lib/libc.so.12
+${EMULSUBDIRSLASH}lib/libc.so.12.128.2
+${EMULSUBDIRSLASH}lib/libcrypt.so
+${EMULSUBDIRSLASH}lib/libcrypt.so.0
+${EMULSUBDIRSLASH}lib/libcrypt.so.0.2
+${EMULSUBDIRSLASH}lib/libcrypto.so
+${EMULSUBDIRSLASH}lib/libedit.so
+${EMULSUBDIRSLASH}lib/libedit.so.2
+${EMULSUBDIRSLASH}lib/libedit.so.2.9
+${EMULSUBDIRSLASH}lib/libevent.so
+${EMULSUBDIRSLASH}lib/libipsec.so
+${EMULSUBDIRSLASH}lib/libipsec.so.2
+${EMULSUBDIRSLASH}lib/libipsec.so.2.1
+${EMULSUBDIRSLASH}lib/libkvm.so
+${EMULSUBDIRSLASH}lib/libkvm.so.5
+${EMULSUBDIRSLASH}lib/libkvm.so.5.2
+${EMULSUBDIRSLASH}lib/libm.so
+${EMULSUBDIRSLASH}lib/libm.so.0
+${EMULSUBDIRSLASH}lib/libm.so.0.2
+${EMULSUBDIRSLASH}lib/libradius.so
+${EMULSUBDIRSLASH}lib/libtermcap.so
+${EMULSUBDIRSLASH}lib/libtermcap.so.0
+${EMULSUBDIRSLASH}lib/libtermcap.so.0.5
+${EMULSUBDIRSLASH}lib/libtermlib.so
+${EMULSUBDIRSLASH}lib/libtermlib.so.0
+${EMULSUBDIRSLASH}lib/libtermlib.so.0.5
+${EMULSUBDIRSLASH}lib/libutil.so
+${EMULSUBDIRSLASH}lib/libutil.so.7
+${EMULSUBDIRSLASH}lib/libutil.so.7.6
+${EMULSUBDIRSLASH}lib/libz.so
+${EMULSUBDIRSLASH}libexec/ld.elf_so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libFS.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libFS.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libFS.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGL.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGL.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGL.so.1.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLU.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLU.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLU.so.1.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLw.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLw.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libGLw.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libICE.so.6.3
+${EMULSUBDIRSLASH}usr/X11R6/lib/libOSMesa.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libOSMesa.so.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libOSMesa.so.4.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libSM.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libX11.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXRes.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXRes.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXRes.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXTrap.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXTrap.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXTrap.so.6.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXau.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXau.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXau.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.7
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXaw.so.7.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXcursor.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXcursor.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXcursor.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXdmcp.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXdmcp.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXdmcp.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXext.so.6.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfont.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfont.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfont.so.1.5
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfontcache.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfontcache.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXfontcache.so.1.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.1.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXft.so.2.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXi.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXinerama.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXinerama.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXinerama.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmu.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmuu.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmuu.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXmuu.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXp.so.6.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXpm.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXpm.so.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXpm.so.4.11
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrandr.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrandr.so.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrandr.so.2.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrender.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrender.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXrender.so.1.2
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXss.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXss.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXss.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXt.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXtst.so.6.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXv.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXv.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXv.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXvMC.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXvMC.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXvMC.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86dga.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86dga.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86dga.so.1.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86misc.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86misc.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86misc.so.1.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86vm.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86vm.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libXxf86vm.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdmx.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdmx.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdmx.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdps.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdps.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdps.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdpstk.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdpstk.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libdpstk.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libexpat.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libexpat.so.4
+${EMULSUBDIRSLASH}usr/X11R6/lib/libexpat.so.4.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontconfig.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontconfig.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontconfig.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontenc.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontenc.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfontenc.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfreetype.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfreetype.so.9
+${EMULSUBDIRSLASH}usr/X11R6/lib/libfreetype.so.9.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6
+${EMULSUBDIRSLASH}usr/X11R6/lib/liboldX.so.6.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libpsres.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libpsres.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libpsres.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbfile.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbfile.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbfile.so.1.0
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbui.so
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbui.so.1
+${EMULSUBDIRSLASH}usr/X11R6/lib/libxkbui.so.1.0
+${EMULSUBDIRSLASH}usr/lib/i18n/libBIG5.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libBIG5.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libBIG5.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUC.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUC.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUC.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUCTW.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUCTW.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libEUCTW.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libGBK2K.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libGBK2K.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libGBK2K.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libISO2022.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libISO2022.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libISO2022.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libMSKanji.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libMSKanji.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libMSKanji.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF1632.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF1632.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF1632.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF7.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF7.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF7.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF8.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF8.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libUTF8.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libiconv_none.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libiconv_none.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libiconv_none.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libiconv_std.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libiconv_std.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libiconv_std.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_646.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_646.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_646.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_none.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_none.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_none.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_parallel.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_parallel.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_parallel.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_serial.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_serial.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_serial.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_std.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_std.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_std.so.4.3
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_zone.so
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_zone.so.4
+${EMULSUBDIRSLASH}usr/lib/i18n/libmapper_zone.so.4.3
+${EMULSUBDIRSLASH}usr/lib/libasn1.so
+${EMULSUBDIRSLASH}usr/lib/libasn1.so.6
+${EMULSUBDIRSLASH}usr/lib/libasn1.so.6.1
+${EMULSUBDIRSLASH}usr/lib/libbsdmalloc.so
+${EMULSUBDIRSLASH}usr/lib/libbsdmalloc.so.0
+${EMULSUBDIRSLASH}usr/lib/libbsdmalloc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libbz2.so
+${EMULSUBDIRSLASH}usr/lib/libbz2.so.1
+${EMULSUBDIRSLASH}usr/lib/libbz2.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libc.so
+${EMULSUBDIRSLASH}usr/lib/libc.so.12
+${EMULSUBDIRSLASH}usr/lib/libc.so.12.128.2
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.4
+${EMULSUBDIRSLASH}usr/lib/libcom_err.so.4.1
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so.0
+${EMULSUBDIRSLASH}usr/lib/libcrypt.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libcrypto.so
+${EMULSUBDIRSLASH}usr/lib/libcurses.so
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.6
+${EMULSUBDIRSLASH}usr/lib/libcurses.so.6.1
+${EMULSUBDIRSLASH}usr/lib/libdes.so
+${EMULSUBDIRSLASH}usr/lib/libdes.so.7
+${EMULSUBDIRSLASH}usr/lib/libdes.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libedit.so
+${EMULSUBDIRSLASH}usr/lib/libedit.so.2
+${EMULSUBDIRSLASH}usr/lib/libedit.so.2.9
+${EMULSUBDIRSLASH}usr/lib/libevent.so
+${EMULSUBDIRSLASH}usr/lib/libform.so
+${EMULSUBDIRSLASH}usr/lib/libform.so.5
+${EMULSUBDIRSLASH}usr/lib/libform.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so.0
+${EMULSUBDIRSLASH}usr/lib/libgnumalloc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libgssapi.so
+${EMULSUBDIRSLASH}usr/lib/libgssapi.so.5
+${EMULSUBDIRSLASH}usr/lib/libgssapi.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libhdb.so
+${EMULSUBDIRSLASH}usr/lib/libhdb.so.9
+${EMULSUBDIRSLASH}usr/lib/libhdb.so.9.0
+${EMULSUBDIRSLASH}usr/lib/libintl.so
+${EMULSUBDIRSLASH}usr/lib/libintl.so.0
+${EMULSUBDIRSLASH}usr/lib/libintl.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libipsec.so
+${EMULSUBDIRSLASH}usr/lib/libipsec.so.2
+${EMULSUBDIRSLASH}usr/lib/libipsec.so.2.1
+${EMULSUBDIRSLASH}usr/lib/libkadm5clnt.so
+${EMULSUBDIRSLASH}usr/lib/libkadm5clnt.so.8
+${EMULSUBDIRSLASH}usr/lib/libkadm5clnt.so.8.0
+${EMULSUBDIRSLASH}usr/lib/libkadm5srv.so
+${EMULSUBDIRSLASH}usr/lib/libkadm5srv.so.9
+${EMULSUBDIRSLASH}usr/lib/libkadm5srv.so.9.0
+${EMULSUBDIRSLASH}usr/lib/libkafs.so
+${EMULSUBDIRSLASH}usr/lib/libkrb5.so
+${EMULSUBDIRSLASH}usr/lib/libkvm.so
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5
+${EMULSUBDIRSLASH}usr/lib/libkvm.so.5.2
+${EMULSUBDIRSLASH}usr/lib/libm.so
+${EMULSUBDIRSLASH}usr/lib/libm.so.0
+${EMULSUBDIRSLASH}usr/lib/libm.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libmagic.so
+${EMULSUBDIRSLASH}usr/lib/libmenu.so
+${EMULSUBDIRSLASH}usr/lib/libmenu.so.5
+${EMULSUBDIRSLASH}usr/lib/libmenu.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so.0
+${EMULSUBDIRSLASH}usr/lib/libossaudio.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libpam.so
+${EMULSUBDIRSLASH}usr/lib/libpam.so.0
+${EMULSUBDIRSLASH}usr/lib/libpam.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libpcap.so
+${EMULSUBDIRSLASH}usr/lib/libpci.so
+${EMULSUBDIRSLASH}usr/lib/libpci.so.1
+${EMULSUBDIRSLASH}usr/lib/libpci.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libposix.so
+${EMULSUBDIRSLASH}usr/lib/libposix.so.0
+${EMULSUBDIRSLASH}usr/lib/libposix.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libpthread.so
+${EMULSUBDIRSLASH}usr/lib/libpthread.so.0
+${EMULSUBDIRSLASH}usr/lib/libpthread.so.0.6
+${EMULSUBDIRSLASH}usr/lib/libpthread_dbg.so
+${EMULSUBDIRSLASH}usr/lib/libpthread_dbg.so.0
+${EMULSUBDIRSLASH}usr/lib/libpthread_dbg.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libradius.so
+${EMULSUBDIRSLASH}usr/lib/libresolv.so
+${EMULSUBDIRSLASH}usr/lib/libresolv.so.1
+${EMULSUBDIRSLASH}usr/lib/libresolv.so.1.1
+${EMULSUBDIRSLASH}usr/lib/libroken.so
+${EMULSUBDIRSLASH}usr/lib/libroken.so.12
+${EMULSUBDIRSLASH}usr/lib/libroken.so.12.3
+${EMULSUBDIRSLASH}usr/lib/librpcsvc.so
+${EMULSUBDIRSLASH}usr/lib/librpcsvc.so.0
+${EMULSUBDIRSLASH}usr/lib/librpcsvc.so.0.0
+${EMULSUBDIRSLASH}usr/lib/librt.so
+${EMULSUBDIRSLASH}usr/lib/librt.so.0
+${EMULSUBDIRSLASH}usr/lib/librt.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libskey.so
+${EMULSUBDIRSLASH}usr/lib/libskey.so.1
+${EMULSUBDIRSLASH}usr/lib/libskey.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libsl.so
+${EMULSUBDIRSLASH}usr/lib/libsl.so.2
+${EMULSUBDIRSLASH}usr/lib/libsl.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libss.so
+${EMULSUBDIRSLASH}usr/lib/libss.so.4
+${EMULSUBDIRSLASH}usr/lib/libss.so.4.0
+${EMULSUBDIRSLASH}usr/lib/libssh.so
+${EMULSUBDIRSLASH}usr/lib/libssl.so
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so.0
+${EMULSUBDIRSLASH}usr/lib/libtermcap.so.0.5
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so.0
+${EMULSUBDIRSLASH}usr/lib/libtermlib.so.0.5
+${EMULSUBDIRSLASH}usr/lib/libusbhid.so
+${EMULSUBDIRSLASH}usr/lib/libusbhid.so.1
+${EMULSUBDIRSLASH}usr/lib/libusbhid.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libutil.so
+${EMULSUBDIRSLASH}usr/lib/libutil.so.7
+${EMULSUBDIRSLASH}usr/lib/libutil.so.7.6
+${EMULSUBDIRSLASH}usr/lib/libwrap.so
+${EMULSUBDIRSLASH}usr/lib/libwrap.so.0
+${EMULSUBDIRSLASH}usr/lib/libwrap.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libz.so
+${EMULSUBDIRSLASH}usr/lib/security/pam_chroot.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_deny.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_echo.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_exec.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_ftpusers.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_group.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_guest.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_krb5.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_ksu.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_lastlog.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_login_access.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_nologin.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_permit.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_radius.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_rhosts.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_rootok.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_securetty.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_self.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_skey.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_ssh.so.0
+${EMULSUBDIRSLASH}usr/lib/security/pam_unix.so.0
+${EMULSUBDIRSLASH}usr/libexec/ld.elf_so
+${EMULSUBDIRSLASH}usr/libexec/ld.so
+@dirrm ${EMULSUBDIRSLASH}usr/libexec
+@dirrm ${EMULSUBDIRSLASH}usr/lib/security
+@dirrm ${EMULSUBDIRSLASH}usr/lib/i18n
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6/lib
+@dirrm ${EMULSUBDIRSLASH}usr/X11R6
+@dirrm ${EMULSUBDIRSLASH}usr
+@dirrm ${EMULSUBDIRSLASH}libexec
+@dirrm ${EMULSUBDIRSLASH}lib
diff --git a/emulators/compat30-extras/PLIST.i386 b/emulators/compat30-extras/PLIST.i386
new file mode 100644
index 00000000000..0529839c3b8
--- /dev/null
+++ b/emulators/compat30-extras/PLIST.i386
@@ -0,0 +1,18 @@
+@comment $NetBSD: PLIST.i386,v 1.1 2007/08/21 22:49:24 jlam Exp $
+${EMULSUBDIRSLASH}lib/libm387.so
+${EMULSUBDIRSLASH}lib/libm387.so.0
+${EMULSUBDIRSLASH}lib/libm387.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libgcc_s.so
+${EMULSUBDIRSLASH}usr/lib/libgcc_s.so.1
+${EMULSUBDIRSLASH}usr/lib/libgcc_s.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libi386.so
+${EMULSUBDIRSLASH}usr/lib/libi386.so.1
+${EMULSUBDIRSLASH}usr/lib/libi386.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libm387.so
+${EMULSUBDIRSLASH}usr/lib/libm387.so.0
+${EMULSUBDIRSLASH}usr/lib/libm387.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.2
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libpmc.so
+${EMULSUBDIRSLASH}usr/lib/libpmc.so.0
+${EMULSUBDIRSLASH}usr/lib/libpmc.so.0.0
diff --git a/emulators/compat30-extras/PLIST.sparc b/emulators/compat30-extras/PLIST.sparc
new file mode 100644
index 00000000000..799da63088f
--- /dev/null
+++ b/emulators/compat30-extras/PLIST.sparc
@@ -0,0 +1,10 @@
+@comment $NetBSD: PLIST.sparc,v 1.1 2007/08/21 22:49:24 jlam Exp $
+${EMULSUBDIRSLASH}lib/libsparc_v8.so.0
+${EMULSUBDIRSLASH}lib/libsparc_v8.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libgcc_s.so
+${EMULSUBDIRSLASH}usr/lib/libgcc_s.so.1
+${EMULSUBDIRSLASH}usr/lib/libgcc_s.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.2
+${EMULSUBDIRSLASH}usr/lib/libobjc.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libsparc_v8.so.0
+${EMULSUBDIRSLASH}usr/lib/libsparc_v8.so.0.0
diff --git a/emulators/compat30-extras/PLIST.vax b/emulators/compat30-extras/PLIST.vax
new file mode 100644
index 00000000000..7871e7eb40d
--- /dev/null
+++ b/emulators/compat30-extras/PLIST.vax
@@ -0,0 +1,8 @@
+-@comment $NetBSD: PLIST.vax,v 1.1 2007/08/21 22:49:24 jlam Exp $
++${EMULSUBDIRSLASH}usr/lib/libg2c.so
++${EMULSUBDIRSLASH}usr/lib/libg2c.so.1
++${EMULSUBDIRSLASH}usr/lib/libg2c.so.1.0
++${EMULSUBDIRSLASH}usr/lib/libobjc.so.1
++${EMULSUBDIRSLASH}usr/lib/libobjc.so.1.0
++${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4
++${EMULSUBDIRSLASH}usr/lib/libstdc++.so.4.0
diff --git a/emulators/compat30-extras/distinfo b/emulators/compat30-extras/distinfo
new file mode 100644
index 00000000000..9eac3674a79
--- /dev/null
+++ b/emulators/compat30-extras/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1 2007/08/21 22:49:24 jlam Exp $
+
+SHA1 (compat30-extras-i386-3.1.tar.bz2) = 01be7266bd9c36f1dbe7e35eb43d79bf560ebf67
+RMD160 (compat30-extras-i386-3.1.tar.bz2) = ed2c13b4be2813d3fe6563af7bbe9d1ed39cb43d
+Size (compat30-extras-i386-3.1.tar.bz2) = 3887399 bytes
+SHA1 (compat30-extras-sparc-3.1.tar.bz2) = 0fbe3180b80d143831533451ebe94105027beb09
+RMD160 (compat30-extras-sparc-3.1.tar.bz2) = 3901aafcb85eefa971b560603e6f4943f4ffbb45
+Size (compat30-extras-sparc-3.1.tar.bz2) = 4086068 bytes
+SHA1 (compat30-extras-vax-3.1.tar.bz2) = f9a0408ca450bd8ef3c7156110b10f35cc67c1df
+RMD160 (compat30-extras-vax-3.1.tar.bz2) = 572f89a9dcefa077404bd1c5a68b07011f2c6b1b
+Size (compat30-extras-vax-3.1.tar.bz2) = 3581281 bytes
diff --git a/emulators/compat30/DESCR b/emulators/compat30/DESCR
new file mode 100644
index 00000000000..b93a97184f6
--- /dev/null
+++ b/emulators/compat30/DESCR
@@ -0,0 +1,2 @@
+This package supplies the user files needed to run dynamically linked
+executables compiled under NetBSD 3.0.
diff --git a/emulators/compat30/MESSAGE b/emulators/compat30/MESSAGE
new file mode 100644
index 00000000000..39704637078
--- /dev/null
+++ b/emulators/compat30/MESSAGE
@@ -0,0 +1,7 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2007/08/21 22:49:20 jlam Exp $
+
+The COMPAT_30 option must be included in the kernel configuration (and
+possibly others; see options(4) for more information) to make use of
+NetBSD 3.0 binaries.
+===========================================================================
diff --git a/emulators/compat30/Makefile b/emulators/compat30/Makefile
new file mode 100644
index 00000000000..32a7a9c86a7
--- /dev/null
+++ b/emulators/compat30/Makefile
@@ -0,0 +1,63 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:20 jlam Exp $
+
+DISTNAME= compat30 # overridden below
+NETBSD_VERSION= 3.0
+
+HOMEPAGE= http://www.NetBSD.org/Releases/formal-3.0/index.html
+COMMENT= Shared libraries for NetBSD 3.0 compatibility
+
+.if defined(NETBSD_COMPAT32)
+EMUL_PLATFORMS= netbsd-i386 netbsd-sparc
+
+ACCEPTABLE_NETBSD= NetBSD-2.99.* NetBSD-3.[0-9] \
+ NetBSD-3.[1-8][0-9]* NetBSD-3.9[0-8]* \
+ NetBSD-3.99.* NetBSD-[4-9]* NetBSD-[1-9][0-9]*
+.else
+EMUL_PLATFORMS= netbsd-alpha netbsd-arm netbsd-i386 netbsd-m68k \
+ netbsd-mipseb netbsd-mipsel netbsd-powerpc \
+ netbsd-sh3eb netbsd-sh3el netbsd-sparc \
+ netbsd-sparc64 netbsd-vax netbsd-x86_64
+
+ONLY_FOR_PLATFORM= NetBSD-3.99.*-* NetBSD-[4-9]*-* NetBSD-[1-9][0-9]*-*
+.endif
+
+.include "../../emulators/compat_netbsd/Makefile.common"
+
+DISTNAME= compat30-${EMUL_ARCH}-${COMPAT_VERSION}
+COMPAT_VERSION= 3.1
+
+# For COMPAT_NETBSD32, we need to depend on the compat30-extras package
+# on NetBSD-3.0 to supply the missing shared libraries; otherwise, we
+# just depend on the compat40 package for the missing shared libraries.
+#
+.if defined(NETBSD_COMPAT32)
+COMPAT_EXTRAS= # empty
+. for _netbsd_ in ${ACCEPTABLE_NETBSD}
+COMPAT_EXTRAS= netbsd32_compat30-extras-${COMPAT_VERSION}{,nb*}:../../emulators/netbsd32_compat30-extras
+. endfor
+. if !empty(COMPAT_EXTRAS)
+DEPENDS+= ${COMPAT_EXTRAS}
+. else
+# XXX This package doesn't exist yet.
+#DEPENDS+= netbsd32_compat40>=4.0:../../emulators/netbsd32_compat40
+. endif
+#
+# vax running NetBSD-4.x lacks any shared libraries, so depend on the
+# compat30-extras package to supply shared libraries missing from compat30.
+#
+.elif (${EMUL_ARCH} == "vax") && \
+ (!empty(OS_VERSION:M3.99.*) || !empty(OS_VERSION:M4.[0-9]) || \
+ !empty(OS_VERSION:M4.[1-8][0-9].*) || empty(NetBSD-4.9[0-8].*))
+DEPENDS+= compat30-extras-${COMPAT_VERSION}{,nb*}:../../emulators/compat30-extras
+#
+# We need to depend on the compat40 package to supply shared libraries
+# missing from compat30 on NetBSD>4.x.
+#
+.elif empty(OS_VERSION:M[0-3].*) && empty(OS_VERSION:M4.[0-9]) && \
+ empty(OS_VERSION:M4.[0-9].*) && empty(OS_VERSION:M4.[1-8][0-9].*) && \
+ empty(OS_VERSION:M4.9[0-8]*)
+# XXX This package doesn't exist yet.
+#DEPENDS+= compat40>=4.0:../../emulators/compat40
+.endif
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/compat30/PLIST b/emulators/compat30/PLIST
new file mode 100644
index 00000000000..2e0315b0a6a
--- /dev/null
+++ b/emulators/compat30/PLIST
@@ -0,0 +1,49 @@
+@comment $NetBSD: PLIST,v 1.1 2007/08/21 22:49:20 jlam Exp $
+${EMULSUBDIRSLASH}lib/libcrypto.so.2
+${EMULSUBDIRSLASH}lib/libcrypto.so.2.1
+${EMULSUBDIRSLASH}lib/libevent.so.0
+${EMULSUBDIRSLASH}lib/libevent.so.0.2
+${EMULSUBDIRSLASH}lib/libradius.so.0
+${EMULSUBDIRSLASH}lib/libradius.so.0.0
+${EMULSUBDIRSLASH}lib/libz.so.0
+${EMULSUBDIRSLASH}lib/libz.so.0.4
+${EMULSUBDIRSLASH}usr/lib/libamu.so.2
+${EMULSUBDIRSLASH}usr/lib/libamu.so.2.1
+${EMULSUBDIRSLASH}usr/lib/libcdk.so
+${EMULSUBDIRSLASH}usr/lib/libcdk.so.1
+${EMULSUBDIRSLASH}usr/lib/libcdk.so.1.0
+${EMULSUBDIRSLASH}usr/lib/libcrypto.so.2
+${EMULSUBDIRSLASH}usr/lib/libcrypto.so.2.1
+${EMULSUBDIRSLASH}usr/lib/libevent.so.0
+${EMULSUBDIRSLASH}usr/lib/libevent.so.0.2
+${EMULSUBDIRSLASH}usr/lib/libkadm.so
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.5
+${EMULSUBDIRSLASH}usr/lib/libkadm.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.6
+${EMULSUBDIRSLASH}usr/lib/libkafs.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libkdb.so
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.5
+${EMULSUBDIRSLASH}usr/lib/libkdb.so.5.0
+${EMULSUBDIRSLASH}usr/lib/libkrb.so
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.6
+${EMULSUBDIRSLASH}usr/lib/libkrb.so.6.0
+${EMULSUBDIRSLASH}usr/lib/libkrb5.so.19
+${EMULSUBDIRSLASH}usr/lib/libkrb5.so.19.1
+${EMULSUBDIRSLASH}usr/lib/libkstream.so
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.2
+${EMULSUBDIRSLASH}usr/lib/libkstream.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libmagic.so.0
+${EMULSUBDIRSLASH}usr/lib/libmagic.so.0.1
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.1
+${EMULSUBDIRSLASH}usr/lib/libpcap.so.1.4
+${EMULSUBDIRSLASH}usr/lib/libradius.so.0
+${EMULSUBDIRSLASH}usr/lib/libradius.so.0.0
+${EMULSUBDIRSLASH}usr/lib/libssh.so.1
+${EMULSUBDIRSLASH}usr/lib/libssh.so.1.0.1
+${EMULSUBDIRSLASH}usr/lib/libssl.so.3
+${EMULSUBDIRSLASH}usr/lib/libssl.so.3.0
+${EMULSUBDIRSLASH}usr/lib/libz.so.0
+${EMULSUBDIRSLASH}usr/lib/libz.so.0.4
+@dirrm ${EMULSUBDIRSLASH}usr/lib
+@dirrm ${EMULSUBDIRSLASH}usr
+@dirrm ${EMULSUBDIRSLASH}lib
diff --git a/emulators/compat30/PLIST.alpha b/emulators/compat30/PLIST.alpha
new file mode 100644
index 00000000000..4ae69d2021c
--- /dev/null
+++ b/emulators/compat30/PLIST.alpha
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.alpha,v 1.1 2007/08/21 22:49:20 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/PLIST.arm b/emulators/compat30/PLIST.arm
new file mode 100644
index 00000000000..359553f8c0f
--- /dev/null
+++ b/emulators/compat30/PLIST.arm
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.arm,v 1.1 2007/08/21 22:49:21 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/PLIST.i386 b/emulators/compat30/PLIST.i386
new file mode 100644
index 00000000000..3c1e4cbfb51
--- /dev/null
+++ b/emulators/compat30/PLIST.i386
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.i386,v 1.1 2007/08/21 22:49:21 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/PLIST.m68k b/emulators/compat30/PLIST.m68k
new file mode 100644
index 00000000000..b91d560709d
--- /dev/null
+++ b/emulators/compat30/PLIST.m68k
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.m68k,v 1.1 2007/08/21 22:49:21 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/PLIST.mipseb b/emulators/compat30/PLIST.mipseb
new file mode 100644
index 00000000000..0e4f11c83bd
--- /dev/null
+++ b/emulators/compat30/PLIST.mipseb
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.mipseb,v 1.1 2007/08/21 22:49:21 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/PLIST.mipsel b/emulators/compat30/PLIST.mipsel
new file mode 100644
index 00000000000..f32f35590ac
--- /dev/null
+++ b/emulators/compat30/PLIST.mipsel
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.mipsel,v 1.1 2007/08/21 22:49:21 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/PLIST.powerpc b/emulators/compat30/PLIST.powerpc
new file mode 100644
index 00000000000..64835cfa028
--- /dev/null
+++ b/emulators/compat30/PLIST.powerpc
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.powerpc,v 1.1 2007/08/21 22:49:22 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/PLIST.sh3eb b/emulators/compat30/PLIST.sh3eb
new file mode 100644
index 00000000000..176adb76e6c
--- /dev/null
+++ b/emulators/compat30/PLIST.sh3eb
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.sh3eb,v 1.1 2007/08/21 22:49:22 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/PLIST.sh3el b/emulators/compat30/PLIST.sh3el
new file mode 100644
index 00000000000..72b63f3c255
--- /dev/null
+++ b/emulators/compat30/PLIST.sh3el
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.sh3el,v 1.1 2007/08/21 22:49:22 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/PLIST.sparc b/emulators/compat30/PLIST.sparc
new file mode 100644
index 00000000000..8434dd42b46
--- /dev/null
+++ b/emulators/compat30/PLIST.sparc
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.sparc,v 1.1 2007/08/21 22:49:22 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/PLIST.sparc64 b/emulators/compat30/PLIST.sparc64
new file mode 100644
index 00000000000..475b5c105b9
--- /dev/null
+++ b/emulators/compat30/PLIST.sparc64
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.sparc64,v 1.1 2007/08/21 22:49:22 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/PLIST.x86_64 b/emulators/compat30/PLIST.x86_64
new file mode 100644
index 00000000000..5cbeb85348d
--- /dev/null
+++ b/emulators/compat30/PLIST.x86_64
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.x86_64,v 1.1 2007/08/21 22:49:23 jlam Exp $
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7
+${EMULSUBDIRSLASH}usr/lib/libbfd.so.7.0
+${EMULSUBDIRSLASH}usr/lib/libg2c.so
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2
+${EMULSUBDIRSLASH}usr/lib/libg2c.so.2.0
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5
+${EMULSUBDIRSLASH}usr/lib/libstdc++.so.5.0
diff --git a/emulators/compat30/distinfo b/emulators/compat30/distinfo
new file mode 100644
index 00000000000..493600f6086
--- /dev/null
+++ b/emulators/compat30/distinfo
@@ -0,0 +1,41 @@
+$NetBSD: distinfo,v 1.1 2007/08/21 22:49:23 jlam Exp $
+
+SHA1 (compat30-alpha-3.1.tar.bz2) = c457c201c57b80488115e6ddaecf41ea65ed5625
+RMD160 (compat30-alpha-3.1.tar.bz2) = 30ba87e06355cc4059ef4aab6feefdf95b185d8d
+Size (compat30-alpha-3.1.tar.bz2) = 1837161 bytes
+SHA1 (compat30-arm-3.1.tar.bz2) = bb4e46e6c4d6692a4e2db2a3acf412c1546d6d11
+RMD160 (compat30-arm-3.1.tar.bz2) = 5a0c85ce6d07c324583f9b7331692074babe39f0
+Size (compat30-arm-3.1.tar.bz2) = 1597739 bytes
+SHA1 (compat30-i386-3.1.tar.bz2) = 2a7fda81d964b385a1b296942c6c1ac2525957e5
+RMD160 (compat30-i386-3.1.tar.bz2) = af0cd186d3725a35436fb6fefc92ebd34f3aa929
+Size (compat30-i386-3.1.tar.bz2) = 1452772 bytes
+SHA1 (compat30-m68k-3.1.tar.bz2) = 8f5fcf73b26edfd1c72f9c1147cb5371f9d93c1d
+RMD160 (compat30-m68k-3.1.tar.bz2) = fd314cbad6bc5dfbc5d2c5b25420f65e93ef67ff
+Size (compat30-m68k-3.1.tar.bz2) = 1481142 bytes
+SHA1 (compat30-mipseb-3.1.tar.bz2) = 10c16a9075aefcd0d0a9f042232223e4502db739
+RMD160 (compat30-mipseb-3.1.tar.bz2) = 24cea8e68f61aa63c20561c92500fc213d24964f
+Size (compat30-mipseb-3.1.tar.bz2) = 1592863 bytes
+SHA1 (compat30-mipsel-3.1.tar.bz2) = 97737289db457f3730537be308b43bd58137a5a1
+RMD160 (compat30-mipsel-3.1.tar.bz2) = fe3d41381548b124f6cb1034d5a41b0488c240f4
+Size (compat30-mipsel-3.1.tar.bz2) = 1611590 bytes
+SHA1 (compat30-powerpc-3.1.tar.bz2) = b8ec620e5ffb99e79181c3ff6514cf6dc1cd916c
+RMD160 (compat30-powerpc-3.1.tar.bz2) = 668a083892b77bb70a72ea18c224e24443f42291
+Size (compat30-powerpc-3.1.tar.bz2) = 1649707 bytes
+SHA1 (compat30-sh3eb-3.1.tar.bz2) = dfe18e8b8ff6ab3d9f5c9648d7c28da41ac06b88
+RMD160 (compat30-sh3eb-3.1.tar.bz2) = a8a85c1f108526a782b13125e357fc5e3fdfc1b7
+Size (compat30-sh3eb-3.1.tar.bz2) = 1689141 bytes
+SHA1 (compat30-sh3el-3.1.tar.bz2) = cb0fb247a3a8374acdc2f8d8ebe2b8705164708a
+RMD160 (compat30-sh3el-3.1.tar.bz2) = c1c466e7f9c29545c5527a4feb911a0a304b2a36
+Size (compat30-sh3el-3.1.tar.bz2) = 1694849 bytes
+SHA1 (compat30-sparc-3.1.tar.bz2) = e6a7bf53c31eef12fb315019bd1041b544bbe164
+RMD160 (compat30-sparc-3.1.tar.bz2) = 03e87d4dca8a1d0b00406f0fbc16a4f30e940a99
+Size (compat30-sparc-3.1.tar.bz2) = 1532483 bytes
+SHA1 (compat30-sparc64-3.1.tar.bz2) = bcfb773ed29885d2fb47825cb0bb27da735fc78d
+RMD160 (compat30-sparc64-3.1.tar.bz2) = 4e28e5452571c787f249c84f0705b5f80131d2a3
+Size (compat30-sparc64-3.1.tar.bz2) = 1602735 bytes
+SHA1 (compat30-vax-3.1.tar.bz2) = 3bf8b2d95470aa01132b56d9cb59e66fc86b151c
+RMD160 (compat30-vax-3.1.tar.bz2) = 04c69fcfc28dbb2486628449ba494ec898323b15
+Size (compat30-vax-3.1.tar.bz2) = 900690 bytes
+SHA1 (compat30-x86_64-3.1.tar.bz2) = 84cee71b6ad9f765c95d181266736f0ce2e0b743
+RMD160 (compat30-x86_64-3.1.tar.bz2) = d0dfb44f8fdb1fa6c28a21c66f43248e1aafdef6
+Size (compat30-x86_64-3.1.tar.bz2) = 1676922 bytes
diff --git a/emulators/compat30/emulator.mk b/emulators/compat30/emulator.mk
new file mode 100644
index 00000000000..3339f0a7882
--- /dev/null
+++ b/emulators/compat30/emulator.mk
@@ -0,0 +1,44 @@
+# $NetBSD: emulator.mk,v 1.1 2007/08/21 22:49:23 jlam Exp $
+#
+# This file is included by netbsd-compat.mk in the emulator framework.
+#
+# Variables set by this file:
+#
+# EMUL_DISTRO
+# The NetBSD distribution used to provide the files.
+#
+# EMUL_EXEC_FMT
+# The executable format of the emulated operating system.
+#
+# EMULSUBDIR
+# Path relative to ${PREFIX} where the files and directories are
+# located, e.g. emul/aout.
+#
+# DEPENDS_${EMUL_DISTRO}.*
+# A table that maps "modules" to NetBSD package dependencies.
+#
+
+EMUL_DISTRO= netbsd-3.0
+
+EMUL_EXEC_FMT= ELF
+EMULSUBDIR= emul/netbsd
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.netbsd}
+
+# For COMPAT_NETBSD32, we always need the dependency to supply 32-bit
+# shared libaries for NetBSD-3.0.
+#
+.if ((${EMUL_ARCH} == "i386") && (${MACHINE_ARCH} == "x86_64")) || \
+ ((${EMUL_ARCH} == "sparc") && (${MACHINE_ARCH} == "sparc64"))
+EMULSUBDIR= emul/netbsd32
+OPSYS_EMULDIR= ${_OPSYS_EMULDIR.netbsd32}
+
+DEPENDS_netbsd-3.0.base?= netbsd32_compat30>=3.0:../../emulators/netbsd32_compat30
+#
+# We need to depend on the compat30 package to supply missing shared
+# libraries only on NetBSD>3.0.
+#
+.elif empty(OS_VERSION:M[0-2].*) && empty(OS_VERSION:M3.[0-9]) && \
+ empty(OS_VERSION:M3.[0-9].*) && empty(OS_VERSION:M3.[1-8][0-9].*) && \
+ empty(OS_VERSION:M3.9[0-8]*)
+DEPENDS_netbsd-3.0.base?= compat30>=3.0:../../emulators/compat30
+.endif
diff --git a/emulators/compat_netbsd/DEINSTALL b/emulators/compat_netbsd/DEINSTALL
new file mode 100644
index 00000000000..f0f5e298999
--- /dev/null
+++ b/emulators/compat_netbsd/DEINSTALL
@@ -0,0 +1,9 @@
+# $NetBSD: DEINSTALL,v 1.1 2007/08/21 22:49:24 jlam Exp $
+
+case "${STAGE}" in
+POST-DEINSTALL)
+ # Run any actions that require root privileges.
+ ${TEST} ! -x ./+ROOT_ACTIONS ||
+ ./+ROOT_ACTIONS REMOVE ${PKG_METADATA_DIR} || exit 1
+ ;;
+esac
diff --git a/emulators/compat_netbsd/INSTALL.ELF b/emulators/compat_netbsd/INSTALL.ELF
new file mode 100644
index 00000000000..d15f62cc75b
--- /dev/null
+++ b/emulators/compat_netbsd/INSTALL.ELF
@@ -0,0 +1,137 @@
+# $NetBSD: INSTALL.ELF,v 1.1 2007/08/21 22:49:24 jlam Exp $
+
+# 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.
+#
+# Lines starting with "# SYMLINK: " are data read by this script that
+# name the source paths and corresponding symlink that is managed by
+# this script. If the symlink path is relative, then it is taken to be
+# relative to ${PKG_PREFIX}. The source path is always unchanged.
+#
+# # SYMLINK: /dev/rcd0a ${EMULSUBDIR}/dev/cdrom
+#
+
+CAT="@CAT@"
+CHMOD="@CHMOD@"
+ECHO="@ECHO@"
+ID="@ID@"
+LN="@LN@"
+PWD_CMD="@PWD_CMD@"
+RM="@RM@"
+SED="@SED@"
+TEST="@TEST@"
+
+SELF=$0
+ACTION=$1
+
+CURDIR=`${PWD_CMD}`
+PKG_METADATA_DIR="${2-${CURDIR}}"
+: ${PKGNAME=${PKG_METADATA_DIR##*/}}
+: ${PKG_PREFIX=@PREFIX@}
+
+ROOT_ACTIONS_COOKIE="./+ROOT_ACTIONS_done"
+EUID=`${ID} -u`
+
+exitcode=0
+case $ACTION,$EUID in
+ADD,0)
+ ${ECHO} "" > ${ROOT_ACTIONS_COOKIE}
+ ${CHMOD} g+w ${ROOT_ACTIONS_COOKIE}
+ ${SED} -n "/^\# SYMLINK: /{s/^\# SYMLINK: //;p;}" ${SELF} |
+ while read src dst; do
+ case $src in
+ "") continue ;;
+ esac
+ case $dst in
+ "") continue ;;
+ [!/]*) dst="${PKG_PREFIX}/$dst" ;;
+ esac
+
+ if ${TEST} ! -f "$dst"; then
+ ${ECHO} "${PKGNAME}: linking $dst -> $src"
+ ${LN} -fs "$src" "$dst"
+ else
+ ${ECHO} "${PKGNAME}: $dst already exists"
+ fi
+ done
+ ;;
+
+REMOVE,0)
+ ${SED} -n "/^\# SYMLINK: /{s/^\# SYMLINK: //;p;}" ${SELF} |
+ while read src dst; do
+ case $src in
+ "") continue ;;
+ esac
+ case $dst in
+ "") continue ;;
+ [!/]*) dst="${PKG_PREFIX}/$dst" ;;
+ esac
+
+ if ${TEST} -h "$dst"; then
+ ${ECHO} "${PKGNAME}: removing $dst"
+ ${RM} -f "$dst"
+ fi
+ done
+ ${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
+ ${SED} -n "/^\# SYMLINK: /p" ${SELF} >> ./+ROOT_ACTIONS
+ ${CHMOD} +x ./+ROOT_ACTIONS
+ ;;
+esac
+
+case "${STAGE}" in
+POST-INSTALL)
+ ${TEST} ! -x ./+ROOT_ACTIONS ||
+ ./+ROOT_ACTIONS ADD ${PKG_METADATA_DIR}
+ ;;
+esac
diff --git a/emulators/compat_netbsd/INSTALL.a.out b/emulators/compat_netbsd/INSTALL.a.out
new file mode 100644
index 00000000000..5f425bf2147
--- /dev/null
+++ b/emulators/compat_netbsd/INSTALL.a.out
@@ -0,0 +1,140 @@
+# $NetBSD: INSTALL.a.out,v 1.1 2007/08/21 22:49:25 jlam Exp $
+
+# 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@"
+GREP="@GREP@"
+ID="@ID@"
+PWD_CMD="@PWD_CMD@"
+RM="@RM@"
+TEST="@TEST@"
+TOUCH="@TOUCH@"
+
+SELF=$0
+ACTION=$1
+
+CURDIR=`${PWD_CMD}`
+PKG_METADATA_DIR="${2-${CURDIR}}"
+: ${PKGNAME=${PKG_METADATA_DIR##*/}}
+: ${PKG_PREFIX=@PREFIX@}
+
+EMULDIR="${PKG_PREFIX}/@EMULSUBDIR@"
+OPSYS_EMULDIR="@OPSYS_EMULDIR@"
+
+ROOT_ACTIONS_COOKIE="./+ROOT_ACTIONS_done"
+EUID=`${ID} -u`
+
+exitcode=0
+case $ACTION,$EUID in
+ADD,0)
+ ${ECHO} "" > ${ROOT_ACTIONS_COOKIE}
+ ${CHMOD} g+w ${ROOT_ACTIONS_COOKIE}
+ ${SED} -n "/^\# LDCONFIG: /{s/^\# LDCONFIG: //;p;}" ${SELF} |
+ while read dir; do
+ case $dir in
+ /*) continue ;;
+ *) dir="${PKG_PREFIX}/$dir" ;;
+ esac
+ ${TEST} -d "$dir" || continue
+
+ ldsoconf="/etc/ld.so.conf"
+ ${TEST} -f "$ldsoconf" || continue
+ if ${GREP} "^$dir" $ldsoconf >/dev/null; then
+ :
+ else
+ ${ECHO} "${PKGNAME}: adding $dir to $ldsoconf"
+ ${TOUCH} $ldsoconf
+ ${CP} $ldsoconf $ldsoconf.pkgsrc."$$"
+ { ${CAT} $ldsoconf.pkgsrc."$$"; ${ECHO} "$dir"; } > $ldsoconf
+ ${RM} $ldsoconf.pkgsrc."$$"
+ fi
+ done
+ ${ECHO} "${PKGNAME}: creating a.out runtime link editor directory cache."
+ @LDCONFIG_ADD_CMD@
+ ;;
+
+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,0)
+ ${SED} -n "/^\# LDCONFIG: /{s/^\# LDCONFIG: //;p;}" ${SELF} |
+ { while read dir; do
+ case $dir in
+ /*) continue ;;
+ *) dir="${PKG_PREFIX}/$dir" ;;
+ esac
+ ${TEST} -d "$dir" || continue
+
+ ldsoconf="/etc/ld.so.conf"
+ ${TEST} -f "$ldsoconf" || continue
+ if ${GREP} "^$dir" $ldsoconf >/dev/null; then
+ case "$printed_header" in
+ yes) ;;
+ *) printed_header=yes
+ ${ECHO} "==========================================================================="
+ ${ECHO} "The following lines can be removed from $ldsoconf:"
+ ${ECHO} ""
+ ;;
+ esac
+ ${ECHO} " $dir"
+ fi
+ done
+ case "$printed_header" in
+ yes) ${ECHO} ""
+ ${ECHO} "==========================================================================="
+ exit 1
+ ;;
+ esac; }
+ ${RM} -f ${ROOT_ACTIONS_COOKIE}
+ ;;
+esac
+exit $exitcode
+
+EOF
+ ${CHMOD} +x ./+ROOT_ACTIONS
+ ;;
+esac
+
+# LDCONFIG: @EMULSUBDIRSLASH@usr/X11R6/lib
+# LDCONFIG: @EMULSUBDIRSLASH@usr/lib
+
+EMULDIR="${PKG_PREFIX}/@EMULSUBDIR@"
+OPSYS_EMULDIR="@OPSYS_EMULDIR@"
+
+case "${STAGE}" in
+POST-INSTALL)
+ # Run any actions that require root privileges.
+ ${TEST} ! -x ./+ROOT_ACTIONS ||
+ ./+ROOT_ACTIONS ADD ${PKG_METADATA_DIR}
+ ;;
+esac
diff --git a/emulators/compat_netbsd/INSTALL.emulaout b/emulators/compat_netbsd/INSTALL.emulaout
new file mode 100644
index 00000000000..3cde42f75b5
--- /dev/null
+++ b/emulators/compat_netbsd/INSTALL.emulaout
@@ -0,0 +1,134 @@
+# $NetBSD: INSTALL.emulaout,v 1.1 2007/08/21 22:49:25 jlam Exp $
+
+# 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@"
+DIRNAME="@DIRNAME@"
+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="${PKG_PREFIX}/@EMULSUBDIR@"
+OPSYS_EMULDIR="@OPSYS_EMULDIR@"
+
+ROOT_ACTIONS_COOKIE="./+ROOT_ACTIONS_done"
+EUID=`${ID} -u`
+
+exitcode=0
+case $ACTION,$EUID in
+ADD,0)
+ ${ECHO} "" > ${ROOT_ACTIONS_COOKIE}
+ ${CHMOD} g+w ${ROOT_ACTIONS_COOKIE}
+
+ # 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
+==============================================================================
+The following symbolic link must be created for ${PKGNAME}
+to work properly:
+
+ ${EMULDIR} -> ${OPSYS_EMULDIR}
+
+==============================================================================
+EOM
+ else
+ ${ECHO} "${PKGNAME}: creating symlink ${EMULDIR} -> ${OPSYS_EMULDIR}"
+ ( ${MKDIR} -p `${DIRNAME} ${OPSYS_EMULDIR}` &&
+ ${LN} -fs ${EMULDIR} ${OPSYS_EMULDIR} ) || ${TRUE}
+ fi
+ fi
+ if ${TEST} -d ${OPSYS_EMULDIR}; then
+ ${ECHO} "${PKGNAME}: creating a.out runtime link editor directory cache."
+ @LDCONFIG_ADD_CMD@
+ fi
+ ;;
+
+REMOVE,0)
+ if ${TEST} -d ${OPSYS_EMULDIR}; then
+ ${ECHO} "${PKGNAME}: creating a.out runtime link editor directory cache."
+ @LDCONFIG_REMOVE_CMD@
+ fi
+ ${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} -d ${OPSYS_EMULDIR}; then
+ ${CAT} << EOM
+==============================================================================
+Please run the following command with superuser privileges to rebuild
+the a.out runtime link editor directory cache after the removal of
+${PKGNAME}:
+
+ @LDCONFIG_REMOVE_CMD@
+
+==============================================================================
+EOM
+ fi
+ ${RM} -f ${ROOT_ACTIONS_COOKIE}
+ ;;
+esac
+exit $exitcode
+
+EOF
+ ${CHMOD} +x ./+ROOT_ACTIONS
+ ;;
+esac
+
+case "${STAGE}" in
+POST-INSTALL)
+ # Run any actions that require root privileges.
+ ${TEST} ! -x ./+ROOT_ACTIONS ||
+ ./+ROOT_ACTIONS ADD ${PKG_METADATA_DIR}
+ ;;
+esac
diff --git a/emulators/compat_netbsd/INSTALL.emulnetbsd32 b/emulators/compat_netbsd/INSTALL.emulnetbsd32
new file mode 100644
index 00000000000..65af65d5dab
--- /dev/null
+++ b/emulators/compat_netbsd/INSTALL.emulnetbsd32
@@ -0,0 +1,110 @@
+# $NetBSD: INSTALL.emulnetbsd32,v 1.1 2007/08/21 22:49:25 jlam Exp $
+
+# 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@"
+DIRNAME="@DIRNAME@"
+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="${PKG_PREFIX}/@EMULSUBDIR@"
+OPSYS_EMULDIR="@OPSYS_EMULDIR@"
+
+ROOT_ACTIONS_COOKIE="./+ROOT_ACTIONS_done"
+EUID=`${ID} -u`
+
+exitcode=0
+case $ACTION,$EUID in
+ADD,0)
+ ${ECHO} "" > ${ROOT_ACTIONS_COOKIE}
+ ${CHMOD} g+w ${ROOT_ACTIONS_COOKIE}
+
+ # 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
+==============================================================================
+The following symbolic link must be created for ${PKGNAME}
+to work properly:
+
+ ${EMULDIR} -> ${OPSYS_EMULDIR}
+
+==============================================================================
+EOM
+ else
+ ${ECHO} "${PKGNAME}: creating symlink ${EMULDIR} -> ${OPSYS_EMULDIR}"
+ ( ${MKDIR} -p `${DIRNAME} ${OPSYS_EMULDIR}` &&
+ ${LN} -fs ${EMULDIR} ${OPSYS_EMULDIR} ) || ${TRUE}
+ fi
+ fi
+ ;;
+
+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,*)
+ ${RM} -f ${ROOT_ACTIONS_COOKIE}
+ ;;
+esac
+exit $exitcode
+
+EOF
+ ${CHMOD} +x ./+ROOT_ACTIONS
+ ;;
+esac
+
+case "${STAGE}" in
+POST-INSTALL)
+ # Run any actions that require root privileges.
+ ${TEST} ! -x ./+ROOT_ACTIONS ||
+ ./+ROOT_ACTIONS ADD ${PKG_METADATA_DIR}
+ ;;
+esac
diff --git a/emulators/compat_netbsd/Makefile.common b/emulators/compat_netbsd/Makefile.common
new file mode 100644
index 00000000000..9ca372db860
--- /dev/null
+++ b/emulators/compat_netbsd/Makefile.common
@@ -0,0 +1,123 @@
+# $NetBSD: Makefile.common,v 1.1 2007/08/21 22:49:25 jlam Exp $
+#
+# Common infrastructure for NetBSD compat* packages.
+#
+# This file should be included after EMUL_PLATFORMS and NETBSD_VERSION are
+# defined and before EMUL_PLATFORM is used.
+#
+
+PKGNAME= ${DISTNAME:S/-${EMUL_ARCH}-/-/}
+CATEGORIES= emulators
+MASTER_SITES= ${MASTER_SITE_LOCAL}
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+
+NO_SRC_ON_FTP= Already in MASTER_SITE_LOCAL
+
+NETBSD_PKG= yes
+NETBSD_VERSION_REQD= ${NETBSD_VERSION}
+
+.include "../../mk/bsd.prefs.mk"
+
+.if defined(NETBSD_COMPAT32) && defined(ACCEPTABLE_NETBSD)
+ONLY_FOR_PLATFORM+= ${ACCEPTABLE_NETBSD:S/$/-sparc64/}
+ONLY_FOR_PLATFORM+= ${ACCEPTABLE_NETBSD:S/$/-x86_64/}
+.endif
+
+NETBSD_PKGSRCDIR?= ${.CURDIR}/../${.CURDIR:T:S/^netbsd32_//}
+FILESDIR= ${NETBSD_PKGSRCDIR}/files
+PATCHDIR= ${NETBSD_PKGSRCDIR}/patches
+PKGDIR= ${NETBSD_PKGSRCDIR}
+
+.if ((${EMUL_ARCH} == "i386") && (${MACHINE_ARCH} == "x86_64")) || \
+ ((${EMUL_ARCH} == "sparc") && (${MACHINE_ARCH} == "sparc64"))
+PKGNAME:= ${PKGNAME:S/^/netbsd32_/}
+COMMENT:= ${COMMENT:S/NetBSD/NetBSD 32-bit/}
+NETBSD_BASE= netbsd32_
+.else
+NETBSD_BASE= # empty
+.endif
+
+BUILD_DIRS= # empty
+MAKE_DIRS+= ${EMULDIR}
+ELF_SYMLINKS_DATA= ${WRKDIR}/.symlinks-data
+
+#
+# PLISTs are composed from the following bits, in order:
+#
+# PLIST.${EMUL_ARCH} e.g. PLIST.alpha
+# PLIST.${EMUL_EXEC_FMT} e.g. PLIST.ELF
+# PLIST e.g. PLIST
+#
+.if exists(${PKGDIR}/PLIST.${EMUL_ARCH})
+PLIST_SRC+= ${PKGDIR}/PLIST.${EMUL_ARCH}
+.endif
+.if exists(${PKGDIR}/PLIST.${EMUL_EXEC_FMT})
+PLIST_SRC+= ${PKGDIR}/PLIST.${EMUL_EXEC_FMT}
+.endif
+.if exists(${PKGDIR}/PLIST)
+PLIST_SRC+= ${PKGDIR}/PLIST
+.endif
+
+#
+# Different combinations of the native executable format and the emulated
+# executable format require different ways of making the installed shared
+# libraries useful after installation.
+#
+# native emul action
+# ----- ---- ------
+# a.out a.out append to ld.so.conf and run ldconfig
+# ELF a.out run ldconfig
+# ELF ELF create symlinks to shlibs into base system
+# ELF64 ELF32 nothing
+#
+.if (${NATIVE_EXEC_FMT} == "a.out") && (${EMUL_EXEC_FMT} == "a.out")
+INSTALL_TEMPLATES+= ${PKGSRCDIR}/emulators/compat_netbsd/INSTALL.a.out
+
+.elif (${NATIVE_EXEC_FMT} == "ELF") && (${EMUL_EXEC_FMT} == "a.out")
+INSTALL_TEMPLATES+= ${PKGSRCDIR}/emulators/compat_netbsd/INSTALL.emulaout
+
+.elif defined(NETBSD_COMPAT32)
+INSTALL_TEMPLATES+= ${PKGSRCDIR}/emulators/compat_netbsd/INSTALL.emulnetbsd32
+
+.else # (${NATIVE_EXEC_FMT} == "ELF") && (${EMUL_EXEC_FMT} == "ELF")
+INSTALL_TEMPLATES+= ${PKGSRCDIR}/emulators/compat_netbsd/INSTALL.ELF
+INSTALL_TEMPLATES+= ${ELF_SYMLINKS_DATA}
+post-build: symlinks-data
+.endif
+
+DEINSTALL_TEMPLATES+= ${PKGSRCDIR}/emulators/compat_netbsd/DEINSTALL
+
+#
+# For ELF platforms, the INSTALL.ELF script needs SYMLINK data lines to
+# tell it which shared libraries need to be symlinked to where. Generate
+# this information from the PLIST.
+#
+.PHONY: symlinks-data
+symlinks-data: ${ELF_SYMLINKS_DATA}
+${ELF_SYMLINKS_DATA}: plist
+ ${RUN} ${CAT} ${PLIST} | ${AWK} \
+ 'BEGIN { print "#" } END { print "#" } /^@/ { next } \
+ { src = $$0; dst = src; sub("^${EMULSUBDIRSLASH}", "/", dst); \
+ print "# SYMLINK: " src " " dst }' > ${.TARGET}
+
+#
+# The compat* packages have a very strict package layout:
+#
+# ${WRKSRC}/lib
+# ${WRKSRC}/libexec
+# ${WRKSRC}/usr
+#
+# Each of these directories, if they exist, are copied directly into
+# ${EMULDIR}.
+#
+.PHONY: compat-install
+do-install: compat-install
+compat-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/${EMULSUBDIR}
+ cd ${WRKSRC} && for dir in lib libexec usr; do \
+ if ${TEST} -d "$$dir"; then \
+ ${PAX} -rw "$$dir" ${PREFIX}/${EMULSUBDIR}; \
+ fi; \
+ done
diff --git a/emulators/netbsd32_compat14/DEINSTALL b/emulators/netbsd32_compat14/DEINSTALL
deleted file mode 100644
index 9e432e1c8c7..00000000000
--- a/emulators/netbsd32_compat14/DEINSTALL
+++ /dev/null
@@ -1,19 +0,0 @@
-# $NetBSD: DEINSTALL,v 1.2 2003/08/30 19:07:10 jlam Exp $
-
-case ${STAGE} in
-POST-DEINSTALL)
- MACHINE_ARCH=@MACHINE_ARCH@
- COMPAT_LIBDIR=@COMPAT_LIBDIR@
- COMPAT_XLIBDIR=@COMPAT_XLIBDIR@
-
- ${RMDIR} -p ${PKG_PREFIX}/${COMPAT_LIBDIR} ${PKG_PREFIX}/${COMPAT_XLIBDIR} 2>/dev/null || ${TRUE}
-
- # clean up the symlink
- ${RM} -f /emul/aout
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/netbsd32_compat14/DESCR b/emulators/netbsd32_compat14/DESCR
deleted file mode 100644
index 13b88772c16..00000000000
--- a/emulators/netbsd32_compat14/DESCR
+++ /dev/null
@@ -1,5 +0,0 @@
-This package supplies the user files necessary for full compatibility with
-dynamically linked executables compiled under NetBSD 1.4, on a 32-bit
-platform, running on a 64-bit host.. You still need the options COMPAT_14
-and COMPAT_NETBSD32 in your kernel configuration (and probably others; see
-options(4) for more information) to make use of NetBSD 1.4 binaries.
diff --git a/emulators/netbsd32_compat14/INSTALL b/emulators/netbsd32_compat14/INSTALL
deleted file mode 100644
index bba96f36602..00000000000
--- a/emulators/netbsd32_compat14/INSTALL
+++ /dev/null
@@ -1,51 +0,0 @@
-# $NetBSD: INSTALL,v 1.3 2005/01/11 05:12:56 hamajima Exp $
-
-case ${STAGE} in
-POST-INSTALL)
- MACHINE_ARCH=@MACHINE_ARCH@
- OBJECT_FMT=@OBJECT_FMT@
-
- # Only create the symlink on certain platform/object combinations. Note
- # that sparc64 a.out compatibility lives in /emul/aout, not /emul/netbsd32.
- #
- create_emul_symlink=0
- case ${MACHINE_ARCH} in
- sparc64 | x86_64)
- create_emul_symlink=1
- ;;
- esac
-
- if [ ${create_emul_symlink} = 1 ]
- then
- # Create a symlink from /emul/aout --> ${PKG_PREFIX}/emul/aout
- # 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
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/netbsd32_compat14/Makefile b/emulators/netbsd32_compat14/Makefile
deleted file mode 100644
index d9a687f732d..00000000000
--- a/emulators/netbsd32_compat14/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-# $NetBSD: Makefile,v 1.19 2006/10/19 19:39:04 wiz Exp $
-#
-
-DISTNAME= compat14-${MACHINE32_ARCH}-${VERSION}
-PKGNAME= netbsd32_compat14-${VERSION}
-CATEGORIES= emulators
-MASTER_SITES= ${MASTER_SITE_LOCAL}
-
-MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= http://www.NetBSD.org/Releases/formal-1.4/index.html
-COMMENT= 32-bit shared libraries for NetBSD 1.4 (and earlier) compatibility
-
-VERSION= 1.4.3.1
-PKGREVISION= 1
-
-.if ${MACHINE_ARCH} == "sparc64"
-MACHINE32_ARCH= sparc
-DEPENDS+= netbsd32_compat15>=1.0:../../emulators/netbsd32_compat15
-.elif ${MACHINE_ARCH} == "x86_64"
-MACHINE32_ARCH= i386
-DEPENDS+= netbsd32_compat16>=1.0:../../emulators/netbsd32_compat16
-.else
-MACHINE32_ARCH= ${MACHINE_ARCH}
-.endif
-
-ONLY_FOR_PLATFORM= NetBSD-*-sparc64
-ONLY_FOR_PLATFORM+= NetBSD-[2-9]*-x86_64
-NO_SRC_ON_FTP= Already in MASTER_SITE_LOCAL
-
-NO_MTREE= yes
-NO_BUILD= yes
-CHECK_SHLIBS_SUPPORTED= no
-
-FILES_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR:Q}
-FILES_SUBST+= COMPAT_XLIBDIR=${COMPAT_XLIBDIR:Q}
-FILES_SUBST+= MACHINE_ARCH=${MACHINE_ARCH:Q}
-FILES_SUBST+= OBJECT_FMT=${OBJECT_FMT:Q}
-FILES_SUBST+= LDCONFIG=${LDCONFIG:Q}
-
-.include "../../mk/bsd.prefs.mk"
-
-EMULSUBDIR= emul/aout
-COMPAT_LIBDIR= ${EMULSUBDIR}/usr/lib
-COMPAT_XLIBDIR= ${EMULSUBDIR}/usr/X11R6/lib
-
-PLIST_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR:Q} COMPAT_XLIBDIR=${COMPAT_XLIBDIR:Q}
-
-do-install:
- ${INSTALL_DATA_DIR} ${PREFIX}/${COMPAT_LIBDIR}
- ${INSTALL_DATA} ${WRKDIR}/lib/lib*.so* ${PREFIX}/${COMPAT_LIBDIR}
- if [ -d ${WRKDIR}/X11R6/lib ]; then \
- ${INSTALL_DATA_DIR} ${PREFIX}/${COMPAT_XLIBDIR}; \
- ${INSTALL_DATA} ${WRKDIR}/X11R6/lib/lib*.so* ${PREFIX}/${COMPAT_XLIBDIR}; \
- fi
-
-.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/netbsd32_compat14/PLIST b/emulators/netbsd32_compat14/PLIST
deleted file mode 100644
index cb003ee56c3..00000000000
--- a/emulators/netbsd32_compat14/PLIST
+++ /dev/null
@@ -1,39 +0,0 @@
-@comment $NetBSD: PLIST,v 1.1 2001/10/31 23:53:02 zuntum Exp $
-${COMPAT_LIBDIR}/libamu.so.1.1
-${COMPAT_LIBDIR}/libbfd.so.3.0
-${COMPAT_LIBDIR}/libbz2.so.0.0
-${COMPAT_LIBDIR}/libc.so.12.40.2
-${COMPAT_LIBDIR}/libcrypt.so.0.0
-${COMPAT_LIBDIR}/libcurses.so.2.2
-${COMPAT_LIBDIR}/libedit.so.2.2
-${COMPAT_LIBDIR}/libg2c.so.0.0
-${COMPAT_LIBDIR}/libgnumalloc.so.0.0
-${COMPAT_LIBDIR}/libkvm.so.5.0
-${COMPAT_LIBDIR}/libm.so.0.1
-${COMPAT_LIBDIR}/libntp.so.0.0
-${COMPAT_LIBDIR}/libobjc.so.0.0
-${COMPAT_LIBDIR}/libossaudio.so.0.0
-${COMPAT_LIBDIR}/libpcap.so.0.0
-${COMPAT_LIBDIR}/libposix.so.0.1
-${COMPAT_LIBDIR}/libresolv.so.1.0
-${COMPAT_LIBDIR}/libskey.so.0.0
-${COMPAT_LIBDIR}/libstdc++.so.2.0
-${COMPAT_LIBDIR}/libtelnet.so.1.0
-${COMPAT_LIBDIR}/libtermcap.so.0.0
-${COMPAT_LIBDIR}/libtermlib.so.0.0
-${COMPAT_LIBDIR}/libutil.so.5.0
-${COMPAT_LIBDIR}/libwrap.so.0.0
-${COMPAT_LIBDIR}/libz.so.0.1
-${COMPAT_XLIBDIR}/libICE.so.6.3
-${COMPAT_XLIBDIR}/libPEX5.so.6.0
-${COMPAT_XLIBDIR}/libSM.so.6.0
-${COMPAT_XLIBDIR}/libX11.so.6.1
-${COMPAT_XLIBDIR}/libXIE.so.6.0
-${COMPAT_XLIBDIR}/libXaw.so.6.1
-${COMPAT_XLIBDIR}/libXext.so.6.3
-${COMPAT_XLIBDIR}/libXi.so.6.0
-${COMPAT_XLIBDIR}/libXmu.so.6.0
-${COMPAT_XLIBDIR}/libXp.so.6.2
-${COMPAT_XLIBDIR}/libXt.so.6.0
-${COMPAT_XLIBDIR}/libXtst.so.6.1
-${COMPAT_XLIBDIR}/liboldX.so.6.0
diff --git a/emulators/netbsd32_compat14/PLIST.x86_64 b/emulators/netbsd32_compat14/PLIST.x86_64
deleted file mode 100644
index 39ea1bb8128..00000000000
--- a/emulators/netbsd32_compat14/PLIST.x86_64
+++ /dev/null
@@ -1,3 +0,0 @@
-@comment $NetBSD: PLIST.x86_64,v 1.1 2005/02/21 21:08:50 veego Exp $
-${COMPAT_LIBDIR}/libi386.so.0.2
-${COMPAT_LIBDIR}/libkeycap.so.0.0
diff --git a/emulators/netbsd32_compat14/distinfo b/emulators/netbsd32_compat14/distinfo
deleted file mode 100644
index 5601d4c24b4..00000000000
--- a/emulators/netbsd32_compat14/distinfo
+++ /dev/null
@@ -1,8 +0,0 @@
-$NetBSD: distinfo,v 1.6 2006/05/11 19:02:08 veego Exp $
-
-SHA1 (compat14-i386-1.4.3.1.tar.gz) = 7c00ede3cf18bfc437e9262f0e583bde5f134004
-RMD160 (compat14-i386-1.4.3.1.tar.gz) = 7e1aba3308a3efec20384a1170f4b7b2d5e7ac72
-Size (compat14-i386-1.4.3.1.tar.gz) = 1646083 bytes
-SHA1 (compat14-sparc-1.4.3.1.tar.gz) = 9c0e46ced11f1f56fde79158edebb12898ea4ffa
-RMD160 (compat14-sparc-1.4.3.1.tar.gz) = 02a4eb94bb962889a74e9439fbb108b3b3d3e883
-Size (compat14-sparc-1.4.3.1.tar.gz) = 1831758 bytes
diff --git a/emulators/netbsd32_compat15-extras/Makefile b/emulators/netbsd32_compat15-extras/Makefile
new file mode 100644
index 00000000000..78bf6f8c5b3
--- /dev/null
+++ b/emulators/netbsd32_compat15-extras/Makefile
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:29 jlam Exp $
+
+NETBSD_COMPAT32= yes
+
+.include "${.CURDIR}/../compat15-extras/Makefile"
diff --git a/emulators/netbsd32_compat15/DEINSTALL b/emulators/netbsd32_compat15/DEINSTALL
deleted file mode 100644
index ce3a679ff7a..00000000000
--- a/emulators/netbsd32_compat15/DEINSTALL
+++ /dev/null
@@ -1,20 +0,0 @@
-# $NetBSD: DEINSTALL,v 1.2 2003/08/30 19:09:38 jlam Exp $
-
-case ${STAGE} in
-POST-DEINSTALL)
- MACHINE_ARCH=@MACHINE_ARCH@
- COMPAT_LIBDIR=@COMPAT_LIBDIR@
- COMPAT_LIBEXECDIR=@COMPAT_LIBEXECDIR@
- COMPAT_XLIBDIR=@COMPAT_XLIBDIR@
-
- ${RMDIR} -p ${PKG_PREFIX}/${COMPAT_LIBDIR} ${PKG_PREFIX}/${COMPAT_LIBEXECDIR} ${PKG_PREFIX}/${COMPAT_XLIBDIR} 2>/dev/null || ${TRUE}
-
- # clean up the symlink
- ${RM} -f /emul/netbsd32
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/netbsd32_compat15/DESCR b/emulators/netbsd32_compat15/DESCR
deleted file mode 100644
index 6896be8f4a9..00000000000
--- a/emulators/netbsd32_compat15/DESCR
+++ /dev/null
@@ -1,5 +0,0 @@
-This package supplies the user files necessary for full compatibility with
-dynamically linked executables compiled under NetBSD 1.5, on a 32-bit
-platform, running on a 64-bit host.. You still need the options COMPAT_15
-and COMPAT_NETBSD32 in your kernel configuration (and probably others; see
-options(4) for more information) to make use of NetBSD 1.5 binaries.
diff --git a/emulators/netbsd32_compat15/INSTALL b/emulators/netbsd32_compat15/INSTALL
deleted file mode 100644
index aa33aa31b15..00000000000
--- a/emulators/netbsd32_compat15/INSTALL
+++ /dev/null
@@ -1,50 +0,0 @@
-# $NetBSD: INSTALL,v 1.2 2003/08/30 19:09:38 jlam Exp $
-
-case ${STAGE} in
-POST-INSTALL)
- MACHINE_ARCH=@MACHINE_ARCH@
- OBJECT_FMT=@OBJECT_FMT@
-
- # Only create the symlink on certain platform/object combinations. Note
- # that sparc64 a.out compatibility lives in /emul/aout, not /emul/netbsd32.
- #
- create_emul_symlink=0
- if [ "${MACHINE_ARCH}" = "sparc64" ]
- then
- create_emul_symlink=1
- fi
-
- if [ ${create_emul_symlink} = 1 ]
- then
- # Create a symlink from /emul/aout --> ${PKG_PREFIX}/emul/aout
- # if it doesn't already exist. Warn if we can't do this.
- #
- emul=netbsd32
- 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
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/netbsd32_compat15/Makefile b/emulators/netbsd32_compat15/Makefile
index 89eaf1489e7..48ab00ddc3e 100644
--- a/emulators/netbsd32_compat15/Makefile
+++ b/emulators/netbsd32_compat15/Makefile
@@ -1,63 +1,5 @@
-# $NetBSD: Makefile,v 1.18 2007/02/22 19:26:27 wiz Exp $
-#
+# $NetBSD: Makefile,v 1.19 2007/08/21 22:49:29 jlam Exp $
-.if ${MACHINE_ARCH} == "sparc64"
-MACHINE32_ARCH= sparc
-.else
-MACHINE32_ARCH= ${MACHINE_ARCH}
-.endif
+NETBSD_COMPAT32= yes
-DISTNAME= compat15-${MACHINE32_ARCH}
-PKGNAME= netbsd32_compat15-1.0
-CATEGORIES= emulators
-MASTER_SITES= ${MASTER_SITE_LOCAL}
-
-MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= http://www.NetBSD.org/Releases/formal-1.5/index.html
-COMMENT= 32-bit shared libraries for NetBSD 1.5 (and earlier) compatibility
-
-CONFLICTS= netbsd32_compat16-[0-9]*
-
-ONLY_FOR_PLATFORM= NetBSD-*-sparc64
-NO_SRC_ON_FTP= Already in MASTER_SITE_LOCAL
-
-NO_MTREE= yes
-NO_BUILD= yes
-CHECK_SHLIBS_SUPPORTED= no
-
-FILES_SUBST+= COMPAT_LIBEXECDIR=${COMPAT_LIBEXECDIR:Q}
-FILES_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR:Q}
-FILES_SUBST+= COMPAT_XLIBDIR=${COMPAT_XLIBDIR:Q}
-FILES_SUBST+= MACHINE_ARCH=${MACHINE_ARCH:Q}
-FILES_SUBST+= OBJECT_FMT=${OBJECT_FMT:Q}
-FILES_SUBST+= LDCONFIG=${LDCONFIG:Q}
-
-.include "../../mk/bsd.prefs.mk"
-
-EMULSUBDIR= emul/netbsd32
-COMPAT_LIBDIR= ${EMULSUBDIR}/usr/lib
-COMPAT_LIBEXECDIR= ${EMULSUBDIR}/usr/libexec
-COMPAT_XLIBDIR= ${EMULSUBDIR}/usr/X11R6/lib
-
-PLIST_SUBST+= COMPAT_LIBDIR=${COMPAT_LIBDIR:Q} COMPAT_LIBEXECDIR=${COMPAT_LIBEXECDIR:Q} COMPAT_XLIBDIR=${COMPAT_XLIBDIR:Q}
-
-# XXX using pax to copy symlinks properly.
-do-install:
- ${INSTALL_DATA_DIR} ${PREFIX}/${COMPAT_LIBDIR}
- (cd ${WRKDIR}/lib; ${PAX} -rwv lib*.so* ${PREFIX}/${COMPAT_LIBDIR}; \
- ${CHOWN} ${ROOT_USER}:${ROOT_GROUP} ${PREFIX}/${COMPAT_LIBDIR}/lib*.so*; \
- ${CHMOD} 555 ${PREFIX}/${COMPAT_LIBDIR}/lib*.so* )
- if [ -d ${WRKDIR}/X11R6/lib ]; then \
- ${INSTALL_DATA_DIR} ${PREFIX}/${COMPAT_XLIBDIR}; \
- (cd ${WRKDIR}/X11R6/lib; ${PAX} -rwv lib*.so* ${PREFIX}/${COMPAT_XLIBDIR}; \
- ${CHOWN} ${ROOT_USER}:${ROOT_GROUP} ${PREFIX}/${COMPAT_XLIBDIR}/lib*.so*; \
- ${CHMOD} 555 ${PREFIX}/${COMPAT_XLIBDIR}/lib*.so* ) \
- fi
- if [ -d ${WRKDIR}/libexec ]; then \
- ${INSTALL_DATA_DIR} ${PREFIX}/${COMPAT_LIBEXECDIR}; \
- (cd ${WRKDIR}/libexec; ${PAX} -rwv ld.*so ${PREFIX}/${COMPAT_LIBEXECDIR}; \
- ${CHOWN} ${ROOT_USER}:${ROOT_GROUP} ${PREFIX}/${COMPAT_LIBEXECDIR}/ld.*so; \
- ${CHMOD} 555 ${PREFIX}/${COMPAT_LIBEXECDIR}/ld.*so ) \
- fi
-
-.include "../../mk/bsd.pkg.mk"
+.include "${.CURDIR}/../compat15/Makefile"
diff --git a/emulators/netbsd32_compat15/PLIST b/emulators/netbsd32_compat15/PLIST
deleted file mode 100644
index ab9b057c1c1..00000000000
--- a/emulators/netbsd32_compat15/PLIST
+++ /dev/null
@@ -1,117 +0,0 @@
-@comment $NetBSD: PLIST,v 1.1 2001/10/31 23:53:06 zuntum Exp $
-${COMPAT_LIBDIR}/libamu.so.1
-${COMPAT_LIBDIR}/libamu.so.1.1
-${COMPAT_LIBDIR}/libasn1.so.2
-${COMPAT_LIBDIR}/libasn1.so.2.0
-${COMPAT_LIBDIR}/libbz2.so.0
-${COMPAT_LIBDIR}/libbz2.so.0.0
-${COMPAT_LIBDIR}/libc.so.12
-${COMPAT_LIBDIR}/libc.so.12.62.1
-${COMPAT_LIBDIR}/libcom_err.so.3
-${COMPAT_LIBDIR}/libcom_err.so.3.0
-${COMPAT_LIBDIR}/libcrypt.so.0
-${COMPAT_LIBDIR}/libcrypt.so.0.0
-${COMPAT_LIBDIR}/libcrypto.so.0
-${COMPAT_LIBDIR}/libcrypto.so.0.2
-${COMPAT_LIBDIR}/libcurses.so.3
-${COMPAT_LIBDIR}/libcurses.so.3.6
-${COMPAT_LIBDIR}/libdes.so.5
-${COMPAT_LIBDIR}/libdes.so.5.1
-${COMPAT_LIBDIR}/libedit.so.2
-${COMPAT_LIBDIR}/libedit.so.2.3
-${COMPAT_LIBDIR}/libg2c.so.0
-${COMPAT_LIBDIR}/libg2c.so.0.0
-${COMPAT_LIBDIR}/libgnumalloc.so.0
-${COMPAT_LIBDIR}/libgnumalloc.so.0.0
-${COMPAT_LIBDIR}/libgssapi.so.0
-${COMPAT_LIBDIR}/libgssapi.so.0.4
-${COMPAT_LIBDIR}/libhdb.so.4
-${COMPAT_LIBDIR}/libhdb.so.4.1
-${COMPAT_LIBDIR}/libipsec.so.2
-${COMPAT_LIBDIR}/libipsec.so.2.0
-${COMPAT_LIBDIR}/libkadm.so.4
-${COMPAT_LIBDIR}/libkadm.so.4.0
-${COMPAT_LIBDIR}/libkadm5clnt.so.5
-${COMPAT_LIBDIR}/libkadm5clnt.so.5.1
-${COMPAT_LIBDIR}/libkadm5srv.so.6
-${COMPAT_LIBDIR}/libkadm5srv.so.6.0
-${COMPAT_LIBDIR}/libkafs.so.4
-${COMPAT_LIBDIR}/libkafs.so.4.0
-${COMPAT_LIBDIR}/libkdb.so.4
-${COMPAT_LIBDIR}/libkdb.so.4.0
-${COMPAT_LIBDIR}/libkrb.so.4
-${COMPAT_LIBDIR}/libkrb.so.4.0
-${COMPAT_LIBDIR}/libkrb5.so.11
-${COMPAT_LIBDIR}/libkrb5.so.11.1
-${COMPAT_LIBDIR}/libkstream.so.1
-${COMPAT_LIBDIR}/libkstream.so.1.0
-${COMPAT_LIBDIR}/libkvm.so.5
-${COMPAT_LIBDIR}/libkvm.so.5.1
-${COMPAT_LIBDIR}/libm.so.0
-${COMPAT_LIBDIR}/libm.so.0.1
-${COMPAT_LIBDIR}/libmenu.so.1
-${COMPAT_LIBDIR}/libmenu.so.1.0
-${COMPAT_LIBDIR}/libobjc.so.0
-${COMPAT_LIBDIR}/libobjc.so.0.0
-${COMPAT_LIBDIR}/libossaudio.so.0
-${COMPAT_LIBDIR}/libossaudio.so.0.0
-${COMPAT_LIBDIR}/libpcap.so.1
-${COMPAT_LIBDIR}/libpcap.so.1.1
-${COMPAT_LIBDIR}/libposix.so.0
-${COMPAT_LIBDIR}/libposix.so.0.1
-${COMPAT_LIBDIR}/libresolv.so.1
-${COMPAT_LIBDIR}/libresolv.so.1.0
-${COMPAT_LIBDIR}/libroken.so.8
-${COMPAT_LIBDIR}/libroken.so.8.1
-${COMPAT_LIBDIR}/libskey.so.1
-${COMPAT_LIBDIR}/libskey.so.1.0
-${COMPAT_LIBDIR}/libsl.so.1
-${COMPAT_LIBDIR}/libsl.so.1.0
-${COMPAT_LIBDIR}/libss.so.3
-${COMPAT_LIBDIR}/libss.so.3.0
-${COMPAT_LIBDIR}/libssl.so.1
-${COMPAT_LIBDIR}/libssl.so.1.0
-${COMPAT_LIBDIR}/libstdc++.so.2
-${COMPAT_LIBDIR}/libstdc++.so.2.0
-${COMPAT_LIBDIR}/libtelnet.so.3
-${COMPAT_LIBDIR}/libtelnet.so.3.0
-${COMPAT_LIBDIR}/libtermcap.so.0
-${COMPAT_LIBDIR}/libtermcap.so.0.4
-${COMPAT_LIBDIR}/libtermlib.so.0
-${COMPAT_LIBDIR}/libtermlib.so.0.4
-${COMPAT_LIBDIR}/libusb.so.0
-${COMPAT_LIBDIR}/libusb.so.0.0
-${COMPAT_LIBDIR}/libutil.so.5
-${COMPAT_LIBDIR}/libutil.so.5.2
-${COMPAT_LIBDIR}/libwrap.so.0
-${COMPAT_LIBDIR}/libwrap.so.0.2
-${COMPAT_LIBDIR}/libz.so.0
-${COMPAT_LIBDIR}/libz.so.0.2
-${COMPAT_XLIBDIR}/libICE.so.6
-${COMPAT_XLIBDIR}/libICE.so.6.3
-${COMPAT_XLIBDIR}/libPEX5.so.6
-${COMPAT_XLIBDIR}/libPEX5.so.6.0
-${COMPAT_XLIBDIR}/libSM.so.6
-${COMPAT_XLIBDIR}/libSM.so.6.0
-${COMPAT_XLIBDIR}/libX11.so.6
-${COMPAT_XLIBDIR}/libX11.so.6.1
-${COMPAT_XLIBDIR}/libXIE.so.6
-${COMPAT_XLIBDIR}/libXIE.so.6.0
-${COMPAT_XLIBDIR}/libXaw.so.6
-${COMPAT_XLIBDIR}/libXaw.so.6.1
-${COMPAT_XLIBDIR}/libXext.so.6
-${COMPAT_XLIBDIR}/libXext.so.6.3
-${COMPAT_XLIBDIR}/libXi.so.6
-${COMPAT_XLIBDIR}/libXi.so.6.0
-${COMPAT_XLIBDIR}/libXmu.so.6
-${COMPAT_XLIBDIR}/libXmu.so.6.0
-${COMPAT_XLIBDIR}/libXp.so.6
-${COMPAT_XLIBDIR}/libXp.so.6.2
-${COMPAT_XLIBDIR}/libXt.so.6
-${COMPAT_XLIBDIR}/libXt.so.6.0
-${COMPAT_XLIBDIR}/libXtst.so.6
-${COMPAT_XLIBDIR}/libXtst.so.6.1
-${COMPAT_XLIBDIR}/liboldX.so.6
-${COMPAT_XLIBDIR}/liboldX.so.6.0
-${COMPAT_LIBEXECDIR}/ld.so
-${COMPAT_LIBEXECDIR}/ld.elf_so
diff --git a/emulators/netbsd32_compat15/distinfo b/emulators/netbsd32_compat15/distinfo
deleted file mode 100644
index 909fecd70f1..00000000000
--- a/emulators/netbsd32_compat15/distinfo
+++ /dev/null
@@ -1,5 +0,0 @@
-$NetBSD: distinfo,v 1.3 2005/05/25 12:01:21 wiz Exp $
-
-SHA1 (compat15-sparc.tar.gz) = 1abd33e4de7127e27da0b64d915cb7ba53cff2a9
-RMD160 (compat15-sparc.tar.gz) = bfa676c116947596019d1cfa9a132502e8248193
-Size (compat15-sparc.tar.gz) = 2562164 bytes
diff --git a/emulators/netbsd32_compat16-extras/Makefile b/emulators/netbsd32_compat16-extras/Makefile
new file mode 100644
index 00000000000..cacb6216d75
--- /dev/null
+++ b/emulators/netbsd32_compat16-extras/Makefile
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:31 jlam Exp $
+
+NETBSD_COMPAT32= yes
+
+.include "${.CURDIR}/../compat16-extras/Makefile"
diff --git a/emulators/netbsd32_compat16/DEINSTALL b/emulators/netbsd32_compat16/DEINSTALL
deleted file mode 100644
index bdf500b2920..00000000000
--- a/emulators/netbsd32_compat16/DEINSTALL
+++ /dev/null
@@ -1,18 +0,0 @@
-# $NetBSD: DEINSTALL,v 1.2 2003/08/30 19:11:57 jlam Exp $
-
-case ${STAGE} in
-POST-DEINSTALL)
- MACHINE_ARCH=@MACHINE_ARCH@
- COMPAT_EMULSUBDIR=@COMPAT_EMULSUBDIR@
-
- ${RMDIR} -p ${PKG_PREFIX}/${COMPAT_EMULSUBDIR} 2>/dev/null || ${TRUE}
-
- # clean up the symlink
- ${RM} -f /emul/netbsd32
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/netbsd32_compat16/DESCR b/emulators/netbsd32_compat16/DESCR
deleted file mode 100644
index aa17c646fc6..00000000000
--- a/emulators/netbsd32_compat16/DESCR
+++ /dev/null
@@ -1,5 +0,0 @@
-This package supplies the user files necessary for full compatibility with
-dynamically linked executables compiled under NetBSD 1.6, on a 32-bit
-platform, running on a 64-bit host.. You still need the options COMPAT_15
-and COMPAT_NETBSD32 in your kernel configuration (and probably others; see
-options(4) for more information) to make use of NetBSD 1.6 binaries.
diff --git a/emulators/netbsd32_compat16/INSTALL b/emulators/netbsd32_compat16/INSTALL
deleted file mode 100644
index 5aff595eed5..00000000000
--- a/emulators/netbsd32_compat16/INSTALL
+++ /dev/null
@@ -1,51 +0,0 @@
-# $NetBSD: INSTALL,v 1.3 2005/01/11 05:12:56 hamajima Exp $
-
-case ${STAGE} in
-POST-INSTALL)
- MACHINE_ARCH=@MACHINE_ARCH@
- OBJECT_FMT=@OBJECT_FMT@
-
- # Only create the symlink on certain platform/object combinations. Note
- # that sparc64 a.out compatibility lives in /emul/aout, not /emul/netbsd32.
- #
- create_emul_symlink=0
- case ${MACHINE_ARCH} in
- sparc64 | x86_64)
- create_emul_symlink=1
- ;;
- esac
-
- if [ ${create_emul_symlink} = 1 ]
- then
- # Create a symlink from /emul/aout --> ${PKG_PREFIX}/emul/aout
- # if it doesn't already exist. Warn if we can't do this.
- #
- emul=netbsd32
- 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
-
- # Regenerate the shared library cache. This should work on either
- # a.out or on ELF with the 1.5 release.
- #
- ( @LDCONFIG@ || ${TRUE} ) >/dev/null 2>&1
- ;;
-esac
diff --git a/emulators/netbsd32_compat16/Makefile b/emulators/netbsd32_compat16/Makefile
index 97fcffd3d87..77719be1df1 100644
--- a/emulators/netbsd32_compat16/Makefile
+++ b/emulators/netbsd32_compat16/Makefile
@@ -1,65 +1,5 @@
-# $NetBSD: Makefile,v 1.17 2006/10/19 19:39:04 wiz Exp $
-#
+# $NetBSD: Makefile,v 1.18 2007/08/21 22:49:30 jlam Exp $
-.if ${MACHINE_ARCH} == "sparc64"
-MACHINE32_ARCH= sparc
-.elif ${MACHINE_ARCH} == "x86_64"
-MACHINE32_ARCH= i386
-.else
-MACHINE32_ARCH= ${MACHINE_ARCH}
-.endif
+NETBSD_COMPAT32= yes
-.if ${MACHINE32_ARCH} == "sparc"
-DISTNAME= compat16-${MACHINE32_ARCH}
-.else
-DISTNAME= compat16-${MACHINE32_ARCH}-1.6.0
-.endif
-PKGNAME= netbsd32_compat16-1.0
-PKGREVISION= 1
-CATEGORIES= emulators
-MASTER_SITES= ${MASTER_SITE_LOCAL}
-EXTRACT_SUFX= .tar.bz2
-
-MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= http://www.NetBSD.org/Releases/formal-1.6/index.html
-COMMENT= 32-bit shared libraries for NetBSD 1.6 (and earlier) compatibility
-
-CONFLICTS= netbsd32_compat15-[0-9]*
-
-ONLY_FOR_PLATFORM= NetBSD-[2-9]*-sparc64
-ONLY_FOR_PLATFORM+= NetBSD-[2-9]*-x86_64
-NO_SRC_ON_FTP= Already in MASTER_SITE_LOCAL
-
-NO_MTREE= yes
-NO_BUILD= yes
-CHECK_SHLIBS_SUPPORTED= no
-
-FILES_SUBST+= COMPAT_EMULSUBDIR=${COMPAT_EMULSUBDIR:Q}
-FILES_SUBST+= MACHINE_ARCH=${MACHINE_ARCH:Q}
-FILES_SUBST+= OBJECT_FMT=${OBJECT_FMT:Q}
-FILES_SUBST+= LDCONFIG=${LDCONFIG:Q}
-
-.include "../../mk/bsd.prefs.mk"
-
-EMULSUBDIR= emul/netbsd32
-COMPAT_LIBDIR= ${PREFIX}/${EMULSUBDIR}/usr/lib
-COMPAT_LIBEXECDIR= ${PREFIX}/${EMULSUBDIR}/usr/libexec
-COMPAT_XLIBDIR= ${PREFIX}/${EMULSUBDIR}/usr/X11R6/lib
-
-PLIST_SUBST+= COMPAT_EMULSUBDIR=${EMULSUBDIR:Q}
-
-# XXX using pax to copy symlinks properly.
-do-install:
- ${INSTALL_DATA_DIR} ${COMPAT_LIBDIR}
- ${INSTALL_DATA_DIR} ${COMPAT_XLIBDIR}
- ${INSTALL_DATA_DIR} ${COMPAT_LIBEXECDIR}
- (cd ${WRKDIR}/usr/lib; ${PAX} -rwv lib*.so* i18n/lib*.so* ${COMPAT_LIBDIR})
- (cd ${WRKDIR}/usr/X11R6/lib; ${PAX} -rwv lib*.so* ${COMPAT_XLIBDIR})
- (cd ${WRKDIR}/usr/libexec; ${PAX} -rwv ld.*so ${COMPAT_LIBEXECDIR})
- ${CHOWN} ${ROOT_USER}:${ROOT_GROUP} \
- ${COMPAT_LIBDIR}/lib*.so* ${COMPAT_LIBDIR}/i18n/lib*.so* \
- ${COMPAT_XLIBDIR}/lib*.so* ${COMPAT_LIBEXECDIR}/ld.*so
- ${CHMOD} 555 ${COMPAT_LIBDIR}/lib*.so* ${COMPAT_LIBDIR}/i18n/lib*.so* \
- ${COMPAT_XLIBDIR}/lib*.so* ${COMPAT_LIBEXECDIR}/ld.*so
-
-.include "../../mk/bsd.pkg.mk"
+.include "${.CURDIR}/../compat16/Makefile"
diff --git a/emulators/netbsd32_compat16/PLIST b/emulators/netbsd32_compat16/PLIST
deleted file mode 100644
index 806a3d81870..00000000000
--- a/emulators/netbsd32_compat16/PLIST
+++ /dev/null
@@ -1,128 +0,0 @@
-@comment $NetBSD: PLIST,v 1.3 2005/02/21 21:18:28 veego Exp $
-${COMPAT_EMULSUBDIR}/usr/lib/libamu.so.2
-${COMPAT_EMULSUBDIR}/usr/lib/libamu.so.2.1
-${COMPAT_EMULSUBDIR}/usr/lib/libasn1.so.6
-${COMPAT_EMULSUBDIR}/usr/lib/libasn1.so.6.0
-${COMPAT_EMULSUBDIR}/usr/lib/libbz2.so.1
-${COMPAT_EMULSUBDIR}/usr/lib/libbz2.so.1.0
-${COMPAT_EMULSUBDIR}/usr/lib/libc.so.12
-${COMPAT_EMULSUBDIR}/usr/lib/libc.so.12.83
-${COMPAT_EMULSUBDIR}/usr/lib/libcdk.so.1
-${COMPAT_EMULSUBDIR}/usr/lib/libcdk.so.1.0
-${COMPAT_EMULSUBDIR}/usr/lib/libcom_err.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/libcom_err.so.4.1
-${COMPAT_EMULSUBDIR}/usr/lib/libcrypt.so.0
-${COMPAT_EMULSUBDIR}/usr/lib/libcrypt.so.0.0
-${COMPAT_EMULSUBDIR}/usr/lib/libcrypto.so.1
-${COMPAT_EMULSUBDIR}/usr/lib/libcrypto.so.1.1
-${COMPAT_EMULSUBDIR}/usr/lib/libcurses.so.5
-${COMPAT_EMULSUBDIR}/usr/lib/libcurses.so.5.0
-${COMPAT_EMULSUBDIR}/usr/lib/libdes.so.6
-${COMPAT_EMULSUBDIR}/usr/lib/libdes.so.6.0
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libBIG5.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libBIG5.so.4.0
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libEUC.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libEUC.so.4.0
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libEUCTW.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libEUCTW.so.4.0
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libISO2022.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libISO2022.so.4.0
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libMSKanji.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libMSKanji.so.4.0
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libUTF8.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/i18n/libUTF8.so.4.0
-${COMPAT_EMULSUBDIR}/usr/lib/libedit.so.2
-${COMPAT_EMULSUBDIR}/usr/lib/libedit.so.2.6
-${COMPAT_EMULSUBDIR}/usr/lib/libform.so.3
-${COMPAT_EMULSUBDIR}/usr/lib/libform.so.3.0
-${COMPAT_EMULSUBDIR}/usr/lib/libgnumalloc.so.0
-${COMPAT_EMULSUBDIR}/usr/lib/libgnumalloc.so.0.0
-${COMPAT_EMULSUBDIR}/usr/lib/libgssapi.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/libgssapi.so.4.0
-${COMPAT_EMULSUBDIR}/usr/lib/libhdb.so.8
-${COMPAT_EMULSUBDIR}/usr/lib/libhdb.so.8.0
-${COMPAT_EMULSUBDIR}/usr/lib/libintl.so.0
-${COMPAT_EMULSUBDIR}/usr/lib/libintl.so.0.0
-${COMPAT_EMULSUBDIR}/usr/lib/libipsec.so.2
-${COMPAT_EMULSUBDIR}/usr/lib/libipsec.so.2.0
-${COMPAT_EMULSUBDIR}/usr/lib/libkadm.so.5
-${COMPAT_EMULSUBDIR}/usr/lib/libkadm.so.5.0
-${COMPAT_EMULSUBDIR}/usr/lib/libkadm5clnt.so.7
-${COMPAT_EMULSUBDIR}/usr/lib/libkadm5clnt.so.7.0
-${COMPAT_EMULSUBDIR}/usr/lib/libkadm5srv.so.8
-${COMPAT_EMULSUBDIR}/usr/lib/libkadm5srv.so.8.0
-${COMPAT_EMULSUBDIR}/usr/lib/libkafs.so.5
-${COMPAT_EMULSUBDIR}/usr/lib/libkafs.so.5.1
-${COMPAT_EMULSUBDIR}/usr/lib/libkdb.so.5
-${COMPAT_EMULSUBDIR}/usr/lib/libkdb.so.5.0
-${COMPAT_EMULSUBDIR}/usr/lib/libkrb.so.5
-${COMPAT_EMULSUBDIR}/usr/lib/libkrb.so.5.1
-${COMPAT_EMULSUBDIR}/usr/lib/libkrb5.so.18
-${COMPAT_EMULSUBDIR}/usr/lib/libkrb5.so.18.0
-${COMPAT_EMULSUBDIR}/usr/lib/libkstream.so.2
-${COMPAT_EMULSUBDIR}/usr/lib/libkstream.so.2.0
-${COMPAT_EMULSUBDIR}/usr/lib/libkvm.so.5
-${COMPAT_EMULSUBDIR}/usr/lib/libkvm.so.5.1
-${COMPAT_EMULSUBDIR}/usr/lib/libm.so.0
-${COMPAT_EMULSUBDIR}/usr/lib/libm.so.0.1
-${COMPAT_EMULSUBDIR}/usr/lib/libmenu.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/libmenu.so.4.0
-${COMPAT_EMULSUBDIR}/usr/lib/libobjc.so.1
-${COMPAT_EMULSUBDIR}/usr/lib/libobjc.so.1.0
-${COMPAT_EMULSUBDIR}/usr/lib/libossaudio.so.0
-${COMPAT_EMULSUBDIR}/usr/lib/libossaudio.so.0.0
-${COMPAT_EMULSUBDIR}/usr/lib/libpcap.so.1
-${COMPAT_EMULSUBDIR}/usr/lib/libpcap.so.1.2
-${COMPAT_EMULSUBDIR}/usr/lib/libpci.so.0
-${COMPAT_EMULSUBDIR}/usr/lib/libpci.so.0.0
-${COMPAT_EMULSUBDIR}/usr/lib/libposix.so.0
-${COMPAT_EMULSUBDIR}/usr/lib/libposix.so.0.1
-${COMPAT_EMULSUBDIR}/usr/lib/libresolv.so.1
-${COMPAT_EMULSUBDIR}/usr/lib/libresolv.so.1.0
-${COMPAT_EMULSUBDIR}/usr/lib/libroken.so.12
-${COMPAT_EMULSUBDIR}/usr/lib/libroken.so.12.2
-${COMPAT_EMULSUBDIR}/usr/lib/libskey.so.1
-${COMPAT_EMULSUBDIR}/usr/lib/libskey.so.1.0
-${COMPAT_EMULSUBDIR}/usr/lib/libsl.so.2
-${COMPAT_EMULSUBDIR}/usr/lib/libsl.so.2.0
-${COMPAT_EMULSUBDIR}/usr/lib/libss.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/libss.so.4.0
-${COMPAT_EMULSUBDIR}/usr/lib/libssl.so.2
-${COMPAT_EMULSUBDIR}/usr/lib/libssl.so.2.1
-${COMPAT_EMULSUBDIR}/usr/lib/libstdc++.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/libstdc++.so.4.0
-${COMPAT_EMULSUBDIR}/usr/lib/libtelnet.so.4
-${COMPAT_EMULSUBDIR}/usr/lib/libtelnet.so.4.0
-${COMPAT_EMULSUBDIR}/usr/lib/libtermcap.so.0
-${COMPAT_EMULSUBDIR}/usr/lib/libtermcap.so.0.5
-${COMPAT_EMULSUBDIR}/usr/lib/libtermlib.so.0
-${COMPAT_EMULSUBDIR}/usr/lib/libtermlib.so.0.5
-${COMPAT_EMULSUBDIR}/usr/lib/libusbhid.so.1
-${COMPAT_EMULSUBDIR}/usr/lib/libusbhid.so.1.0
-${COMPAT_EMULSUBDIR}/usr/lib/libutil.so.6
-${COMPAT_EMULSUBDIR}/usr/lib/libutil.so.6.0
-${COMPAT_EMULSUBDIR}/usr/lib/libwrap.so.0
-${COMPAT_EMULSUBDIR}/usr/lib/libwrap.so.0.2
-${COMPAT_EMULSUBDIR}/usr/lib/libz.so.0
-${COMPAT_EMULSUBDIR}/usr/lib/libz.so.0.2
-${COMPAT_EMULSUBDIR}/usr/libexec/ld.elf_so
-${COMPAT_EMULSUBDIR}/usr/libexec/ld.so
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libICE.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libICE.so.6.3
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libSM.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libSM.so.6.0
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libX11.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXaw.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXaw.so.6.1
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXext.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXi.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXi.so.6.0
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXmu.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXp.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXp.so.6.2
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXt.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXt.so.6.0
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXtst.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXtst.so.6.1
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/liboldX.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/liboldX.so.6.0
diff --git a/emulators/netbsd32_compat16/PLIST.sparc64 b/emulators/netbsd32_compat16/PLIST.sparc64
deleted file mode 100644
index 06f9c71c957..00000000000
--- a/emulators/netbsd32_compat16/PLIST.sparc64
+++ /dev/null
@@ -1,8 +0,0 @@
-@comment $NetBSD: PLIST.sparc64,v 1.1 2005/02/21 21:18:28 veego Exp $
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libPEX5.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libPEX5.so.6.0
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libX11.so.6.1
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXIE.so.6
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXIE.so.6.0
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXext.so.6.3
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXmu.so.6.0
diff --git a/emulators/netbsd32_compat16/PLIST.x86_64 b/emulators/netbsd32_compat16/PLIST.x86_64
deleted file mode 100644
index cf2e1c1f795..00000000000
--- a/emulators/netbsd32_compat16/PLIST.x86_64
+++ /dev/null
@@ -1,4 +0,0 @@
-@comment $NetBSD: PLIST.x86_64,v 1.1 2005/02/21 21:18:28 veego Exp $
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libX11.so.6.2
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXext.so.6.4
-${COMPAT_EMULSUBDIR}/usr/X11R6/lib/libXmu.so.6.2
diff --git a/emulators/netbsd32_compat16/distinfo b/emulators/netbsd32_compat16/distinfo
deleted file mode 100644
index 9136ff9988e..00000000000
--- a/emulators/netbsd32_compat16/distinfo
+++ /dev/null
@@ -1,7 +0,0 @@
-$NetBSD: distinfo,v 1.3 2005/02/23 18:49:19 agc Exp $
-
-SHA1 (compat16-sparc.tar.bz2) = f5cb874b06e2664582bf06680a952cf7bb571aaa
-Size (compat16-sparc.tar.bz2) = 2550861 bytes
-SHA1 (compat16-i386-1.6.0.tar.bz2) = 04c2fc19591941bb4ae79a2a909e5871b37dc33a
-RMD160 (compat16-i386-1.6.0.tar.bz2) = 175e64b53435ae1c2af3a143f3001ba6df7dad20
-Size (compat16-i386-1.6.0.tar.bz2) = 2478593 bytes
diff --git a/emulators/netbsd32_compat20-extras/Makefile b/emulators/netbsd32_compat20-extras/Makefile
new file mode 100644
index 00000000000..e1cee42aa87
--- /dev/null
+++ b/emulators/netbsd32_compat20-extras/Makefile
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:32 jlam Exp $
+
+NETBSD_COMPAT32= yes
+
+.include "${.CURDIR}/../compat20-extras/Makefile"
diff --git a/emulators/netbsd32_compat20/Makefile b/emulators/netbsd32_compat20/Makefile
new file mode 100644
index 00000000000..b1bceacf0d8
--- /dev/null
+++ b/emulators/netbsd32_compat20/Makefile
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:32 jlam Exp $
+
+NETBSD_COMPAT32= yes
+
+.include "${.CURDIR}/../compat20/Makefile"
diff --git a/emulators/netbsd32_compat30-extras/Makefile b/emulators/netbsd32_compat30-extras/Makefile
new file mode 100644
index 00000000000..82322d697bf
--- /dev/null
+++ b/emulators/netbsd32_compat30-extras/Makefile
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:32 jlam Exp $
+
+NETBSD_COMPAT32= yes
+
+.include "${.CURDIR}/../compat30-extras/Makefile"
diff --git a/emulators/netbsd32_compat30/Makefile b/emulators/netbsd32_compat30/Makefile
new file mode 100644
index 00000000000..e42e7758fbb
--- /dev/null
+++ b/emulators/netbsd32_compat30/Makefile
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2007/08/21 22:49:32 jlam Exp $
+
+NETBSD_COMPAT32= yes
+
+.include "${.CURDIR}/../compat30/Makefile"