summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2007-08-01 16:28:08 +0000
committerjlam <jlam@pkgsrc.org>2007-08-01 16:28:08 +0000
commit8101baad23bae9da2e4b8eeaff22842eaa651415 (patch)
treec94dc724eaf481131c6d47457aedd727fea132e9 /emulators
parentede3ad6e6bc7a058a0e90840a3e0efc916a49c3d (diff)
downloadpkgsrc-8101baad23bae9da2e4b8eeaff22842eaa651415.tar.gz
Support automatically using pkgsrc/emulators/darwin_lib to satisfy
EMUL_PLATFORMs darwin-i386 and darwin-powerpc.
Diffstat (limited to 'emulators')
-rw-r--r--emulators/darwin_lib/DEINSTALL11
-rw-r--r--emulators/darwin_lib/INSTALL117
-rw-r--r--emulators/darwin_lib/Makefile45
-rw-r--r--emulators/darwin_lib/emulator.mk16
4 files changed, 148 insertions, 41 deletions
diff --git a/emulators/darwin_lib/DEINSTALL b/emulators/darwin_lib/DEINSTALL
new file mode 100644
index 00000000000..c076ad5a6de
--- /dev/null
+++ b/emulators/darwin_lib/DEINSTALL
@@ -0,0 +1,11 @@
+# $NetBSD: DEINSTALL,v 1.1 2007/08/01 16:28:08 jlam Exp $
+
+EMULDIR="${PKG_PREFIX}/@EMULSUBDIR@"
+
+case "${STAGE}" in
+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/darwin_lib/INSTALL b/emulators/darwin_lib/INSTALL
index ef08760521b..fddbc1501a5 100644
--- a/emulators/darwin_lib/INSTALL
+++ b/emulators/darwin_lib/INSTALL
@@ -1,30 +1,113 @@
-# $NetBSD: INSTALL,v 1.1 2006/06/23 15:52:34 jlam Exp $
+# $NetBSD: INSTALL,v 1.2 2007/08/01 16:28:08 jlam Exp $
-case "${STAGE}" in
-POST-INSTALL)
- emulsubdir=darwin
+# 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`
- emuldir="/emul/$emulsubdir"
- pkgemuldir="${PKG_PREFIX}/emul/$emulsubdir"
+exitcode=0
+case $ACTION,$EUID in
+ADD,0)
+ ${ECHO} "" > ${ROOT_ACTIONS_COOKIE}
+ ${CHMOD} g+w ${ROOT_ACTIONS_COOKIE}
- emuldir_pwd=`cd $emuldir 2>/dev/null && ${PWD_CMD}`
- pkgemuldir_pwd=`cd $pkgemuldir 2>/dev/null && ${PWD_CMD}`
+ # 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} "$emuldir_pwd" != "$pkgemuldir_pwd"; then
- if ${TEST} -e $emuldir -o -L $emuldir; then
- ${CAT} << EOF
+ 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)
+ # Run any actions that require root privileges.
+ ${TEST} ! -x ./+ROOT_ACTIONS ||
+ ./+ROOT_ACTIONS ADD ${PKG_METADATA_DIR}
+ ;;
esac
diff --git a/emulators/darwin_lib/Makefile b/emulators/darwin_lib/Makefile
index b8db3b00bf0..05bbe7c4c9a 100644
--- a/emulators/darwin_lib/Makefile
+++ b/emulators/darwin_lib/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2006/07/02 10:05:55 rillig Exp $
+# $NetBSD: Makefile,v 1.8 2007/08/01 16:28:08 jlam Exp $
DISTNAME= darwin_lib-6.6.2
PKGREVISION= 2
@@ -13,33 +13,30 @@ DISTFILES= org.opendarwin.Libsystem-6.6.2-4.fat.rpm \
org.opendarwin.XFree86-6.6.2-4.${DARWIN_ARCH}.rpm
MAINTAINER= abacau@yahoo.com.au
-HOMEPAGE= http://www.opendarwin.org/
COMMENT= Darwin compatibility libraries (including X11)
-BUILD_DEPENDS+= rpm2pkg>=1.3:../../pkgtools/rpm2pkg
+# The opendarwin.org domain is completely gone. MASTER_SITES should
+# probably point to ${MASTER_SITE_LOCAL} instead. I also think the ppc
+# XFree86 RPM is no longer available anywhere.
+#
+#HOMEPAGE= http://www.opendarwin.org/
-ONLY_FOR_PLATFORM= NetBSD-1.6Z*-powerpc NetBSD-1.6Z*-i386 \
+EMUL_PLATFORMS= darwin-i386 darwin-powerpc
+ONLY_FOR_PLATFORM= NetBSD-1.6Z*-powerpc NetBSD-1.6Z*-i386 \
NetBSD-[2-9]*-powerpc NetBSD-[2-9]*-i386
-PLIST_SRC= ${WRKDIR}/.PLIST_SRC
-
-DARWIN_ARCH= ${MACHINE_ARCH:C/powerpc/ppc/}
-
-RPM2PKG= rpm2pkg
-RPMARGS= -d ${PREFIX} -f ${WRKDIR}/PLIST_RPM2PKG -p emul/darwin \
- -i ./Developer -i ./usr/X11R6/lib/X11/doc/html \
- -i ./usr/share/man -i ./usr/include -i ./usr/X11R6/man \
- -i ./usr/X11R6/include -i ./usr/local/include \
- -i ./usr/local/man \
- ${DISTFILES:S/^/${DISTDIR}\//}
-
-EXTRACT_ONLY= # empty
-NO_BUILD= yes
-
-do-install:
- ${RM} -f ${WRKDIR}/PLIST_RPM2PKG
- ${RPM2PKG} ${RPMARGS}
- ${SED} -e 's|^\./||' -e 's|/\./|/|g' -e 's|//*|/|g' \
- ${WRKDIR}/PLIST_RPM2PKG > ${PLIST_SRC}
+DARWIN_PKG= yes
+DARWIN_ARCH= ${MACHINE_ARCH:C/powerpc/ppc/}
+WRKSRC= ${WRKDIR}
+BUILD_DIRS= # empty
+
+EMUL_PKG_FMT= rpm
+RPM2PKG_PREFIX= ${PREFIX}
+RPM2PKG_SUBPREFIX= ${EMULSUBDIR}
+RPM2PKG_STAGE= do-install
+RPMIGNOREPATH= ./Developer ./usr/X11R6/lib/X11/doc/html \
+ ./usr/share/man ./usr/include ./usr/X11R6/man \
+ ./usr/X11R6/include ./usr/local/include \
+ ./usr/local/man
.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/darwin_lib/emulator.mk b/emulators/darwin_lib/emulator.mk
new file mode 100644
index 00000000000..aa81e85e6c8
--- /dev/null
+++ b/emulators/darwin_lib/emulator.mk
@@ -0,0 +1,16 @@
+# $NetBSD: emulator.mk,v 1.1 2007/08/01 16:28:08 jlam Exp $
+#
+# This file is included by darwin-opendarwin.mk in the emulator framework.
+#
+# Variables set by this file:
+#
+# EMUL_DISTRO
+# The OpenDarwin distribution.
+#
+
+EMUL_DISTRO= opendarwin-6.6.2
+
+# The Darwin emulation supports no modules, so always depend on darwin_lib.
+.if !defined(DARWIN_PKG)
+DEPENDS+= darwin_lib>=6.6.2:../../emulators/darwin_lib
+.endif