(1) Add NetBSD support. Closes PR bin/1643.

Submitted by:	Jason Thorpe <thorpej@nas.nasa.gov>

(2) Remove the bogus "CAT+=" definition.  Closes PR ports/1703.
Submitted by:	Peter Childs <pjchilds@imforei.apana.org.au>

(3) Change MKDIR to "/bin/mkdir -p", remove "-p" from ${MKDIR}
    invocations.  Closes PR ports/1901.
Submitted by:	obrien

(4) Add a new macro variable COMPRESS_MAN, which will evaluate to gzip
    if NOMANCOMPRESS isn't set (default), or true if it is.

(5) Add a new variable NO_CHECKSUM, which will disable the md5 checksum.
Submitted by:	jkh

(6) Also, move NO_PATCH and NO_PACKAGE checks to right place in
    invocation order.

(7) Check for LIB_DEPENDS before installation too.  (It used to check
    only before extraction.)
Forgotten a long time ago by:	asami
This commit is contained in:
Satoshi Asami 1996-11-01 07:22:37 +00:00
parent 0cc09e5460
commit 7bf5b94f9e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19307
2 changed files with 76 additions and 36 deletions

View file

@ -1,9 +1,11 @@
#-*- mode: Fundamental; tab-width: 4; -*- #-*- mode: Fundamental; tab-width: 4; -*-
# #
# $NetBSD: $
#
# bsd.port.mk - 940820 Jordan K. Hubbard. # bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain. # This file is in the public domain.
# #
# $Id: bsd.port.mk,v 1.225 1996/09/23 09:27:59 asami Exp $ # $Id: bsd.port.mk,v 1.226 1996/09/24 06:48:22 asami Exp $
# #
# Please view me with 4 column tabs! # Please view me with 4 column tabs!
@ -18,7 +20,12 @@
# #
# Variables that typically apply to all ports: # Variables that typically apply to all ports:
# #
# PORTSDIR - The root of the ports tree (default: /usr/ports). # OPSYS - Portability clause. This is the operating system the
# makefile is being used on. Automatically set to
# "FreeBSD" or "NetBSD" as appropriate.
# PORTSDIR - The root of the ports tree. Defaults:
# FreeBSD: /usr/ports
# NetBSD: /usr/opt
# DISTDIR - Where to get gzip'd, tarballed copies of original sources # DISTDIR - Where to get gzip'd, tarballed copies of original sources
# (default: ${PORTSDIR}/distfiles/${DIST_SUBDIR}). # (default: ${PORTSDIR}/distfiles/${DIST_SUBDIR}).
# PREFIX - Where to install things in general (default: /usr/local). # PREFIX - Where to install things in general (default: /usr/local).
@ -190,6 +197,11 @@
# INSTALL_DATA - A command to install sharable data. # INSTALL_DATA - A command to install sharable data.
# INSTALL_MAN - A command to install manpages (doesn't compress). # INSTALL_MAN - A command to install manpages (doesn't compress).
# #
# And another for compressing manpages -- it is conditionalized on the
# variable NOMANCOMPRESS so you can just list the manpage filenames
# after this.
# COMPRESS_MAN - A command to compress manpages (if necessary).
#
# Default targets and their behaviors: # Default targets and their behaviors:
# #
# fetch - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined) # fetch - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined)
@ -222,6 +234,9 @@
# NEVER override the "regular" targets unless you want to open # NEVER override the "regular" targets unless you want to open
# a major can of worms. # a major can of worms.
# Get the operating system type
OPSYS!= uname -s
.if exists(${.CURDIR}/../Makefile.inc) .if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc" .include "${.CURDIR}/../Makefile.inc"
.endif .endif
@ -229,8 +244,12 @@
# These need to be absolute since we don't know how deep in the ports # These need to be absolute since we don't know how deep in the ports
# tree we are and thus can't go relative. They can, of course, be overridden # tree we are and thus can't go relative. They can, of course, be overridden
# by individual Makefiles. # by individual Makefiles or local system make configuration.
.if (${OPSYS} == "NetBSD")
PORTSDIR?= ${DESTDIR}/usr/opt
.else
PORTSDIR?= ${DESTDIR}/usr/ports PORTSDIR?= ${DESTDIR}/usr/ports
.endif
LOCALBASE?= /usr/local LOCALBASE?= /usr/local
X11BASE?= /usr/X11R6 X11BASE?= /usr/X11R6
DISTDIR?= ${PORTSDIR}/distfiles/${DIST_SUBDIR} DISTDIR?= ${PORTSDIR}/distfiles/${DIST_SUBDIR}
@ -284,7 +303,11 @@ DO_NADA?= /usr/bin/true
# Miscellaneous overridable commands: # Miscellaneous overridable commands:
GMAKE?= gmake GMAKE?= gmake
XMKMF?= xmkmf -a XMKMF?= xmkmf -a
.if (${OPSYS} == "NetBSD")
MD5?= /usr/bin/md5
.else
MD5?= /sbin/md5 MD5?= /sbin/md5
.endif
MD5_FILE?= ${FILESDIR}/md5 MD5_FILE?= ${FILESDIR}/md5
MAKE_FLAGS?= -f MAKE_FLAGS?= -f
@ -346,6 +369,11 @@ INSTALL_DATA= \
${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} ${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
INSTALL_MAN= \ INSTALL_MAN= \
${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
.if defined(NOMANCOMPRESS)
COMPRESS_MAN= @${DO_NADA}
.else
COMPRESS_MAN= gzip -9nf
.endif
# The user can override the NO_PACKAGE by specifying this from # The user can override the NO_PACKAGE by specifying this from
# the make command line # the make command line
@ -383,15 +411,14 @@ MOTIFLIB?= -L${X11BASE}/lib -lXm
.endif .endif
ECHO?= /bin/echo ECHO?= /bin/echo
CAT+= /bin/cat CAT?= /bin/cat
CP?= /bin/cp CP?= /bin/cp
SETENV?= /usr/bin/env SETENV?= /usr/bin/env
RM?= /bin/rm RM?= /bin/rm
MKDIR?= /bin/mkdir MKDIR?= /bin/mkdir -p
GZCAT?= /usr/bin/gzcat GZCAT?= /usr/bin/gzcat
BASENAME?= /usr/bin/basename BASENAME?= /usr/bin/basename
SED?= /usr/bin/sed SED?= /usr/bin/sed
CAT?= /bin/cat
GREP?= /usr/bin/grep GREP?= /usr/bin/grep
AWK?= /usr/bin/awk AWK?= /usr/bin/awk
@ -537,6 +564,12 @@ is_depended: ${IS_DEPENDED_TARGET}
# override from an individual Makefile. # override from an individual Makefile.
################################################################ ################################################################
# Disable checksum
.if defined(NO_CHECKSUM) && !target(checksum)
checksum: fetch
@${DO_NADA}
.endif
# Disable extract # Disable extract
.if defined(NO_EXTRACT) && !target(extract) .if defined(NO_EXTRACT) && !target(extract)
extract: checksum extract: checksum
@ -547,40 +580,40 @@ makesum:
@${DO_NADA} @${DO_NADA}
.endif .endif
# Disable patch
.if defined(NO_PATCH) && !target(patch)
patch: extract
@${TOUCH} ${TOUCH_FLAGS} ${PATCH_COOKIE}
.endif
# Disable configure # Disable configure
.if defined(NO_CONFIGURE) && !target(configure) .if defined(NO_CONFIGURE) && !target(configure)
configure: patch configure: patch
@${TOUCH} ${TOUCH_FLAGS} ${CONFIGURE_COOKIE} @${TOUCH} ${TOUCH_FLAGS} ${CONFIGURE_COOKIE}
.endif .endif
# Disable describe
.if defined(NO_DESCRIBE) && !target(describe)
describe:
@${DO_NADA}
.endif
# Disable build # Disable build
.if defined(NO_BUILD) && !target(build) .if defined(NO_BUILD) && !target(build)
build: configure build: configure
@${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE} @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
.endif .endif
# Disable package
.if defined(NO_PACKAGE) && !target(package)
package:
@${DO_NADA}
.endif
# Disable install # Disable install
.if defined(NO_INSTALL) && !target(install) .if defined(NO_INSTALL) && !target(install)
install: build install: build
@${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE} @${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
.endif .endif
# Disable patch # Disable package
.if defined(NO_PATCH) && !target(patch) .if defined(NO_PACKAGE) && !target(package)
patch: extract package:
@${TOUCH} ${TOUCH_FLAGS} ${PATCH_COOKIE} @${DO_NADA}
.endif
# Disable describe
.if defined(NO_DESCRIBE) && !target(describe)
describe:
@${DO_NADA}
.endif .endif
################################################################ ################################################################
@ -595,7 +628,7 @@ patch: extract
.if !target(do-fetch) .if !target(do-fetch)
do-fetch: do-fetch:
@if [ ! -d ${DISTDIR} ]; then ${MKDIR} -p ${DISTDIR}; fi @if [ ! -d ${DISTDIR} ]; then ${MKDIR} ${DISTDIR}; fi
@(cd ${DISTDIR}; \ @(cd ${DISTDIR}; \
for file in ${DISTFILES}; do \ for file in ${DISTFILES}; do \
if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
@ -618,7 +651,7 @@ do-fetch:
fi \ fi \
done) done)
.if defined(PATCHFILES) .if defined(PATCHFILES)
@if [ ! -d ${DISTDIR} ]; then ${MKDIR} -p ${DISTDIR}; fi @if [ ! -d ${DISTDIR} ]; then ${MKDIR} ${DISTDIR}; fi
@(cd ${DISTDIR}; \ @(cd ${DISTDIR}; \
for file in ${PATCHFILES}; do \ for file in ${PATCHFILES}; do \
if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
@ -649,7 +682,7 @@ do-fetch:
do-extract: do-extract:
.if !defined(NO_WRKDIR) .if !defined(NO_WRKDIR)
@${RM} -rf ${WRKDIR} @${RM} -rf ${WRKDIR}
@${MKDIR} -p ${WRKDIR} @${MKDIR} ${WRKDIR}
.endif .endif
@for file in ${EXTRACT_ONLY}; do \ @for file in ${EXTRACT_ONLY}; do \
if !(cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\ if !(cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
@ -687,7 +720,7 @@ do-patch:
${ECHO_MSG} "===> Perhaps you forgot the -P flag to cvs co or update?"; \ ${ECHO_MSG} "===> Perhaps you forgot the -P flag to cvs co or update?"; \
fi; \ fi; \
else \ else \
${ECHO_MSG} "===> Applying FreeBSD patches for ${PKGNAME}" ; \ ${ECHO_MSG} "===> Applying ${OPSYS} patches for ${PKGNAME}" ; \
for i in ${PATCHDIR}/patch-*; do \ for i in ${PATCHDIR}/patch-*; do \
case $$i in \ case $$i in \
*.orig|*~) \ *.orig|*~) \
@ -695,7 +728,7 @@ do-patch:
;; \ ;; \
*) \ *) \
if [ ${PATCH_DEBUG_TMP} = yes ]; then \ if [ ${PATCH_DEBUG_TMP} = yes ]; then \
${ECHO_MSG} "===> Applying FreeBSD patch $$i" ; \ ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
fi; \ fi; \
${PATCH} ${PATCH_ARGS} < $$i; \ ${PATCH} ${PATCH_ARGS} < $$i; \
;; \ ;; \
@ -768,7 +801,7 @@ do-package:
${ECHO_MSG} "===> Building package for ${PKGNAME}"; \ ${ECHO_MSG} "===> Building package for ${PKGNAME}"; \
if [ -d ${PACKAGES} ]; then \ if [ -d ${PACKAGES} ]; then \
if [ ! -d ${PKGREPOSITORY} ]; then \ if [ ! -d ${PKGREPOSITORY} ]; then \
if ! ${MKDIR} -p ${PKGREPOSITORY}; then \ if ! ${MKDIR} ${PKGREPOSITORY}; then \
${ECHO_MSG} ">> Can't create directory ${PKGREPOSITORY}."; \ ${ECHO_MSG} ">> Can't create directory ${PKGREPOSITORY}."; \
exit 1; \ exit 1; \
fi; \ fi; \
@ -792,7 +825,7 @@ package-links:
@${MAKE} ${.MAKEFLAGS} delete-package-links @${MAKE} ${.MAKEFLAGS} delete-package-links
@for cat in ${CATEGORIES}; do \ @for cat in ${CATEGORIES}; do \
if [ ! -d ${PACKAGES}/$$cat ]; then \ if [ ! -d ${PACKAGES}/$$cat ]; then \
if ! ${MKDIR} -p ${PACKAGES}/$$cat; then \ if ! ${MKDIR} ${PACKAGES}/$$cat; then \
${ECHO_MSG} ">> Can't create directory ${PACKAGES}/$$cat."; \ ${ECHO_MSG} ">> Can't create directory ${PACKAGES}/$$cat."; \
exit 1; \ exit 1; \
fi; \ fi; \
@ -825,7 +858,7 @@ _PORT_USE: .USE
@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} build-depends lib-depends misc-depends @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} build-depends lib-depends misc-depends
.endif .endif
.if make(real-install) .if make(real-install)
@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} run-depends @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} run-depends lib-depends
.endif .endif
.if make(real-install) .if make(real-install)
.if !defined(NO_MTREE) .if !defined(NO_MTREE)
@ -993,7 +1026,7 @@ clean: pre-clean
.if !target(fetch-list) .if !target(fetch-list)
fetch-list: fetch-list:
@if [ ! -d ${DISTDIR} ]; then ${MKDIR} -p ${DISTDIR}; fi @if [ ! -d ${DISTDIR} ]; then ${MKDIR} ${DISTDIR}; fi
@(cd ${DISTDIR}; \ @(cd ${DISTDIR}; \
for file in ${DISTFILES}; do \ for file in ${DISTFILES}; do \
if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
@ -1022,7 +1055,7 @@ fetch-list:
.if !target(makesum) .if !target(makesum)
makesum: fetch makesum: fetch
@if [ ! -d ${FILESDIR} ]; then ${MKDIR} -p ${FILESDIR}; fi @if [ ! -d ${FILESDIR} ]; then ${MKDIR} ${FILESDIR}; fi
@if [ -f ${MD5_FILE} ]; then ${RM} -f ${MD5_FILE}; fi @if [ -f ${MD5_FILE} ]; then ${RM} -f ${MD5_FILE}; fi
@(cd ${DISTDIR}; \ @(cd ${DISTDIR}; \
for file in ${DISTFILES} ${PATCHFILES}; do \ for file in ${DISTFILES} ${PATCHFILES}; do \
@ -1142,7 +1175,7 @@ _DEPENDS_USE: .USE
notfound=1; \ notfound=1; \
fi; \ fi; \
else \ else \
if which -s "$$prog"; then \ if which "$$prog" > /dev/null 2>&1 ; then \
${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \ ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \
notfound=0; \ notfound=0; \
else \ else \
@ -1307,13 +1340,13 @@ print-package-depends:
.if !target(fake-pkg) .if !target(fake-pkg)
fake-pkg: fake-pkg:
@if [ ! -f ${PKGDIR}/PLIST -o ! -f ${PKGDIR}/COMMENT -o ! -f ${PKGDIR}/DESCR ]; then ${ECHO} "** Missing package files for ${PKGNAME} - installation not recorded."; exit 1; fi @if [ ! -f ${PKGDIR}/PLIST -o ! -f ${PKGDIR}/COMMENT -o ! -f ${PKGDIR}/DESCR ]; then ${ECHO} "** Missing package files for ${PKGNAME} - installation not recorded."; exit 1; fi
@if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} -p ${PKG_DBDIR}; fi @if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} ${PKG_DBDIR}; fi
.if defined(FORCE_PKG_REGISTER) .if defined(FORCE_PKG_REGISTER)
@${RM} -rf ${PKG_DBDIR}/${PKGNAME} @${RM} -rf ${PKG_DBDIR}/${PKGNAME}
.endif .endif
@if [ ! -d ${PKG_DBDIR}/${PKGNAME} ]; then \ @if [ ! -d ${PKG_DBDIR}/${PKGNAME} ]; then \
${ECHO_MSG} "===> Registering installation for ${PKGNAME}"; \ ${ECHO_MSG} "===> Registering installation for ${PKGNAME}"; \
${MKDIR} -p ${PKG_DBDIR}/${PKGNAME}; \ ${MKDIR} ${PKG_DBDIR}/${PKGNAME}; \
${PKG_CMD} ${PKG_ARGS} -O ${PKGFILE} > ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \ ${PKG_CMD} ${PKG_ARGS} -O ${PKGFILE} > ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \
${CP} ${PKGDIR}/DESCR ${PKG_DBDIR}/${PKGNAME}/+DESC; \ ${CP} ${PKGDIR}/DESCR ${PKG_DBDIR}/${PKGNAME}/+DESC; \
${CP} ${PKGDIR}/COMMENT ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \ ${CP} ${PKGDIR}/COMMENT ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \

View file

@ -1,5 +1,5 @@
# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91 # from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
# $Id: bsd.port.subdir.mk,v 1.13 1996/04/01 11:13:00 asami Exp $ # $Id: bsd.port.subdir.mk,v 1.14 1996/04/09 22:54:13 wosch Exp $
.MAIN: all .MAIN: all
@ -7,6 +7,9 @@
STRIP?= -s STRIP?= -s
.endif .endif
.if !defined(OPSYS) # XXX !!
OPSYS!= uname -s
.endif
ECHO_MSG?= echo ECHO_MSG?= echo
@ -71,7 +74,11 @@ readme:
@make README.html @make README.html
.endif .endif
.if (${OPSYS} == "NetBSD")
PORTSDIR ?= /usr/opt
.else
PORTSDIR ?= /usr/ports PORTSDIR ?= /usr/ports
.endif
TEMPLATES ?= ${PORTSDIR}/templates TEMPLATES ?= ${PORTSDIR}/templates
.if defined(PORTSTOP) .if defined(PORTSTOP)
README= ${TEMPLATES}/README.top README= ${TEMPLATES}/README.top