pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc Support automatically using pkgsrc/emulators/osf1_lib ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f080c3ac609f
branches:  trunk
changeset: 531529:f080c3ac609f
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Aug 01 17:19:22 2007 +0000

description:
Support automatically using pkgsrc/emulators/osf1_lib to satisfy
EMUL_PLATFORM osf1-alpha.

diffstat:

 emulators/osf1_lib/DEINSTALL   |   14 ++++
 emulators/osf1_lib/INSTALL     |  141 +++++++++++++++++++++++++++++++++-------
 emulators/osf1_lib/Makefile    |   39 +++-------
 emulators/osf1_lib/emulator.mk |   16 ++++
 mk/emulator/osf1-netscape.mk   |    6 +
 mk/emulator/osf1.mk            |    5 +-
 6 files changed, 168 insertions(+), 53 deletions(-)

diffs (288 lines):

diff -r 1bcb277dda27 -r f080c3ac609f emulators/osf1_lib/DEINSTALL
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/osf1_lib/DEINSTALL      Wed Aug 01 17:19:22 2007 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: DEINSTALL,v 1.1 2007/08/01 17:19:22 jlam Exp $
+
+EMULDIR="${PKG_PREFIX}/@EMULSUBDIR@"
+
+case "${STAGE}" in
+DEINSTALL)
+       ${RM} -fr ${EMULDIR}/usr/lib/X11
+       ${RM} -f ${EMULDIR}/etc/hosts
+
+       # Run any actions that require root privileges.
+       ${TEST} ! -x ./+ROOT_ACTIONS ||
+               ./+ROOT_ACTIONS REMOVE ${PKG_METADATA_DIR} || exit 1
+       ;;
+esac
diff -r 1bcb277dda27 -r f080c3ac609f emulators/osf1_lib/INSTALL
--- a/emulators/osf1_lib/INSTALL        Wed Aug 01 16:57:15 2007 +0000
+++ b/emulators/osf1_lib/INSTALL        Wed Aug 01 17:19:22 2007 +0000
@@ -1,31 +1,122 @@
-# $NetBSD: INSTALL,v 1.3 2006/06/23 15:48:50 jlam Exp $
+# $NetBSD: INSTALL,v 1.4 2007/08/01 17:19:22 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
+
+EMULDIR="${PKG_PREFIX}/@EMULSUBDIR@"
+OPSYS_EMULDIR="@OPSYS_EMULDIR@"
 
 case "${STAGE}" in
 POST-INSTALL)
-       emulsubdir=osf1
-
-       emuldir="/emul/$emulsubdir"
-       pkgemuldir="${PKG_PREFIX}/emul/$emulsubdir"
-
-       emuldir_pwd=`cd $emuldir 2>/dev/null && ${PWD_CMD}`
-       pkgemuldir_pwd=`cd $pkgemuldir 2>/dev/null && ${PWD_CMD}`
+       ${TOUCH} ${EMULDIR}/etc/hosts
+       ${MKDIR} ${EMULDIR}/usr/lib/X11
+       for dir in ${X11BASE}/lib/X11/locale ${X11BASE}/share/X11/locale; do
+               if ${TEST} -d $dir; then
+                       ${LN} -fs $dir ${EMULDIR}/usr/lib/X11
+                       break
+               fi
+       done
 
-       if ${TEST} "$emuldir_pwd" != "$pkgemuldir_pwd"; then
-               if ${TEST} -e $emuldir -o -L $emuldir ||
-                  ${TEST} \( -e /emul -o -L /emul \) -a ! -d /emul; then
-                       ${CAT} << EOF
-==============================================================================
-You must create a symbolic link for ${PKGNAME} to work properly:
-
-       $pkgemuldir  ->  $emuldir
-
-It seems there is something else located at $emuldir.
-==============================================================================
-EOF
-               else
-                       ${MKDIR} -p `${DIRNAME} $emuldir` && 
-                       ${LN} -fs $pkgemuldir $emuldir
-               fi
-       fi
+       # Run any actions that require root privileges.
+       ${TEST} ! -x ./+ROOT_ACTIONS ||
+               ./+ROOT_ACTIONS ADD ${PKG_METADATA_DIR}
        ;;
 esac
diff -r 1bcb277dda27 -r f080c3ac609f emulators/osf1_lib/Makefile
--- a/emulators/osf1_lib/Makefile       Wed Aug 01 16:57:15 2007 +0000
+++ b/emulators/osf1_lib/Makefile       Wed Aug 01 17:19:22 2007 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.15 2006/07/02 10:06:43 rillig Exp $
+# $NetBSD: Makefile,v 1.16 2007/08/01 17:19:22 jlam Exp $
 
 DISTNAME=      netscape-4.7-3.alpha
 PKGNAME=       osf1_lib-1.1
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    emulators
 MASTER_SITES=  ftp://ftp.digital.com/pub/DEC/Linux-Alpha-Tools/netscape/
 EXTRACT_SUFX=  .rpm
