summaryrefslogtreecommitdiff
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1995-04-19 15:02:26 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1995-04-19 15:02:26 +0000
commit0d515239c74b1effd1a919e32c96f6ab87275d8b (patch)
tree41667ded70d4cdd4362452a6a6072a8cd60855b8 /Mk/bsd.port.mk
parentUpgrade, now use less-290 as the base. (diff)
1. Add Satoshi's much-requested "fake pkg_add" option to the installation
rule. 2. Have all non-X11 prefix using packages include the BSD.local.dist mtree file for initialization of /usr/local. I'm still not sure if this is A Good Thing(tm) but I'll see what the users say. It's easily overridden. 3. Standardise on ${PKG_DBDIR} as pointer to /var/db/pkg or local preference.
Notes
Notes: svn path=/head/; revision=1466
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk30
1 files changed, 29 insertions, 1 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 68eb27bb982a..bd3a36d9b167 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -3,7 +3,7 @@
# bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain.
#
-# $Id: bsd.port.mk,v 1.141 1995/04/18 08:18:27 asami Exp $
+# $Id: bsd.port.mk,v 1.142 1995/04/18 08:24:18 asami Exp $
#
# Please view me with 4 column tabs!
@@ -69,6 +69,7 @@
# (default: ${.CURDIR}/files)
# PKGDIR - A direction containing any package creation files.
# (default: ${.CURDIR}/pkg)
+# PKG_DBDIR - Where package installation is recorded (default: /var/db/pkg)
#
# NO_EXTRACT - Use a dummy (do-nothing) extract target.
# NO_CONFIGURE - Use a dummy (do-nothing) configure target.
@@ -224,6 +225,11 @@ EXTRACT_BEFORE_ARGS?= ${EXTRACT_ARGS}
EXTRACT_BEFORE_ARGS?= -xzf
.endif
+# Figure out where the local mtree file is
+.if !defined(MTREE_LOCAL) && exists(/etc/mtree/BSD.local.dist)
+MTREE_LOCAL= /etc/mtree/BSD.local.dist
+.endif
+
PKG_CMD?= pkg_create
.if !defined(PKG_ARGS)
PKG_ARGS= -v -c ${PKGDIR}/COMMENT -d ${PKGDIR}/DESCR -f ${PKGDIR}/PLIST -p ${PREFIX} -P "`${MAKE} package-depends|sort|uniq`"
@@ -236,14 +242,21 @@ PKG_ARGS+= -k ${PKGDIR}/DEINSTALL
.if exists(${PKGDIR}/REQ)
PKG_ARGS+= -r ${PKGDIR}/REQ
.endif
+.if !defined(USE_X11) && !defined(USE_IMAKE) && defined(MTREE_LOCAL)
+PKG_ARGS+= -m ${MTREE_LOCAL}
+.endif
.endif
PKG_SUFX?= .tgz
+# where pkg_add records its dirty deeds.
+PKG_DBDIR?= /var/db/pkg
+# Used to print all the '===>' style prompts - override this to turn them off.
ECHO_MSG?= echo
ALL_TARGET?= all
INSTALL_TARGET?= install
+# If the user has this set, go to the FreeBSD respository for everything.
.if defined(MASTER_SITE_FREEBSD)
MASTER_SITE_OVERRIDE= ftp://freebsd.cdrom.com/pub/FreeBSD/FreeBSD-current/ports/distfiles/
.endif
@@ -417,6 +430,21 @@ ${INSTALL_COOKIE}:
@(cd ${WRKSRC}; ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} install.man)
.endif
.endif
+.if !defined(NO_PACKAGE)
+ @if [ ! -f ${PKGDIR}/PLIST -o ! -f ${PKGDIR}/COMMENT -o ! -f ${PKGDIR}/DESCR ]; then echo "** Missing patch 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}/${PKGNAME} ]; then \
+ ${ECHO_MSG} "===> Registering installation for ${PKGNAME}"; \
+ mkdir -p ${PKG_DBDIR}/${PKGNAME}; \
+ cp ${PKGDIR}/PLIST ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \
+ cp ${PKGDIR}/DESCR ${PKG_DBDIR}/${PKGNAME}/+DESC; \
+ cp ${PKGDIR}/COMMENT ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \
+ else \
+ ${ECHO_MSG} "===> ${PKGNAME} is already installed - perhaps an older version?"; \
+ ${ECHO_MSG} " If so, you may wish to \`\`pkg_delete ${PKGNAME}'' and install"; \
+ ${ECHO_MSG} " this port again to upgrade it properly."; \
+ fi
+.endif
@${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
.endif