aboutsummaryrefslogtreecommitdiff
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk96
1 files changed, 66 insertions, 30 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 9e63dc20c3d3..980e536956f7 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -6,27 +6,31 @@
# bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain.
#
-# $Id: bsd.port.mk,v 1.227.2.11 1996/12/23 02:52:29 asami Exp $
+# $Id: bsd.port.mk,v 1.227.2.12 1997/01/11 11:33:24 asami Exp $
#
# Please view me with 4 column tabs!
# This is for this file, not for the ports that includes it, so it's
-# commented out -- the person to contact if you have questions/
+# not called MAINTAINER -- the person to contact if you have questions/
# suggestions about bsd.port.mk.
#
-# MAINTAINER= asami@FreeBSD.ORG
+# If you are not him, you are not allowed to commit to this file without
+# his permission. :)
#
+FreeBSD_MAINTAINER= asami@FreeBSD.ORG
+OpenBSD_MAINTAINER= imp@OpenBSD.ORG
+
# Supported Variables and their behaviors:
#
# Variables that typically apply to all ports:
#
# OPSYS - Portability clause. This is the operating system the
# makefile is being used on. Automatically set to
-# "FreeBSD" or "NetBSD" as appropriate.
+# "FreeBSD," "NetBSD," or "OpenBSD" as appropriate.
# PORTSDIR - The root of the ports tree. Defaults:
-# FreeBSD: /usr/ports
-# NetBSD: /usr/opt
+# FreeBSD/OpenBSD: /usr/ports
+# NetBSD: /usr/opt
# DISTDIR - Where to get gzip'd, tarballed copies of original sources
# (default: ${PORTSDIR}/distfiles).
# PREFIX - Where to install things in general (default: /usr/local).
@@ -118,8 +122,12 @@
# GNU_CONFIGURE - Set if you are using GNU configure (optional).
# CONFIGURE_SCRIPT - Name of configure script, defaults to 'configure'.
# CONFIGURE_ARGS - Pass these args to configure if ${HAS_CONFIGURE} is set.
-# CONFIGURE_ENV - Pass these env (shell-like) to configure if
+# CONFIGURE_ENV - Pass these env (shell-like) to configure if
# ${HAS_CONFIGURE} is set.
+# SCRIPTS_ENV - Additional environment vars passed to scripts in
+# ${SCRIPTDIR} executed by bsd.port.mk.
+# MAKE_ENV - Additional environment vars passed to sub-make in build
+# stage.
# IS_INTERACTIVE - Set this if your port needs to interact with the user
# during a build. User can then decide to skip this port by
# setting ${BATCH}, or compiling only the interactive ports
@@ -180,6 +188,8 @@
# MOTIFLIB - Set automatically to appropriate value depending on
# ${MOTIF_STATIC}. Substitute references to -lXm with
# patches to make your port conform to our standards.
+# MOTIF_ONLY - If set, build Motif ports only. (Not much use except for
+# building packages.)
#
# Variables to change if you want a special behavior:
#
@@ -314,10 +324,14 @@ DO_NADA?= /usr/bin/true
# Miscellaneous overridable commands:
GMAKE?= gmake
XMKMF?= xmkmf -a
-.if (${OPSYS} == "NetBSD")
+.if exists(/sbin/md5)
+MD5?= /sbin/md5
+.elif exists(/bin/md5)
+MD5?= /bin/md5
+.elif exists(/usr/bin/md5)
MD5?= /usr/bin/md5
.else
-MD5?= /sbin/md5
+MD5?= md5
.endif
MD5_FILE?= ${FILESDIR}/md5
@@ -325,7 +339,11 @@ MAKE_FLAGS?= -f
MAKEFILE?= Makefile
MAKE_ENV+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" CFLAGS="${CFLAGS}"
+.if exists(/usr/bin/fetch)
FETCH_CMD?= /usr/bin/fetch
+.else
+FETCH_CMD?= /usr/bin/ftp
+.endif
TOUCH?= /usr/bin/touch
TOUCH_FLAGS?= -f
@@ -352,7 +370,11 @@ PATCH_ARGS+= -C
PATCH_DIST_ARGS+= -C
.endif
+.if exists(/bin/tar)
+EXTRACT_CMD?= /bin/tar
+.else
EXTRACT_CMD?= /usr/bin/tar
+.endif
EXTRACT_SUFX?= .tar.gz
# Backwards compatability.
.if defined(EXTRACT_ARGS)
@@ -381,6 +403,13 @@ INSTALL_DATA= \
INSTALL_MAN= \
${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
+ BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
+ BSD_INSTALL_DATA="${INSTALL_DATA}" \
+ BSD_INSTALL_MAN="${INSTALL_MAN}"
+MAKE_ENV+= ${INSTALL_MACROS}
+SCRIPTS_ENV+= ${INSTALL_MACROS}
+
# The user can override the NO_PACKAGE by specifying this from
# the make command line
.if defined(FORCE_PACKAGE)
@@ -435,6 +464,7 @@ GZIP?= -9
GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
GUNZIP_CMD?= /usr/bin/gunzip -f
SED?= /usr/bin/sed
+TR?= /usr/bin/tr
# Used to print all the '===>' style prompts - override this to turn them off.
ECHO_MSG?= ${ECHO}
@@ -560,6 +590,17 @@ CONFIGURE_ARGS+= --prefix=${PREFIX}
HAS_CONFIGURE= yes
.endif
+# Passed to most of script invocations
+SCRIPTS_ENV+= CURDIR=${.CURDIR} DISTDIR=${DISTDIR} \
+ WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
+ SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
+ PORTSDIR=${PORTSDIR} DEPENDS="${DEPENDS}" \
+ PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE}
+
+.if defined(BATCH)
+SCRIPTS_ENV+= BATCH=yes
+.endif
+
MANPREFIX?= ${PREFIX}
.for sect in 1 2 3 4 5 6 7 8 9
@@ -621,6 +662,8 @@ IGNORE= "is an interactive port"
IGNORE= "is not an interactive port"
.elif (defined(REQUIRES_MOTIF) && !defined(HAVE_MOTIF))
IGNORE= "requires Motif"
+.elif (defined(MOTIF_ONLY) && !defined(REQUIRES_MOTIF))
+IGNORE= "does not require Motif"
.elif (defined(NO_CDROM) && defined(FOR_CDROM))
IGNORE= "may not be placed on a CDROM: ${NO_CDROM}"
.elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
@@ -849,7 +892,7 @@ do-patch:
${ECHO_MSG} "===> Applying ${OPSYS} patches for ${PKGNAME}" ; \
for i in ${PATCHDIR}/patch-*; do \
case $$i in \
- *.orig|*~) \
+ *.orig|*.rej|*~) \
${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
;; \
*) \
@@ -869,11 +912,8 @@ do-patch:
.if !target(do-configure)
do-configure:
@if [ -f ${SCRIPTDIR}/configure ]; then \
- cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTDIR=${DISTDIR}\
- WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
- SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
- PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} DEPENDS="${DEPENDS}" \
- X11BASE=${X11BASE} /bin/sh ${SCRIPTDIR}/configure; \
+ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} /bin/sh \
+ ${SCRIPTDIR}/configure; \
fi
.if defined(HAS_CONFIGURE)
@(cd ${WRKSRC} && CC="${CC}" ac_cv_path_CC="${CC}" CFLAGS="${CFLAGS}" \
@@ -998,21 +1038,14 @@ _PORT_USE: .USE
.endif
@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/pre-/}
@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/} ]; then \
- cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} \
- WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
- FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
- DEPENDS="${DEPENDS}" X11BASE=${X11BASE} \
- /bin/sh ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/}; \
+ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} /bin/sh \
+ ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/}; \
fi
@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/do-/}
@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/post-/}
@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/post-/} ]; then \
- cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTDIR=${DISTDIR}\
- WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
- SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
- PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} DEPENDS="${DEPENDS}" \
- X11BASE=${X11BASE} \
- /bin/sh ${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \
+ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} /bin/sh \
+ ${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \
fi
.if make(real-install) && defined(_MANPAGES)
.if defined(MANCOMPRESSED) && defined(NOMANCOMPRESS)
@@ -1441,14 +1474,17 @@ misc-depends:
clean-depends:
.if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) \
|| defined(RUN_DEPENDS)
- @for i in ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}; do \
- dir=`${ECHO} $$i | ${SED} -e 's/.*://'`; \
- if [ -d $$dir ] ; then (cd $$dir; ${MAKE} clean); fi \
+ @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/.*://' | sort | uniq`; do \
+ if [ -d $$dir ] ; then \
+ (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean clean-depends); \
+ fi \
done
.endif
.if defined(DEPENDS)
@for dir in ${DEPENDS}; do \
- if [ -d $$dir ] ; then (cd $$dir; ${MAKE} clean); fi \
+ if [ -d $$dir ] ; then \
+ (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean clean-depends); \
+ fi \
done
.endif
.endif