From ded1793fc0c090218d18a3c8cd101473165dfd58 Mon Sep 17 00:00:00 2001 From: jlam Date: Mon, 19 Jun 2006 23:27:34 +0000 Subject: Cleanup fallout from {DE,}INSTALL_SRC removal: rewrite the INSTALL script to be of the format expected by the pkginstall framework and remove the explicit invocation of the INSTALL script from the post-install target. Also, split out the important text from the INSTALL script and put it into a MESSAGE file. Also, remove the unused show-shlib-type target. --- emulators/suse_base/INSTALL | 82 ++++++++++------------------------- emulators/suse_base/MESSAGE.DragonFly | 7 +++ emulators/suse_base/MESSAGE.FreeBSD | 7 +++ emulators/suse_base/MESSAGE.NetBSD | 7 +++ emulators/suse_base/Makefile | 3 +- emulators/suse_linux/Makefile.common | 15 +++++-- 6 files changed, 55 insertions(+), 66 deletions(-) create mode 100644 emulators/suse_base/MESSAGE.DragonFly create mode 100644 emulators/suse_base/MESSAGE.FreeBSD create mode 100644 emulators/suse_base/MESSAGE.NetBSD diff --git a/emulators/suse_base/INSTALL b/emulators/suse_base/INSTALL index 5b55be3a78e..1e0de2886cd 100644 --- a/emulators/suse_base/INSTALL +++ b/emulators/suse_base/INSTALL @@ -1,68 +1,30 @@ -#!/bin/sh -# $NetBSD: INSTALL,v 1.4 2004/04/14 11:31:10 xtraeme Exp $ +# $NetBSD: INSTALL,v 1.5 2006/06/19 23:27:34 jlam Exp $ -if [ "$2" != "POST-INSTALL" ]; then exit 0; fi -emul=linux -OPSYS=`/usr/bin/uname -s` +case "${STAGE}" in +POST-INSTALL) + emulsubdir=linux -cat </dev/null && ${PWD_CMD}` + pkgemuldir_pwd=`cd $pkgemulsubdir 2>/dev/null && ${PWD_CMD}` -if [ "$OPSYS" = "NetBSD" ]; then - if [ "`cd /etc && cd ${PKG_PREFIX}/emul/$emul 2>/dev/null && pwd -P`" != \ - "`cd / && cd /emul/$emul 2>/dev/null && pwd -P`" ]; then - if [ -e /emul/$emul -o -L /emul/$emul ] || \ - [ \( -e /emul -o -L /emul \) -a ! -d /emul ]; then - cat <<-EOF - - IMPORTANT: You must create a symbolic link from /emul/$emul to - ${PKG_PREFIX}/emul/$emul in order for this package to work properly. - (It seems there is something else located at /emul/$emul.) - EOF - else - mkdir -p /emul - ln -sf ${PKG_PREFIX}/emul/$emul /emul/$emul - fi - fi -fi - -if [ "$OPSYS" = "FreeBSD" ]; then - if [ "`cd /etc && cd ${PKG_PREFIX}/emul/$emul 2>/dev/null && pwd -P`" != \ - "`cd / && cd /compat/$emul 2>/dev/null && pwd -P`" ]; then - if [ -e /compat/$emul -o -L /compat/$emul ] || \ - [ \( -e /compat -o -L /compat \) -a ! -d /compat ]; then - cat <<-EOF - - IMPORTANT: You must create a symbolic link from /compat/$emul to - ${PKG_PREFIX}/emul/$emul in order for this package to work properly. - (It seems there is something else located at /compat/$emul.) - EOF - else - mkdir -p /compat - ln -sf ${PKG_PREFIX}/emul/$emul /compat/$emul - fi - fi -fi + if ${TEST} "$emuldir_pwd" != "$pkgemuldir_pwd"; then + if ${TEST} -e $emuldir -o -L $emuldir; then + ${CAT} << EOF +============================================================================== +You must create a symbolic link for ${PKGNAME} to work properly: -cat < $emuldir +It seems there is something else located at $emuldir. ============================================================================== EOF + else + ${MKDIR} -p `${DIRNAME} $emuldir` && + ${LN} -fs $pkgemuldir $emuldir + fi + fi + ;; +esac diff --git a/emulators/suse_base/MESSAGE.DragonFly b/emulators/suse_base/MESSAGE.DragonFly new file mode 100644 index 00000000000..3d3ae269bf5 --- /dev/null +++ b/emulators/suse_base/MESSAGE.DragonFly @@ -0,0 +1,7 @@ +============================================================================== +$NetBSD: MESSAGE.DragonFly,v 1.1 2006/06/19 23:27:34 jlam Exp $ + +Do not forget to include COMPAT_LINUX in your kernel configuration file. +You will also need to load the "linux.ko" kernel module (using kldload(8) +or by setting linux_enable=yes in /etc/rc.conf. +============================================================================== diff --git a/emulators/suse_base/MESSAGE.FreeBSD b/emulators/suse_base/MESSAGE.FreeBSD new file mode 100644 index 00000000000..6eaeef70240 --- /dev/null +++ b/emulators/suse_base/MESSAGE.FreeBSD @@ -0,0 +1,7 @@ +============================================================================== +$NetBSD: MESSAGE.FreeBSD,v 1.1 2006/06/19 23:27:34 jlam Exp $ + +Do not forget to include COMPAT_LINUX in your kernel configuration file. +You will also need to load the "linux.ko" kernel module (using kldload(8) +or by setting linux_enable=yes in /etc/rc.conf. +============================================================================== diff --git a/emulators/suse_base/MESSAGE.NetBSD b/emulators/suse_base/MESSAGE.NetBSD new file mode 100644 index 00000000000..6aaaf04d952 --- /dev/null +++ b/emulators/suse_base/MESSAGE.NetBSD @@ -0,0 +1,7 @@ +============================================================================== +$NetBSD: MESSAGE.NetBSD,v 1.1 2006/06/19 23:27:34 jlam Exp $ + +Do not forget to include COMPAT_LINUX in your kernel configuration file. +On NetBSD<1.6, you will also need to include the EXEC_ELF32 option. +Linux binaries require these options in order to work. +============================================================================== diff --git a/emulators/suse_base/Makefile b/emulators/suse_base/Makefile index 08b2b174a98..0e71c1e9fe9 100644 --- a/emulators/suse_base/Makefile +++ b/emulators/suse_base/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.61 2006/06/17 19:30:55 rillig Exp $ +# $NetBSD: Makefile,v 1.62 2006/06/19 23:27:34 jlam Exp $ DISTNAME= suse_base-${SUSE_VERSION} PKGREVISION= 10 @@ -85,7 +85,6 @@ do-install: < ${LINUX_LDD} > ${LINUX_LDD}.new ${MV} ${LINUX_LDD}.new ${LINUX_LDD} ${CHMOD} +x ${LINUX_LDD} - @${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${INSTALL_FILE} - POST-INSTALL .include "../../emulators/suse_linux/Makefile.common" .include "../../mk/bsd.pkg.mk" diff --git a/emulators/suse_linux/Makefile.common b/emulators/suse_linux/Makefile.common index e74ded30822..88cbe686c1d 100644 --- a/emulators/suse_linux/Makefile.common +++ b/emulators/suse_linux/Makefile.common @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.common,v 1.22 2005/12/12 14:43:25 joerg Exp $ +# $NetBSD: Makefile.common,v 1.23 2006/06/19 23:27:34 jlam Exp $ .include "../../emulators/suse_linux/vars.mk" .include "../../emulators/suse_linux/arch.mk" @@ -24,6 +24,16 @@ MANCOMPRESSED?= yes EMULSUBDIR= emul/linux EMULDIR= ${PREFIX}/${EMULSUBDIR} +# Set location of OPSYS-specific emulation directory +.if ${OPSYS} == "NetBSD" +OPSYS_EMULDIR= /${EMULSUBDIR} +.elif (${OPSYS} == "FreeBSD") || (${OPSYS} == "DragonFly") +OPSYS_EMULDIR= /compat/${EMULSUBDIR:T} +.else +OPSYS_EMULDIR= /${EMULSUBDIR} +.endif +FILES_SUBST+= OPSYS_EMULDIR=${OPSYS_EMULDIR:Q} + RPM2PKG= ${PREFIX}/sbin/rpm2pkg BUILD_DEPENDS+= rpm2pkg>=2.1:../../pkgtools/rpm2pkg @@ -59,6 +69,3 @@ do-install: ${ECHO} "@unexec %D/${EMULSUBDIR}/sbin/ldconfig -r %D/${EMULSUBDIR} 2>/dev/null" >>${PLIST_SRC}; \ fi .endif - -show-shlib-type: - @${ECHO} linux-${MACHINE_ARCH} -- cgit v1.2.3