summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2007-08-01 17:19:22 +0000
committerjlam <jlam@pkgsrc.org>2007-08-01 17:19:22 +0000
commitc30218a3ef506fa8d186b13178b4e6d56fe6bf1a (patch)
tree8945c859d24c065c22c33e322d048cf341796c4a
parentfcbae5fcca1ed93b9920566e9e9b499064709e9f (diff)
downloadpkgsrc-c30218a3ef506fa8d186b13178b4e6d56fe6bf1a.tar.gz
Support automatically using pkgsrc/emulators/osf1_lib to satisfy
EMUL_PLATFORM osf1-alpha.
-rw-r--r--emulators/osf1_lib/DEINSTALL14
-rw-r--r--emulators/osf1_lib/INSTALL127
-rw-r--r--emulators/osf1_lib/Makefile39
-rw-r--r--emulators/osf1_lib/emulator.mk16
-rw-r--r--mk/emulator/osf1-netscape.mk6
-rw-r--r--mk/emulator/osf1.mk5
6 files changed, 161 insertions, 46 deletions
diff --git a/emulators/osf1_lib/DEINSTALL b/emulators/osf1_lib/DEINSTALL
new file mode 100644
index 00000000000..2871a2687b7
--- /dev/null
+++ b/emulators/osf1_lib/DEINSTALL
@@ -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 --git a/emulators/osf1_lib/INSTALL b/emulators/osf1_lib/INSTALL
index 95d9437f6d1..cd759edf38b 100644
--- a/emulators/osf1_lib/INSTALL
+++ b/emulators/osf1_lib/INSTALL
@@ -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 $
-case "${STAGE}" in
-POST-INSTALL)
- emulsubdir=osf1
+# 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
- emuldir="/emul/$emulsubdir"
- pkgemuldir="${PKG_PREFIX}/emul/$emulsubdir"
+CURDIR=`${PWD_CMD}`
+PKG_METADATA_DIR="${2-${CURDIR}}"
+: ${PKGNAME=${PKG_METADATA_DIR##*/}}
+: ${PKG_PREFIX=@PREFIX@}
- emuldir_pwd=`cd $emuldir 2>/dev/null && ${PWD_CMD}`
- pkgemuldir_pwd=`cd $pkgemuldir 2>/dev/null && ${PWD_CMD}`
+EMULDIR="${PKG_PREFIX}/@EMULSUBDIR@"
+OPSYS_EMULDIR="@OPSYS_EMULDIR@"
- 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
+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
==============================================================================
-You must create a symbolic link for ${PKGNAME} to work properly:
+The following symbolic link must be created for ${PKGNAME}
+to work properly:
- $pkgemuldir -> $emuldir
+ ${EMULDIR} -> ${OPSYS_EMULDIR}
-It seems there is something else located at $emuldir.
==============================================================================
-EOF
+EOM
else
- ${MKDIR} -p `${DIRNAME} $emuldir` &&
- ${LN} -fs $pkgemuldir $emuldir
+ ${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)
+ ${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
+
+ # Run any actions that require root privileges.
+ ${TEST} ! -x ./+ROOT_ACTIONS ||
+ ./+ROOT_ACTIONS ADD ${PKG_METADATA_DIR}
+ ;;
esac
diff --git a/emulators/osf1_lib/Makefile b/emulators/osf1_lib/Makefile
index b2f78e5d074..c6b5e19ec8c 100644
--- a/emulators/osf1_lib/Makefile
+++ b/emulators/osf1_lib/Makefile
@@ -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 @@ MAINTAINER= eric@cirr.com
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}
-
-EXTRACT_ONLY= # empty
-NO_CONFIGURE= yes
-NO_BUILD= yes
-
-RPMARGS= -i usr/lib -i usr/bin ${DISTDIR}/${DISTFILES}
-
-CHECK_SHLIBS_SUPPORTED= no
+EMUL_PLATFORMS= osf1-alpha
+ONLY_FOR_PLATFORM= NetBSD-*-alpha
-.include "../../mk/x11.buildlink3.mk"
+OSF1_PKG= yes
+WRKSRC= ${WRKDIR}
+BUILD_DIRS= # empty
-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 .
+EMUL_PKG_FMT= rpm
+RPM2PKG_PREFIX= ${PREFIX}
+RPM2PKG_SUBPREFIX= ${EMULSUBDIR}
+RPM2PKG_STAGE= do-install
+RPMIGNOREPATH= usr/bin usr/lib
+.include "../../x11/libX11/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/osf1_lib/emulator.mk b/emulators/osf1_lib/emulator.mk
new file mode 100644
index 00000000000..706fc31d285
--- /dev/null
+++ b/emulators/osf1_lib/emulator.mk
@@ -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 --git a/mk/emulator/osf1-netscape.mk b/mk/emulator/osf1-netscape.mk
new file mode 100644
index 00000000000..d96f7b2b2c2
--- /dev/null
+++ b/mk/emulator/osf1-netscape.mk
@@ -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 --git a/mk/emulator/osf1.mk b/mk/emulator/osf1.mk
index 09d3bfb7354..6f20521d73f 100644
--- a/mk/emulator/osf1.mk
+++ b/mk/emulator/osf1.mk
@@ -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 @@ OPSYS_EMULDIR= ${_OPSYS_EMULDIR.osf1}
#
_EMUL_TYPES= builtin
_EMUL_TYPES+= native
+_EMUL_TYPES+= netscape
_EMUL_TYPE?= ${EMUL_TYPE.osf1}
_EMUL_MODULES= # empty