summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorhubertf <hubertf@pkgsrc.org>1997-09-28 00:44:15 +0000
committerhubertf <hubertf@pkgsrc.org>1997-09-28 00:44:15 +0000
commit848315b212f261d76dc3c5cf0d2fc7701e60b05c (patch)
tree7fe749d565c3207f1720029522499db7a078cbb9 /mk
parent78968c27c9814eb5b4824574b472de28329b9f55 (diff)
downloadpkgsrc-848315b212f261d76dc3c5cf0d2fc7701e60b05c.tar.gz
- Add OpenBSD and FreeBSD Ids in the header
- Changes from FreeBSD's V1.164: * Warn if mtree-file not found * On 'make reinstall' gets DEPENDS_TARGET set to 'reinstall' instead of 'install' - Changes from OpenBSD's V1.14: * Documentation and implementation for ONLY_FOR_ARCHS * Documentation and implementation for WRKOBJDIR * Documentation on HAVE_MOTIF and MOTIF_STATIC: set in /etc/mk.conf, not /etc/make.conf * Set NOMANCOMPRESS=no to still compress man-pages (should probably be set to 'yes') * DEF_UMASK=022 * add ${MACHINE} suffix to WRKDIR if OBJMACHINE is set * .include <bsd.own.mk>
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk93
-rw-r--r--mk/bsd.port.mk93
2 files changed, 174 insertions, 12 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 00bbd09c1e7..a14f699a4bd 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -2,11 +2,14 @@
# ex:ts=4
#
# Id: bsd.port.mk,v 1.263 1997/07/17 17:47:36 markm Exp
-# $NetBSD: bsd.pkg.mk,v 1.4 1997/09/25 19:09:32 thorpej Exp $
+# $NetBSD: bsd.pkg.mk,v 1.5 1997/09/28 00:44:15 hubertf Exp $
#
# bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain.
#
+# FreeBSD Id: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp
+# OpenBSD Id: bsd.port.mk,v 1.14 1997/09/21 10:58:41 niklas Exp
+#
# Please view me with 4 column tabs!
# There are two different types of "maintainers" in the whole ports
@@ -30,6 +33,9 @@ NetBSD_MAINTAINER= agc@netbsd.org
#
# Variables that typically apply to all ports:
#
+# ONLY_FOR_ARCHS - If a port only makes sense to certain architectures, this
+# is a list containing the names for them. It is checked
+# against the predefined ${MACHINE} value
# ARCH - The architecture, as returned by "uname -m".
# OPSYS - Portability clause. This is the operating system the
# makefile is being used on. Automatically set to
@@ -60,6 +66,12 @@ NetBSD_MAINTAINER= agc@netbsd.org
# MAINTAINER - The e-mail address of the contact person for this port
# (default: ports@FreeBSD.ORG).
# CATEGORIES - A list of descriptive categories into which this port falls.
+# WRKOBJDIR - A top level directory where, if defined, the separate working
+# directories will get created, and symbolically linked to from
+# ${WRKDIR} (see below). This is useful for building ports on
+# several architectures, then ${PORTSDIR} can be NFS-mounted
+# while ${WRKOBJDIR} is local to every arch.
+
#
# Variables that typically apply to an individual port. Non-Boolean
# variables without defaults are *mandatory*.
@@ -191,9 +203,12 @@ NetBSD_MAINTAINER= agc@netbsd.org
# REQUIRES_MOTIF - Set this in your port if it requires Motif. It will be
# built only if HAVE_MOTIF is set.
# HAVE_MOTIF - If set, means system has Motif. Typically set in
-# /etc/make.conf.
+# /etc/make.conf (FreeBSD) or
+# /etc/mk.conf (NetBSD, OpenBSD).
# MOTIF_STATIC - If set, link libXm statically; otherwise, link it
-# dynamically. Typically set in /etc/make.conf.
+# dynamically. Typically set in
+# /etc/make.conf (FreeBSD) or
+# /etc/mk.conf (NetBSD, OpenBSD).
# MOTIFLIB - Set automatically to appropriate value depending on
# ${MOTIF_STATIC}. Substitute references to -lXm with
# patches to make your port conform to our standards.
@@ -259,6 +274,24 @@ NetBSD_MAINTAINER= agc@netbsd.org
# NEVER override the "regular" targets unless you want to open
# a major can of worms.
+.if defined(ONLY_FOR_ARCHS)
+.for __ARCH in ${ONLY_FOR_ARCHS}
+.if ${MACHINE} == "${__ARCH}"
+__ARCH_OK= 1
+.endif
+.endfor
+.else
+__ARCH_OK= 1
+.endif
+
+.if !defined(__ARCH_OK)
+.MAIN: all
+
+fetch fetch-list extract patch configure build install reinstall package describe checkpatch checksum makesum all:
+ @echo "This port is only for ${ONLY_FOR_ARCHS},"
+ @echo "and you are running ${MACHINE}."
+.else
+
# Get the architecture
ARCH!= uname -m
@@ -269,6 +302,16 @@ OPSYS!= uname -s
.include "${.CURDIR}/../Makefile.inc"
.endif
+.if (${OPSYS} == "OpenBSD")
+NOMANCOMPRESS?= yes
+DEF_UMASK?= 022
+.elif (${OPSYS} == "NetBSD")
+NOMANCOMPRESS?= no # XXX should be yes(?) - hubertf
+DEF_UMASK?= 0022
+.else
+DEF_UMASK?= 0022
+.endif
+
.if exists(${.CURDIR}/Makefile.${ARCH}-${OPSYS})
.include "${.CURDIR}/Makefile.${ARCH}-${OPSYS}"
.elif exists(${.CURDIR}/Makefile.${OPSYS})
@@ -293,7 +336,11 @@ _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
PACKAGES?= ${PORTSDIR}/packages
TEMPLATES?= ${PORTSDIR}/templates
.if !defined(NO_WRKDIR)
+.if defined(OBJMACHINE)
+WRKDIR?= ${.CURDIR}/work.${MACHINE}
+.else
WRKDIR?= ${.CURDIR}/work
+.endif
.else
WRKDIR?= ${.CURDIR}
.endif
@@ -303,6 +350,13 @@ WRKSRC?= ${WRKDIR}
WRKSRC?= ${WRKDIR}/${DISTNAME}
.endif
+.if defined(WRKOBJDIR)
+# XXX Is pwd -P available in FreeBSD's /bin/sh?
+__canonical_PORTSDIR!= cd ${PORTSDIR}; pwd -P
+__canonical_CURDIR!= cd ${.CURDIR}; pwd -P
+PORTSUBDIR= ${__canonical_CURDIR:S,${__canonical_PORTSDIR}/,,}
+.endif
+
.if exists(${.CURDIR}/patches.${ARCH}-${OPSYS})
PATCHDIR?= ${.CURDIR}/patches.${ARCH}-${OPSYS}
.elif exists(${.CURDIR}/patches.${OPSYS})
@@ -455,6 +509,12 @@ MTREE_FILE= /etc/mtree/BSD.local.dist
MTREE_CMD?= /usr/sbin/mtree
MTREE_ARGS?= -U -f ${MTREE_FILE} -d -e -p
+.if (${OPSYS} == "OpenBSD")
+.include <bsd.own.mk>
+# XXX Do we need this? - hubertf
+#MAKE_ENV+= EXTRA_SYS_MK_INCLUDES="<bsd.own.mk>"
+.endif
+
# A few aliases for *-install targets
INSTALL_PROGRAM= \
${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
@@ -526,6 +586,7 @@ GZCAT?= /usr/bin/gzcat
GZIP?= -9
GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
LDCONFIG?= /sbin/ldconfig
+LN?= /bin/ln
MKDIR?= /bin/mkdir -p
MV?= /bin/mv
RM?= /bin/rm
@@ -797,8 +858,12 @@ all: build
.endif
.if !defined(DEPENDS_TARGET)
+.if make(reinstall)
+DEPENDS_TARGET= reinstall
+.else
DEPENDS_TARGET= install
.endif
+.endif
################################################################
# The following are used to create easy dummy targets for
@@ -929,9 +994,17 @@ do-fetch:
.if !target(do-extract)
do-extract:
.if !defined(NO_WRKDIR)
+.if defined(WRKOBJDIR)
+ @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}
+ @${MKDIR} -p ${WRKOBJDIR}/${PORTSUBDIR}
+ @echo "${WRKDIR} -> ${WRKOBJDIR}/${PORTSUBDIR}"
+ @# XXX whatif a build is going on right now? Is this wise?
+ @${LN} -sf ${WRKOBJDIR}/${PORTSUBDIR} ${WRKDIR}
+.else
@${RM} -rf ${WRKDIR}
@${MKDIR} ${WRKDIR}
.endif
+.endif
@for file in ${EXTRACT_ONLY}; do \
if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
then \
@@ -1109,7 +1182,7 @@ _PORT_USE: .USE
exit 1; \
fi
.endif
- @if [ `${SH} -c umask` != 0022 ]; then \
+ @if [ `${SH} -c umask` != ${DEF_UMASK} ]; then \
${ECHO_MSG} "===> Warning: your umask is \"`${SH} -c umask`"\".; \
${ECHO_MSG} " If this is not desired, set it to an appropriate value"; \
${ECHO_MSG} " and install this port again by \`\`make reinstall''."; \
@@ -1119,7 +1192,13 @@ _PORT_USE: .USE
.if make(real-install)
.if !defined(NO_MTREE)
@if [ `id -u` = 0 ]; then \
- ${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/; \
+ if [ ! -f ${MTREE_FILE} ]; then \
+ ${ECHO_MSG} "Error: mtree file \"${MTREE_FILE}\" is missing."; \
+ ${ECHO_MSG} "Copy it from a suitable location (e.g., /usr/src/etc/mtree) and try again."; \
+ exit 1; \
+ else \
+ ${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/; \
+ fi; \
else \
${ECHO_MSG} "Warning: not superuser, can't run mtree."; \
${ECHO_MSG} "Become root and try again to ensure correct permissions."; \
@@ -1258,7 +1337,7 @@ checkpatch:
.if !target(reinstall)
reinstall:
@${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
- @${MAKE} install
+ @DEPENDS_TARGET=${DEPENDS_TARGET} ${MAKE} install
.endif
################################################################
@@ -1716,3 +1795,5 @@ depend:
.if !target(tags)
tags:
.endif
+
+.endif
diff --git a/mk/bsd.port.mk b/mk/bsd.port.mk
index 4b4553ceedc..f09e030f559 100644
--- a/mk/bsd.port.mk
+++ b/mk/bsd.port.mk
@@ -2,11 +2,14 @@
# ex:ts=4
#
# Id: bsd.port.mk,v 1.263 1997/07/17 17:47:36 markm Exp
-# $NetBSD: bsd.port.mk,v 1.4 1997/09/25 19:09:32 thorpej Exp $
+# $NetBSD: bsd.port.mk,v 1.5 1997/09/28 00:44:15 hubertf Exp $
#
# bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain.
#
+# FreeBSD Id: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp
+# OpenBSD Id: bsd.port.mk,v 1.14 1997/09/21 10:58:41 niklas Exp
+#
# Please view me with 4 column tabs!
# There are two different types of "maintainers" in the whole ports
@@ -30,6 +33,9 @@ NetBSD_MAINTAINER= agc@netbsd.org
#
# Variables that typically apply to all ports:
#
+# ONLY_FOR_ARCHS - If a port only makes sense to certain architectures, this
+# is a list containing the names for them. It is checked
+# against the predefined ${MACHINE} value
# ARCH - The architecture, as returned by "uname -m".
# OPSYS - Portability clause. This is the operating system the
# makefile is being used on. Automatically set to
@@ -60,6 +66,12 @@ NetBSD_MAINTAINER= agc@netbsd.org
# MAINTAINER - The e-mail address of the contact person for this port
# (default: ports@FreeBSD.ORG).
# CATEGORIES - A list of descriptive categories into which this port falls.
+# WRKOBJDIR - A top level directory where, if defined, the separate working
+# directories will get created, and symbolically linked to from
+# ${WRKDIR} (see below). This is useful for building ports on
+# several architectures, then ${PORTSDIR} can be NFS-mounted
+# while ${WRKOBJDIR} is local to every arch.
+
#
# Variables that typically apply to an individual port. Non-Boolean
# variables without defaults are *mandatory*.
@@ -191,9 +203,12 @@ NetBSD_MAINTAINER= agc@netbsd.org
# REQUIRES_MOTIF - Set this in your port if it requires Motif. It will be
# built only if HAVE_MOTIF is set.
# HAVE_MOTIF - If set, means system has Motif. Typically set in
-# /etc/make.conf.
+# /etc/make.conf (FreeBSD) or
+# /etc/mk.conf (NetBSD, OpenBSD).
# MOTIF_STATIC - If set, link libXm statically; otherwise, link it
-# dynamically. Typically set in /etc/make.conf.
+# dynamically. Typically set in
+# /etc/make.conf (FreeBSD) or
+# /etc/mk.conf (NetBSD, OpenBSD).
# MOTIFLIB - Set automatically to appropriate value depending on
# ${MOTIF_STATIC}. Substitute references to -lXm with
# patches to make your port conform to our standards.
@@ -259,6 +274,24 @@ NetBSD_MAINTAINER= agc@netbsd.org
# NEVER override the "regular" targets unless you want to open
# a major can of worms.
+.if defined(ONLY_FOR_ARCHS)
+.for __ARCH in ${ONLY_FOR_ARCHS}
+.if ${MACHINE} == "${__ARCH}"
+__ARCH_OK= 1
+.endif
+.endfor
+.else
+__ARCH_OK= 1
+.endif
+
+.if !defined(__ARCH_OK)
+.MAIN: all
+
+fetch fetch-list extract patch configure build install reinstall package describe checkpatch checksum makesum all:
+ @echo "This port is only for ${ONLY_FOR_ARCHS},"
+ @echo "and you are running ${MACHINE}."
+.else
+
# Get the architecture
ARCH!= uname -m
@@ -269,6 +302,16 @@ OPSYS!= uname -s
.include "${.CURDIR}/../Makefile.inc"
.endif
+.if (${OPSYS} == "OpenBSD")
+NOMANCOMPRESS?= yes
+DEF_UMASK?= 022
+.elif (${OPSYS} == "NetBSD")
+NOMANCOMPRESS?= no # XXX should be yes(?) - hubertf
+DEF_UMASK?= 0022
+.else
+DEF_UMASK?= 0022
+.endif
+
.if exists(${.CURDIR}/Makefile.${ARCH}-${OPSYS})
.include "${.CURDIR}/Makefile.${ARCH}-${OPSYS}"
.elif exists(${.CURDIR}/Makefile.${OPSYS})
@@ -293,7 +336,11 @@ _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
PACKAGES?= ${PORTSDIR}/packages
TEMPLATES?= ${PORTSDIR}/templates
.if !defined(NO_WRKDIR)
+.if defined(OBJMACHINE)
+WRKDIR?= ${.CURDIR}/work.${MACHINE}
+.else
WRKDIR?= ${.CURDIR}/work
+.endif
.else
WRKDIR?= ${.CURDIR}
.endif
@@ -303,6 +350,13 @@ WRKSRC?= ${WRKDIR}
WRKSRC?= ${WRKDIR}/${DISTNAME}
.endif
+.if defined(WRKOBJDIR)
+# XXX Is pwd -P available in FreeBSD's /bin/sh?
+__canonical_PORTSDIR!= cd ${PORTSDIR}; pwd -P
+__canonical_CURDIR!= cd ${.CURDIR}; pwd -P
+PORTSUBDIR= ${__canonical_CURDIR:S,${__canonical_PORTSDIR}/,,}
+.endif
+
.if exists(${.CURDIR}/patches.${ARCH}-${OPSYS})
PATCHDIR?= ${.CURDIR}/patches.${ARCH}-${OPSYS}
.elif exists(${.CURDIR}/patches.${OPSYS})
@@ -455,6 +509,12 @@ MTREE_FILE= /etc/mtree/BSD.local.dist
MTREE_CMD?= /usr/sbin/mtree
MTREE_ARGS?= -U -f ${MTREE_FILE} -d -e -p
+.if (${OPSYS} == "OpenBSD")
+.include <bsd.own.mk>
+# XXX Do we need this? - hubertf
+#MAKE_ENV+= EXTRA_SYS_MK_INCLUDES="<bsd.own.mk>"
+.endif
+
# A few aliases for *-install targets
INSTALL_PROGRAM= \
${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
@@ -526,6 +586,7 @@ GZCAT?= /usr/bin/gzcat
GZIP?= -9
GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
LDCONFIG?= /sbin/ldconfig
+LN?= /bin/ln
MKDIR?= /bin/mkdir -p
MV?= /bin/mv
RM?= /bin/rm
@@ -797,8 +858,12 @@ all: build
.endif
.if !defined(DEPENDS_TARGET)
+.if make(reinstall)
+DEPENDS_TARGET= reinstall
+.else
DEPENDS_TARGET= install
.endif
+.endif
################################################################
# The following are used to create easy dummy targets for
@@ -929,9 +994,17 @@ do-fetch:
.if !target(do-extract)
do-extract:
.if !defined(NO_WRKDIR)
+.if defined(WRKOBJDIR)
+ @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}
+ @${MKDIR} -p ${WRKOBJDIR}/${PORTSUBDIR}
+ @echo "${WRKDIR} -> ${WRKOBJDIR}/${PORTSUBDIR}"
+ @# XXX whatif a build is going on right now? Is this wise?
+ @${LN} -sf ${WRKOBJDIR}/${PORTSUBDIR} ${WRKDIR}
+.else
@${RM} -rf ${WRKDIR}
@${MKDIR} ${WRKDIR}
.endif
+.endif
@for file in ${EXTRACT_ONLY}; do \
if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
then \
@@ -1109,7 +1182,7 @@ _PORT_USE: .USE
exit 1; \
fi
.endif
- @if [ `${SH} -c umask` != 0022 ]; then \
+ @if [ `${SH} -c umask` != ${DEF_UMASK} ]; then \
${ECHO_MSG} "===> Warning: your umask is \"`${SH} -c umask`"\".; \
${ECHO_MSG} " If this is not desired, set it to an appropriate value"; \
${ECHO_MSG} " and install this port again by \`\`make reinstall''."; \
@@ -1119,7 +1192,13 @@ _PORT_USE: .USE
.if make(real-install)
.if !defined(NO_MTREE)
@if [ `id -u` = 0 ]; then \
- ${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/; \
+ if [ ! -f ${MTREE_FILE} ]; then \
+ ${ECHO_MSG} "Error: mtree file \"${MTREE_FILE}\" is missing."; \
+ ${ECHO_MSG} "Copy it from a suitable location (e.g., /usr/src/etc/mtree) and try again."; \
+ exit 1; \
+ else \
+ ${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/; \
+ fi; \
else \
${ECHO_MSG} "Warning: not superuser, can't run mtree."; \
${ECHO_MSG} "Become root and try again to ensure correct permissions."; \
@@ -1258,7 +1337,7 @@ checkpatch:
.if !target(reinstall)
reinstall:
@${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
- @${MAKE} install
+ @DEPENDS_TARGET=${DEPENDS_TARGET} ${MAKE} install
.endif
################################################################
@@ -1716,3 +1795,5 @@ depend:
.if !target(tags)
tags:
.endif
+
+.endif