@@ -11,37 +11,24 @@
 HOMEPAGE=      http://www.support.compaq.com/alpha-tools/software/index.html
 COMMENT=       DEC/Compaq OSF-1/Tru64 compatibility package for netscape
 
-RPM2PKG=       ${LOCALBASE}/sbin/rpm2pkg
-BUILD_DEPENDS+=        rpm2pkg>=1.2:../../pkgtools/rpm2pkg
-
-ONLY_FOR_PLATFORM=     NetBSD-*-alpha
-
 RESTRICTED=            COMPAQ Licensed Software
 NO_SRC_ON_CDROM=       ${RESTRICTED}
 NO_BIN_ON_CDROM=       ${RESTRICTED}
 NO_SRC_ON_FTP=         ${RESTRICTED}
 NO_BIN_ON_FTP=         ${RESTRICTED}
 
-WRKSRC=                        ${WRKDIR}
-EMULSUBDIR=            emul/osf1
-EMULDIR=               ${PREFIX}/${EMULSUBDIR}
+EMUL_PLATFORMS=                osf1-alpha
+ONLY_FOR_PLATFORM=     NetBSD-*-alpha
 
-EXTRACT_ONLY=  # empty
-NO_CONFIGURE=  yes
-NO_BUILD=      yes
-
-RPMARGS=       -i usr/lib -i usr/bin ${DISTDIR}/${DISTFILES}
-
-CHECK_SHLIBS_SUPPORTED=        no
+OSF1_PKG=              yes
+WRKSRC=                        ${WRKDIR}
+BUILD_DIRS=            # empty
 
-.include "../../mk/x11.buildlink3.mk"
+EMUL_PKG_FMT=          rpm
+RPM2PKG_PREFIX=                ${PREFIX}
+RPM2PKG_SUBPREFIX=     ${EMULSUBDIR}
+RPM2PKG_STAGE=         do-install
+RPMIGNOREPATH=         usr/bin usr/lib
 
-do-install:
-       ${RM} -f ${WRKDIR}/PLIST_DYNAMIC
-       ${INSTALL_DATA_DIR} ${EMULDIR}
-       ${RPM2PKG} -d ${PREFIX} -p ${EMULSUBDIR} ${RPMARGS}
-       ${TOUCH} ${EMULDIR}/etc/hosts
-       cd ${EMULDIR} && ${MKDIR} usr/lib/X11
-       cd ${EMULDIR}/usr/lib/X11 && ${LN} -fs ${X11BASE}/lib/X11/locale .
-
+.include "../../x11/libX11/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 1bcb277dda27 -r f080c3ac609f emulators/osf1_lib/emulator.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/osf1_lib/emulator.mk    Wed Aug 01 17:19:22 2007 +0000
@@ -0,0 +1,16 @@
+# $NetBSD: emulator.mk,v 1.1 2007/08/01 17:19:23 jlam Exp $
+#
+# This file is included by osf1-netscape.mk in the emulator framework.
+#
+# Variables set by this file:
+#
+# EMUL_DISTRO
+#      The OSF/1 distribution.
+#
+
+EMUL_DISTRO=           osf1-netscape-1.1
+
+# The OSF/1 emulation supports no modules, so always depend on osf1_lib.
+.if !defined(OSF1_PKG)
+DEPENDS+=              osf1_lib>=1.1:../../emulators/osf1_lib
+.endif
diff -r 1bcb277dda27 -r f080c3ac609f mk/emulator/osf1-netscape.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/emulator/osf1-netscape.mk      Wed Aug 01 17:19:22 2007 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: osf1-netscape.mk,v 1.1 2007/08/01 17:19:23 jlam Exp $
+#
+# OSF/1 libraries from Netscape for LinuxAlpha.
+#
+
+.include "${PKGSRCDIR}/emulators/osf1_lib/emulator.mk"
diff -r 1bcb277dda27 -r f080c3ac609f mk/emulator/osf1.mk
--- a/mk/emulator/osf1.mk       Wed Aug 01 16:57:15 2007 +0000
+++ b/mk/emulator/osf1.mk       Wed Aug 01 17:19:22 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: osf1.mk,v 1.1 2007/07/29 05:19:43 jlam Exp $
+# $NetBSD: osf1.mk,v 1.2 2007/08/01 17:19:23 jlam Exp $
 #
 # OSF/1 (Tru64) binary emulation framework
 #
@@ -6,7 +6,7 @@
 .if !empty(OPSYS:MOSF*)
 EMUL_TYPE.osf1?=       native
 .else
-EMUL_TYPE.osf1?=       builtin
+EMUL_TYPE.osf1?=       netscape
 .endif
 EMUL_MODULES.osf1?=    # empty
 
@@ -22,6 +22,7 @@
 #
 _EMUL_TYPES=           builtin
 _EMUL_TYPES+=          native
+_EMUL_TYPES+=          netscape
 _EMUL_TYPE?=           ${EMUL_TYPE.osf1}
 
 _EMUL_MODULES=         # empty



Home | Main Index | Thread Index | Old Index