summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2003-08-14 07:37:00 +0000
committerjlam <jlam>2003-08-14 07:37:00 +0000
commitd28c58f8cdb05927579c5c10ac0750083764ff70 (patch)
tree4654e825a6f770fa825cc0f98a3a9d1a683eaa6c
parent2df3d382c1294f4cf33bd7392482816b30644566 (diff)
downloadpkgsrc-d28c58f8cdb05927579c5c10ac0750083764ff70.tar.gz
Sync to HEAD, primarily for texinfo changes, and prepare for buildlink3.
-rw-r--r--mk/bsd.pkg.defaults.mk46
-rw-r--r--mk/bsd.pkg.mk163
-rw-r--r--mk/buildlink2/bsd.buildlink2.mk10
-rw-r--r--mk/bulk/bsd.bulk-pkg.mk6
-rwxr-xr-xmk/bulk/mksandbox4
-rw-r--r--mk/defs.NetBSD.mk3
-rw-r--r--mk/texinfo.mk106
-rw-r--r--mk/tools.mk175
8 files changed, 305 insertions, 208 deletions
diff --git a/mk/bsd.pkg.defaults.mk b/mk/bsd.pkg.defaults.mk
index 2db8c83c3b2..384802bcab2 100644
--- a/mk/bsd.pkg.defaults.mk
+++ b/mk/bsd.pkg.defaults.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.defaults.mk,v 1.160.2.5 2003/08/14 07:08:16 jlam Exp $
+# $NetBSD: bsd.pkg.defaults.mk,v 1.160.2.6 2003/08/14 07:37:00 jlam Exp $
#
# A file providing defaults for pkgsrc and the packages collection.
@@ -85,6 +85,18 @@ PKGSRC_SLEEPSECS?= 5
# Possible: YES, NO
# Default: YES
+PKGSRC_MESSAGE_RECIPIENTS?=
+# login names of recipients of any MESSAGE files which will be mailed
+# Possible: any login names
+# Default: none
+
+PKGSRC_SHOW_BUILD_DEFS?=yes
+# Show BUILD_DEFS definitions for a package when it is being built
+# (BUILD_DEFS are extra definitions which govern how some packages are
+# built and behave)
+# Possible: "yes", not "yes"
+# Default: "yes"
+
PKGSRC_RUN_TEST?= no
# Run test target before install
# Possible: yes, no
@@ -736,6 +748,16 @@ EMACS_USE_XAW3D?= NO
# Possible: YES, NO
# Default: NO
+EXIM_GROUP?= mail
+# Used in the exim package to specify the server group.
+# Possible: any group name
+# Default: mail
+
+EXIM_USER?= mail
+# Used in the exim package to specify the server user.
+# Possible: any user name
+# Default: mail
+
FETCHMAIL_USE_SSL?= YES
# Enable SSL in fetchmail (for pop and imap connections)
# Possible: YES, NO
@@ -747,6 +769,26 @@ FLOW_TOOLS_USE_MYSQL?= NO
# Possible: YES, NO
# Default: NO
+#FLUXBOX_USE_XINERAMA?= NO
+# Compile flukebox with xinerama extensions
+# Possible: YES, NO
+# Default: NO
+
+#FLUXBOX_USE_KDE?= NO
+# Compile flukebox with KDE support
+# Possible: YES, NO
+# Default: NO
+
+#FLUXBOX_USE_GNOME?= NO
+# Compile flukebox with GNOME support
+# Possible: YES, NO
+# Default: NO
+
+#FLUXBOX_USE_XFT?= YES
+# Compile flukebox with Xft support
+# Possible: YES, NO
+# Default: YES
+
FOX_USE_XUNICODE?= YES
# Used in fox to build in support for Unicode by XUnicode. See
# http://www.ab.wakwak.com/~tino/jatk/fox/ (in japanese) for more information.
@@ -1183,7 +1225,7 @@ MOZILLA_USE_XFT?= NO
MPLAYER_DISABLE_DRIVERS?=
# Whitespace separated list of output drivers that are not wanted in
# mplayer/gmplayer's binary.
-# Possible: arts esd faad nas sdl
+# Possible: arts esd nas sdl
# Default: empty
MPLAYER_ENABLE_RUNTIME_CPU_DETECTION?= YES
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 701b4d79908..f118d0dbd17 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1216.2.15 2003/08/01 19:00:28 jlam Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1216.2.16 2003/08/14 07:37:01 jlam Exp $
#
# This file is in the public domain.
#
@@ -32,32 +32,34 @@ MAKE_ENV+= USETOOLS="${USETOOLS}"
# This has to come first to avoid showing all BUILD_DEFS added by this
# Makefile, which are usually not customizable.
-.PHONY: pre-fetch build-defs-message
-pre-fetch: build-defs-message
-.if !target(build-defs-message)
+.PHONY: pre-extract build-defs-message
+pre-extract: build-defs-message
+.if ${PKGSRC_SHOW_BUILD_DEFS} != "YES" && ${PKGSRC_SHOW_BUILD_DEFS} != "yes"
+build-defs-message:
+.elif !target(build-defs-message)
build-defs-message: ${WRKDIR}
-.if defined(BUILD_DEFS) && !empty(BUILD_DEFS)
-.if !exists(${WRKDIR}/.bdm_done)
+. if defined(BUILD_DEFS) && !empty(BUILD_DEFS)
+. if !exists(${WRKDIR}/.bdm_done)
@${ECHO} "=========================================================================="
@${ECHO} "The following variables will affect the build process of this package,"
@${ECHO} "${PKGNAME}. Their current value is shown below:"
@${ECHO} ""
-. for var in ${BUILD_DEFS:O:u}
-. if !defined(${var})
+. for var in ${BUILD_DEFS:O}
+. if !defined(${var})
@${ECHO} " * ${var} (not defined)"
-. elif defined(${var}) && empty(${var})
+. elif defined(${var}) && empty(${var})
@${ECHO} " * ${var} (defined)"
-. else
+. else
@${ECHO} " * ${var} = ${${var}}"
-. endif
-. endfor
+. endif
+. endfor
@${ECHO} ""
@${ECHO} "You may want to abort the process now with CTRL+C and change their value"
@${ECHO} "before continuing. Be sure to run \`${MAKE} clean' after the changes."
@${ECHO} "=========================================================================="
@${TOUCH} ${WRKDIR}/.bdm_done
-.endif
-.endif
+. endif
+. endif
.endif
##### Some NetBSD platforms permitted the user to set the binary format while
@@ -89,11 +91,20 @@ INTERACTIVE_STAGE?= none
# that if no buildlink2.mk files are included, then they still point to
# where headers and libraries for installed packages and X11R6 may be found.
#
-USE_BUILDLINK2?= no # default to not using buildlink2
BUILDLINK_DIR?= ${LOCALBASE}
BUILDLINK_X11PKG_DIR?= ${X11BASE}
BUILDLINK_X11_DIR?= ${X11BASE}
+USE_BUILDLINK2?= no # default to not using buildlink2
+.if ${PKG_INSTALLATION_TYPE} == "pkgviews"
+_USE_BUILDLINK3= yes
+.else
+_USE_BUILDLINK3= no
+.endif
+.if empty(USE_BUILDLINK2:M[nN][oO]) && empty(_USE_BUILDLINK3:M[nN][oO])
+PKG_FAIL_REASON= "Please undefine USE_BUILDLINK2 when using pkgviews"
+.endif
+
.if defined(USE_IMAKE)
USE_X11BASE?= implied
PLIST_SUBST+= IMAKE_MAN_SOURCE_PATH=${IMAKE_MAN_SOURCE_PATH} \
@@ -340,7 +351,7 @@ X11_LDFLAGS= # empty
X11_LDFLAGS+= -Wl,${RPATH_FLAG}${X11BASE}/lib
X11_LDFLAGS+= -L${X11BASE}/lib
.endif
-.if !empty(USE_BUILDLINK2:M[nN][oO])
+.if !empty(USE_BUILDLINK2:M[nN][oO]) && !empty(_USE_BUILDLINK3:M[nN][oO])
. if ${PKG_INSTALLATION_TYPE} == "overwrite"
LDFLAGS+= -Wl,${RPATH_FLAG}${LOCALBASE}/lib
LDFLAGS+= -L${LOCALBASE}/lib
@@ -372,7 +383,7 @@ MAKE_ENV+= CC="${CC}"
.if defined(CXX)
MAKE_ENV+= CXX="${CXX}"
.endif
-.if defined(CPP)
+.if defined(CPP) && !defined(NO_EXPORT_CPP)
MAKE_ENV+= CPP="${CPP}"
.endif
@@ -580,12 +591,15 @@ PLIST_SUBST+= PERL5_SITEARCH=${PERL5_SITEARCH:S/^${LOCALBASE}\///}
PLIST_SUBST+= PERL5_ARCHLIB=${PERL5_ARCHLIB:S/^${LOCALBASE}\///}
.endif
-.if defined(USE_NEW_TEXINFO)
-INFO_FILES?=
+# base vs. GNU tools
+. include "../../mk/tools.mk"
+
+# Handle info files
+#
+INFO_FILES?= # default to no info files to handle
USE_MAKEINFO?= no # default to not using makeinfo
-. if !empty(INFO_FILES) || empty(USE_MAKEINFO:M[nN][oO])
-. include "../../mk/texinfo.mk"
-. endif
+.if !empty(INFO_FILES) || empty(USE_MAKEINFO:M[nN][oO])
+. include "../../mk/texinfo.mk"
.endif
.if defined(USE_PKGINSTALL) && !empty(USE_PKGINSTALL:M[yY][eE][sS])
@@ -1232,12 +1246,16 @@ SCRIPTS_ENV+= CURDIR=${.CURDIR} DISTDIR=${DISTDIR} \
SCRIPTS_ENV+= BATCH=yes
.endif
-.if !empty(USE_BUILDLINK2:M[nN][oO])
+.if !empty(USE_BUILDLINK2:M[nN][oO]) && !empty(_USE_BUILDLINK3:M[nN][oO])
NO_BUILDLINK= # defined
.endif
.if !defined(NO_BUILDLINK)
-. include "../../mk/buildlink2/bsd.buildlink2.mk"
+. if empty(_USE_BUILDLINK3:M[nN][oO])
+. include "../../mk/buildlink3/bsd.buildlink3.mk"
+. elif empty(USE_BUILDLINK2:M[nN][oO])
+. include "../../mk/buildlink2/bsd.buildlink2.mk"
+. endif
.endif
.MAIN: all
@@ -1415,7 +1433,7 @@ checksum: fetch
# Disable buildlink
.PHONY: buildlink
-.if defined(NO_BUILDLINK) && !target(configure)
+.if defined(NO_BUILDLINK) && !target(buildlink)
buildlink: patch
${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${BUILDLINK_COOKIE}
.endif
@@ -1669,7 +1687,6 @@ show-depends-dirs:
# Show all build and run depends, reverse-breadth first, with options.
.if make(show-all-depends-dirs) || make(show-all-depends-dirs-excl) || make (show-root-dirs)
-.PHONY: show-all-depends-dirs show-all-depends-dirs-excl show-root-dirs
# "awk" macro to recurse over the dependencies efficiently, never running in
# the same same directory twice. You may set the following options via "-v":
@@ -2193,7 +2210,7 @@ do-pkgconfig-override:
. endfor
.endif
-.if empty(USE_BUILDLINK2:M[nN][oO])
+.if empty(USE_BUILDLINK2:M[nN][oO]) || empty(_USE_BUILDLINK3:M[nN][oO])
#
# By default, prevent invocation of GNU "auto*" driven by the generated
# Makefiles during the build process by touching various auto{conf,make}
@@ -2489,6 +2506,8 @@ real-su-install: ${MESSAGE}
${ECHO_MSG} "Warning: not superuser, can't run mtree."; \
${ECHO_MSG} "Become root and try again to ensure correct permissions."; \
fi
+.else
+ ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${PREFIX}
.endif # !NO_MTREE
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} pre-install-script
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} pre-install
@@ -2506,13 +2525,6 @@ real-su-install: ${MESSAGE}
${_PKG_SILENT}#
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} ${PLIST}
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} post-install-script
-.if !defined(USE_NEW_TEXINFO)
-. for f in ${INFO_FILES}
- ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} "${INSTALL_INFO} --info-dir=${PREFIX}/info ${PREFIX}/info/${f}"; \
- ${INSTALL_INFO} --remove --info-dir=${PREFIX}/info ${PREFIX}/info/${f}; \
- ${INSTALL_INFO} --info-dir=${PREFIX}/info ${PREFIX}/info/${f}
-. endfor
-.endif # !USE_NEW_TEXINFO
${_PKG_SILENT}${_PKG_DEBUG}newmanpages=`${EGREP} -h \
'^([^@/]*/)*man/([^/]*/)?(man[1-9ln]/.*\.[1-9ln]|cat[1-9ln]/.*\.0)(\.gz)?$$' \
${PLIST} 2>/dev/null || ${TRUE}`; \
@@ -2556,7 +2568,7 @@ real-su-install: ${MESSAGE}
fi
.if ${_DO_SHLIB_CHECKS} == "yes"
. if ${PKG_INSTALLATION_TYPE} == "overwrite"
- ${_PKG_SILENT}${_PKG_DEBUG}\
+ ${_PKG_SILENT}${_PKG_DEBUG} \
${MAKE} ${MAKEFLAGS} do-shlib-handling SHLIB_PLIST_MODE=0
. endif
.endif
@@ -2565,6 +2577,16 @@ real-su-install: ${MESSAGE}
@${ECHO_MSG} ""
@${CAT} ${MESSAGE}
@${ECHO_MSG} ""
+. if !empty(PKGSRC_MESSAGE_RECIPIENTS)
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ (${ECHO} "The ${PKGNAME} package was installed on `${HOSTNAME_CMD}` at `date`"; \
+ ${ECHO} ""; \
+ ${ECHO} "Please note the following:"; \
+ ${ECHO} ""; \
+ ${CAT} ${MESSAGE}; \
+ ${ECHO} "") | \
+ mail -s"Package ${PKGNAME} installed" ${PKGSRC_MESSAGE_RECIPIENTS}
+. endif
.endif
.if !defined(NO_PKG_REGISTER)
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} ${PKG_DBDIR_MAKEFLAGS} fake-pkg
@@ -3453,7 +3475,7 @@ clean: pre-clean
clean-depends:
. if defined(BUILD_DEPENDS) || defined(DEPENDS)
${_PKG_SILENT}${_PKG_DEBUG} \
- for i in `${MAKE} ${MAKEFLAGS} CLEAN_DEPENDS_LIST_TOP=YES clean-depends-list | ${SED} -e 's;\.\./[^ ]*; ;g' | ${TR} -s "[:space:]" "\n" | ${SORT} -u` ;\
+ for i in `${MAKE} ${MAKEFLAGS} show-all-depends-dirs-excl` ;\
do \
cd ${.CURDIR}/../../$$i && \
${MAKE} ${MAKEFLAGS} CLEANDEPENDS=NO clean; \
@@ -3461,48 +3483,6 @@ clean-depends:
. endif
.endif
-
-# The clean-depends-list target will produce a list of all
-# BUILD_DEPENDS and DEPENDS packages.
-# As each *DEPENDS package is visited, it is added to the
-# CLEAN_DEPENDS_LIST_SEEN variable. Once a pkg is in the list
-# it will not be visited again. This prevents traversing the same
-# part of the dependency tree multiple times. Each depending package
-# ends up in the list twice. Once as the relative path from the depending
-# package and once as the path from pkgsrc. Eg, "../../foo/bar foo/bar"
-# The "../../foo/bar" version is later removed from the list in the
-# clean-depends target. The remaining bit of redundancy is that some
-# packages list their depends as "../bar" instead of "../../foo/bar"
-# In this case its possible for a dependency to be visited twice.
-
-.PHONY: clean-depends-list
-.if !target(clean-depends-list)
-clean-depends-list:
-. if defined(BUILD_DEPENDS) || defined(DEPENDS)
- @for dir in `${ECHO} ${BUILD_DEPENDS:C/^[^:]*://:C/:.*//} \
- ${DEPENDS:C/^[^:]*://:C/:.*//} | \
- ${TR} '\040' '\012' `; do \
- case "$$CLEAN_DEPENDS_LIST_SEEN" in \
- *" "$$dir" "*) ;; \
- *) \
- CLEAN_DEPENDS_LIST_SEEN=" $$dir `cd ${.CURDIR} ; cd $$dir && ${MAKE} ${MAKEFLAGS} CLEAN_DEPENDS_LIST_SEEN="$$CLEAN_DEPENDS_LIST_SEEN" CLEAN_DEPENDS_LIST_TOP=NO clean-depends-list`";\
- ;; \
- esac \
- done ; \
- if [ "${CLEAN_DEPENDS_LIST_TOP}" != "YES" ]; then \
- ${ECHO} " ${PKGPATH} $$CLEAN_DEPENDS_LIST_SEEN"; \
- else \
- ${ECHO} " $$CLEAN_DEPENDS_LIST_SEEN"; \
- fi
-. else
- @if [ "${CLEAN_DEPENDS_LIST_TOP}" != "YES" ]; then \
- ${ECHO} " ${PKGPATH} $$CLEAN_DEPENDS_LIST_SEEN"; \
- else \
- ${ECHO} " $$CLEAN_DEPENDS_LIST_SEEN"; \
- fi
-. endif
-.endif
-
.PHONY: pre-distclean
.if !target(pre-distclean)
pre-distclean:
@@ -4306,18 +4286,19 @@ print-pkg-size-depends:
# Common (system) directories not to generate @dirrm statements for
# Reads MTREE_FILE and extracts a list of sed commands that will
# sort out which directories NOT to include into the PLIST @dirrm list
-SUBST_PLIST_REPLACEMENT=\
+SUBST_PLIST_REPLACEMENT1= \
-e 's@${OPSYS}@\$${OPSYS}@' \
-e 's@${OS_VERSION:S/./\./g}@\$${OS_VERSION}@' \
-e 's@${MACHINE_GNU_PLATFORM}@\$${MACHINE_GNU_PLATFORM}@' \
-e 's@${MACHINE_ARCH}@\$${MACHINE_ARCH}@' \
-e 's@${MACHINE_GNU_ARCH}@\$${MACHINE_GNU_ARCH}@' \
-e 's@${LOWER_VENDOR}@\$${LOWER_VENDOR}@' \
- -e 's@${LOWER_OPSYS}@\$${LOWER_OPSYS}@' \
- -e 's@${LOWER_OS_VERSION:S/./\./g}@\$${LOWER_OS_VERSION}@' \
- -e 's@${PKGNAME:S/./\./g}@\$${PKGNAME}@' \
+ -e 's@${LOWER_OS_VERSION:S/./\./g}@\$${LOWER_OS_VERSION}@' \
+ -e 's@${LOWER_OPSYS}@\$${LOWER_OPSYS}@'
+SUBST_PLIST_REPLACEMENT2= \
+ -e 's@${PKGNAME:S/./\./g}@\$${PKGNAME}@' \
-e 's@${PKGVERSION:S/./\./g}@\$${PKGVERSION}@' \
- -e 's@${PKGLOCALEDIR}/locale@\$${PKGLOCALEDIR}/locale@' \
+ -e 's@${PKGLOCALEDIR}/locale@\$${PKGLOCALEDIR}/locale@'
.if make(print-PLIST)
COMMON_DIRS!= ${AWK} 'BEGIN { \
@@ -4335,12 +4316,13 @@ COMMON_DIRS!= ${AWK} 'BEGIN { \
if ( i == 0 ){ \
cwd = $$1 ; \
} else { \
- cwd = cwd "\\\\/" $$1 ; \
+ cwd = cwd "\\/" $$1 ; \
} \
- print "-e \"/^" cwd "$$$$/d\""; \
+ print "/^" cwd "$$$$/ { next; }"; \
i=i+1 ; \
} \
} \
+ END { print "{ print $$$$0; }"; } \
' <${MTREE_FILE}
.endif
@@ -4364,9 +4346,8 @@ print-PLIST:
${FIND} ${PREFIX}/. -xdev -newer ${EXTRACT_COOKIE} \! -type d \
| ( ${GREP} -v emul/linux/proc || ${TRUE} ) \
| ${SORT} \
- | ${SED} \
- -e 's@${PREFIX}/./@@' \
- ${SUBST_PLIST_REPLACEMENT} \
+ | ${SED} -e 's@${PREFIX}/./@@' ${SUBST_PLIST_REPLACEMENT1} \
+ | ${SED} ${SUBST_PLIST_REPLACEMENT2} \
| ${AWK} ' \
/^@/ { print $$0; next } \
/.*\/lib[^\/]+\.so\.[0-9]+\.[0-9]+\.[0-9]+$$/ { \
@@ -4398,7 +4379,7 @@ print-PLIST:
| ${SED} \
-e 's@${PREFIX}/./@@' \
-e '/^${PREFIX:S/\//\\\//g}\/.$$/d' \
- | ${SORT} -r | ${SED} ${COMMON_DIRS}` ; \
+ | ${SORT} -r | ${AWK} '${COMMON_DIRS}'` ; \
do \
if [ `${LS} -la ${PREFIX}/$$i | ${WC} -l` = 3 ]; then \
${ECHO} @exec \$${MKDIR} %D/$$i ; \
@@ -4406,8 +4387,8 @@ print-PLIST:
${ECHO} @dirrm $$i ; \
done \
| ( ${GREP} -v emul/linux/proc || ${TRUE} ) \
- | ${SED} \
- ${SUBST_PLIST_REPLACEMENT}
+ | ${SED} ${SUBST_PLIST_REPLACEMENT1} \
+ | ${SED} ${SUBST_PLIST_REPLACEMENT2}
.endif # target(print-PLIST)
# By default, all packages attempt to link into the views.
diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk
index 9fac7583ed8..d60a2a00afa 100644
--- a/mk/buildlink2/bsd.buildlink2.mk
+++ b/mk/buildlink2/bsd.buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink2.mk,v 1.90.4.5 2003/08/01 19:00:34 jlam Exp $
+# $NetBSD: bsd.buildlink2.mk,v 1.90.4.6 2003/08/14 07:37:06 jlam Exp $
#
# An example package buildlink2.mk file:
#
@@ -1079,7 +1079,6 @@ ${BUILDLINK_DIR}/${_prog_}: ${_GNU_MISSING}
. endfor
.endfor
-.if defined(USE_NEW_TEXINFO)
# install-info and makeinfo handling.
#
# Create an install-info script that is a "no operation" command
@@ -1103,7 +1102,7 @@ ${BUILDLINK_DIR}/bin/install-info:
CONFIGURE_ENV+= MAKEINFO="${BUILDLINK_DIR}/bin/makeinfo"
MAKE_ENV+= MAKEINFO="${BUILDLINK_DIR}/bin/makeinfo"
-. if empty(USE_MAKEINFO:M[nN][oO])
+.if empty(USE_MAKEINFO:M[nN][oO])
do-buildlink: makeinfo-wrapper
makeinfo-wrapper: ${BUILDLINK_DIR}/bin/makeinfo
${BUILDLINK_DIR}/bin/makeinfo:
@@ -1115,7 +1114,7 @@ ${BUILDLINK_DIR}/bin/makeinfo:
${_PKG_SILENT}${_PKG_DEBUG} \
${ECHO} 'exec ${MAKEINFO} "$$@"' >> ${.TARGET}
${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
-. else # !USE_MAKEINFO
+.else # !USE_MAKEINFO
do-buildlink: hide-makeinfo
hide-makeinfo: ${BUILDLINK_DIR}/bin/makeinfo
${BUILDLINK_DIR}/bin/makeinfo: ${_GNU_MISSING}
@@ -1127,5 +1126,4 @@ ${BUILDLINK_DIR}/bin/makeinfo: ${_GNU_MISSING}
${_PKG_SILENT}${_PKG_DEBUG} \
${ECHO} 'exit 1' >> ${.TARGET}
${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
-. endif # USE_MAKEINFO
-.endif # USE_NEW_TEXINFO
+.endif # USE_MAKEINFO
diff --git a/mk/bulk/bsd.bulk-pkg.mk b/mk/bulk/bsd.bulk-pkg.mk
index b5ade286a5d..c71314752bc 100644
--- a/mk/bulk/bsd.bulk-pkg.mk
+++ b/mk/bulk/bsd.bulk-pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.bulk-pkg.mk,v 1.45.2.1 2003/08/01 19:00:36 jlam Exp $
+# $NetBSD: bsd.bulk-pkg.mk,v 1.45.2.2 2003/08/14 07:37:07 jlam Exp $
#
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@netbsd.org>
@@ -161,7 +161,7 @@ bulk-check-uptodate:
if [ "$$uptodate" = "1" ]; then \
${SHCOMMENT} "Check required binary packages" ; \
deps=`${PKG_INFO} -qf ${REF} \
- | ${GREP} ^@pkgdep \
+ | ${GREP} '^@pkgdep' \
| ${SED} 's,@pkgdep.,,g'`; \
for dep in $$deps ; do \
${SHCOMMENT} "check against the binary pkg that pkg_add would pick, too:" ; \
@@ -195,7 +195,7 @@ bulk-package:
${ECHO_MSG} '###' ; \
${ECHO_MSG} '###' `date`: ; \
${ECHO_MSG} '### ${MAKE} ${.TARGET} for ${PKGNAME}' ; \
- ${ECHO_MSG} '### Current pkg count: ' `${LS} -l ${PKG_DBDIR} | ${GREP} ^d | ${WC} -l` installed packages: `${LS} ${PKG_DBDIR} | ${GREP} -v pkgdb.byfile.db`; \
+ ${ECHO_MSG} '### Current pkg count: ' `${LS} -l ${PKG_DBDIR} | ${GREP} '^d' | ${WC} -l` installed packages: `${LS} ${PKG_DBDIR} | ${GREP} -v pkgdb.byfile.db`; \
${ECHO_MSG} '###' ; \
fi \
) 2>&1 | tee -a ${BUILDLOG}
diff --git a/mk/bulk/mksandbox b/mk/bulk/mksandbox
index ca43e4a3a89..3b3f6524f76 100755
--- a/mk/bulk/mksandbox
+++ b/mk/bulk/mksandbox
@@ -1,6 +1,6 @@
#! /bin/sh
-# $NetBSD: mksandbox,v 1.20.4.1 2003/08/01 19:00:37 jlam Exp $
+# $NetBSD: mksandbox,v 1.20.4.2 2003/08/14 07:37:07 jlam Exp $
#
#
# Copyright (c) 2002 Alistair G. Crooks. All rights reserved.
@@ -45,7 +45,7 @@ src=/usr/src
kernel=""
sandboxMountDirs="/bin /sbin /lib /libexec /usr/X11R6 /usr/bin /usr/games /usr/include /usr/lib /usr/libdata /usr/libexec /usr/lkm /usr/share /usr/sbin /var/mail"
sandboxEmptyDirs="/var/run /var/log /var/spool/mqueue"
-sandboxEmptyFiles="/var/run/utmp /var/run/utmpx /var/log/wtmp /var/log/wtmpx"
+sandboxEmptyFiles="/var/run/utmp /var/run/utmpx /var/log/wtmp /var/log/wtmpx /var/log/lastlog /var/log/lastlogx"
opsys=`uname -s`
case "$opsys" in
diff --git a/mk/defs.NetBSD.mk b/mk/defs.NetBSD.mk
index 2f600292d40..83e9ea461cd 100644
--- a/mk/defs.NetBSD.mk
+++ b/mk/defs.NetBSD.mk
@@ -1,4 +1,4 @@
-# $NetBSD: defs.NetBSD.mk,v 1.49.2.2 2003/08/01 19:00:31 jlam Exp $
+# $NetBSD: defs.NetBSD.mk,v 1.49.2.3 2003/08/14 07:37:04 jlam Exp $
#
# Variable definitions for the NetBSD operating system.
@@ -125,6 +125,7 @@ _OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
_OPSYS_HAS_OSSAUDIO= yes # libossaudio is available
_OPSYS_PERL_REQD= # no base version of perl required
_OPSYS_RPATH_NAME= -R # name of symbol in rpath directive to linker
+_OPSYS_DEFAULT_PATH= /bin:/usr/bin:/sbin:/usr/sbin
_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
_PATCH_BACKUP_ARG= -V simple -b # switch to patch(1) for backup suffix
_PREFORMATTED_MAN_DIR= cat # directory where catman pages are
diff --git a/mk/texinfo.mk b/mk/texinfo.mk
index 768e22b8ee0..0871408ddfc 100644
--- a/mk/texinfo.mk
+++ b/mk/texinfo.mk
@@ -1,25 +1,12 @@
-# $NetBSD: texinfo.mk,v 1.14.2.1 2003/08/01 19:00:33 jlam Exp $
+# $NetBSD: texinfo.mk,v 1.14.2.2 2003/08/14 07:37:04 jlam Exp $
#
-# This Makefile fragment is included by bsd.pkg.mk when INFO_FILES and
-# USE_NEW_TEXINFO are defined.
-#
-# Or...
-#
-# This Makefile fragment is included by packages that provide info files
-# and do not _yet_ use the new framework.
+# This Makefile fragment is included by bsd.pkg.mk when INFO_FILES is
+# not empty or USE_MAKEINFO is not "no".
#
.if !defined(TEXINFO_MK)
TEXINFO_MK= # defined
-.include "../../mk/bsd.prefs.mk"
-
-#
-# This switch is here only until all packages are converted to use
-# the new framework.
-#
-.if defined(USE_NEW_TEXINFO)
-
.if !empty(INFO_FILES)
#
# Handle install-info.
@@ -150,91 +137,4 @@ MAKE_ENV+= MAKEINFO="${FALSE}"
. endif
.endif # USE_MAKEINFO
-##############################################################
-.else # !USE_NEW_TEXINFO
-# Obsolete handling below... Will go away ASAP.
-
-# Does the system have the GNU texinfo tools and if yes, what version are they?
-_INSTALL_INFO=
-.for _i_ in /usr/bin/install-info /sbin/install-info
-. if exists(${_i_})
-_INSTALL_INFO= ${_i_}
-. endif
-.endfor
-.if !empty(_INSTALL_INFO)
-. if !defined(INSTALL_INFO_VERSION)
-_INSTALL_INFO_VERSION_OUTPUT!= ${_INSTALL_INFO} --version 2>/dev/null || ${ECHO}
-# If the install-info version contains useful information outside [0-9].[0-9],
-# the following would have to be changed as well as the comparison below
-INSTALL_INFO_VERSION=${_INSTALL_INFO_VERSION_OUTPUT:M[0-9]*.[0-9]*:C/[^0-9.]//}
-MAKEFLAGS+= INSTALL_INFO_VERSION=${INSTALL_INFO_VERSION}
-. endif
-.endif
-
-# Minimum required version for the GNU texinfo tools.
-TEXINFO_REQD?= 3.12
-
-# Sort out if we need the version provided by devel/gtexinfo.
-.if defined(INSTALL_INFO_VERSION)
-. if ${INSTALL_INFO_VERSION} < ${TEXINFO_REQD}
-_NEED_TEXINFO= # defined
-. endif
-.else
-_NEED_TEXINFO= # defined
-.endif
-
-.if defined(_NEED_TEXINFO)
-DEPENDS+= gtexinfo>=${TEXINFO_REQD}:../../devel/gtexinfo
-_GTEXINFO_PREFIX_DEFAULT=${LOCALBASE}
-EVAL_PREFIX+= _GTEXINFO_PREFIX=gtexinfo
-INSTALL_INFO= ${_GTEXINFO_PREFIX}/bin/install-info
-MAKEINFO= ${_GTEXINFO_PREFIX}/bin/makeinfo
-.else
-INSTALL_INFO= ${_INSTALL_INFO}
-MAKEINFO= /usr/bin/makeinfo # we assume it!
-.endif
-
-#
-# Advertise in environment which install-info and makeinfo should be used.
-#
-CONFIGURE_ENV+= MAKEINFO="${MAKEINFO}" INSTALL_INFO="${INSTALL_INFO}"
-MAKE_ENV+= MAKEINFO="${MAKEINFO}" INSTALL_INFO="${INSTALL_INFO}"
-
-#
-# Another way would be to use ${SED} to substitute @MAKEINFO@, @INSTALL_INFO@
-# and bare makeinfo and install-info words in target rules commands and in
-# Makefiles variable assignments for the files matching ${TEXINFO_PATTERNS}.
-#
-# Note: there are embedded tabs in some variables below.
-#
-TEXINFO_OVERRIDE?= NO
-
-.if defined(TEXINFO_OVERRIDE) && (${TEXINFO_OVERRIDE} == "YES")
-TEXINFO_PATTERNS+= Makefile.in
-# replace @MAKEINFO@ and @INSTALL_INFO@ respectively with ${MAKEINFO} and
-# ${INSTALL_INFO}
-TEXINFO_VAR_SUBST+= MAKEINFO=${MAKEINFO:Q}
-TEXINFO_VAR_SUBST+= INSTALL_INFO=${INSTALL_INFO:Q}
-TEXINFO_SUBST_SED+= ${TEXINFO_VAR_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
-# replace bare makeinfo and install-info in MAKEINFO and INSTALL_INFO variables
-# assignments
-TEXINFO_SUBST_SED+= -e 's!^MAKEINFO[ ]*=[ ]*makeinfo[ ]*\(.*\)$$!MAKEINFO = ${MAKEINFO} \1!'
-TEXINFO_SUBST_SED+= -e 's!^INSTALL_INFO[ ]*=[ ]*install-info[ ]*\(.*\)$$!INSTALL_INFO = ${INSTALL_INFO} \1!'
-# replace bare makeinfo and install-info commands in Makefile target rules
-TEXINFO_SUBST_SED+= -e "s!^\( .*\)\([ ]\)makeinfo\([ ]\)!\1\2${MAKEINFO}\3!g"
-TEXINFO_SUBST_SED+= -e "s!^\( .*\)\([ '(]\)install-info\([ ]\)!\1\2${INSTALL_INFO}\3!g"
-
-_CONFIGURE_PREREQ+= texinfo-override
-texinfo-override:
- ${_PKG_SILENT}${_PKG_DEBUG} \
- (for _PATTERN in ${TEXINFO_PATTERNS}; do \
- ${FIND} ${WRKSRC} -type f -name "$$_PATTERN" -print; \
- done; ) | ( while read _F ; do \
- ${SED} ${TEXINFO_SUBST_SED} "$$_F" > "$$_F.new" && \
- ${MV} "$$_F.new" "$$_F"; \
- done )
-.endif # TEXINFO_OVERRIDE
-
-.endif # USE_NEW_TEXINFO
-
.endif # TEXINFO_MK
diff --git a/mk/tools.mk b/mk/tools.mk
new file mode 100644
index 00000000000..b82458ff1f6
--- /dev/null
+++ b/mk/tools.mk
@@ -0,0 +1,175 @@
+# $NetBSD: tools.mk,v 1.4.2.2 2003/08/14 07:37:05 jlam Exp $
+#
+# handle platforms with broken tools in the base system, such as sed
+# and awk.
+#
+# symlink the suitable versions of tools into .buildlink/bin (if they
+# exist in the base system) and allow packages to force the use of
+# pkgsrc GNU tools when they are not present in the base system by
+# defining e.g. USE_GNU_TOOLS+="awk sed". version numbers are not
+# considered.
+#
+# this functionality is buildlink2 only.
+#
+# packages should always use eg.
+#
+# USE_GNU_TOOLS+= grep
+#
+# to be sure not to override the setting passed by the user.
+#
+
+.if !defined(TOOLS_MK)
+TOOLS_MK= # defined
+
+.if empty(USE_BUILDLINK2:M[nN][oO])
+_TOOLS= awk grep sed
+
+# define which platforms already have GNU tools, so no need to pull in
+# the pkgsrc versions.
+_TOOLS_OPSYS_HAS_GNU.awk+= FreeBSD-*-* Linux-*-* NetBSD-*-* OpenBSD-*-*
+_TOOLS_OPSYS_HAS_GNU.grep+= Darwin-*-* FreeBSD-*-* Linux-*-*
+_TOOLS_OPSYS_HAS_GNU.grep+= NetBSD-*-* OpenBSD-*-*
+_TOOLS_OPSYS_HAS_GNU.sed+= Linux-*-*
+
+# where said tool is completely unusable, and no suitable replacement
+# is available.
+_TOOLS_OPSYS_INCOMPAT.awk+= # empty
+_TOOLS_OPSYS_INCOMPAT.grep+= # empty
+_TOOLS_OPSYS_INCOMPAT.sed+= # empty
+
+# a suitable alternative version is available in the base system, as
+# eg. ${AWK}, ${SED}, ... refer to defs.*.mk for the definitions.
+_TOOLS_REPLACE_OPSYS.awk+= SunOS-*-*
+_TOOLS_REPLACE_OPSYS.grep+= SunOS-*-*
+_TOOLS_REPLACE_OPSYS.sed+= # empty
+
+# what GNU tools did the package or user ask for, and does the OS
+# already have it?
+.for _tool_ in ${USE_GNU_TOOLS}
+_TOOLS_NEED_GNU.${_tool_}= YES
+. for _pattern_ in ${_TOOLS_OPSYS_HAS_GNU.${_tool_}}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_TOOLS_NEED_GNU.${_tool_}= NO
+. endif
+. endfor
+.endfor
+
+# default to not requiring GNU tools.
+.for _tool_ in ${_TOOLS}
+_TOOLS_NEED_GNU.${_tool_}?= NO
+_TOOLS_REPLACE.${_tool_}?= NO
+
+# do we know it's broken?
+. for _pattern_ in ${_TOOLS_OPSYS_INCOMPAT.${_tool_}}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_TOOLS_NEED_GNU.${_tool_}= YES
+. endif
+. endfor
+
+# are we replacing it with a better version?
+. for _pattern_ in ${_TOOLS_REPLACE_OPSYS.${_tool_}}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_TOOLS_REPLACE.${_tool_}= YES
+. endif
+. endfor
+
+.endfor # ${_TOOLS}
+
+.if ${_TOOLS_NEED_GNU.awk} == "YES" && empty(PKGPATH:Mlang/gawk)
+_TOOLS_PROGNAME.gawk= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}awk
+# catch the case where we are in between package installs, thus don't
+# have gawk available yet.
+. if exists(${_TOOLS_PROGNAME.gawk})
+AWK= ${_TOOLS_PROGNAME.gawk}
+. endif
+BUILDLINK_DEPENDS.gawk?= gawk>=3.1.1
+BUILDLINK_PKGSRCDIR.gawk?= ../../lang/gawk
+BUILDLINK_DEPMETHOD.gawk?= build
+BUILDLINK_PACKAGES+= gawk
+BUILDLINK_PREFIX.gawk_DEFAULT= ${LOCALBASE}
+BUILDLINK_FILES.gawk= bin/${GNU_PROGRAM_PREFIX}awk
+EVAL_PREFIX+= BUILDLINK_PREFIX.gawk=gawk
+.endif
+
+.if ${_TOOLS_NEED_GNU.awk} == "YES" || ${_TOOLS_REPLACE.awk} == "YES"
+BUILDLINK_TARGETS+= gawk-buildlink gawk-buildlink-bin
+.endif
+
+.if ${_TOOLS_NEED_GNU.grep} == "YES" && empty(PKGPATH:Mtextproc/grep)
+_TOOLS_PROGNAME.grep= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}grep
+. if exists(${_TOOLS_PROGNAME.grep})
+GREP= ${_TOOLS_PROGNAME.grep}
+. endif
+BUILDLINK_DEPENDS.grep?= grep>=2.5.1
+BUILDLINK_PKGSRCDIR.grep?= ../../textproc/grep
+BUILDLINK_DEPMETHOD.grep?= build
+BUILDLINK_PACKAGES+= grep
+BUILDLINK_PREFIX.grep= ${LOCALBASE}
+BUILDLINK_FILES.grep= bin/${GNU_PROGRAM_PREFIX}grep
+EVAL_PREFIX+= BUILDLINK_PREFIX.grep=grep
+.endif
+
+.if ${_TOOLS_NEED_GNU.grep} == "YES" || ${_TOOLS_REPLACE.grep} == "YES"
+BUILDLINK_TARGETS+= grep-buildlink grep-buildlink-bin
+.endif
+
+.if ${_TOOLS_NEED_GNU.sed} == "YES" && empty(PKGPATH:Mtextproc/gsed)
+_TOOLS_PROGNAME.gsed= ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}sed
+. if exists(${_TOOLS_PROGNAME.gsed})
+SED= ${_TOOLS_PROGNAME.gsed}
+. endif
+BUILDLINK_DEPENDS.gsed?= gsed>=3.0.2
+BUILDLINK_PKGSRCDIR.gsed?= ../../textproc/gsed
+BUILDLINK_DEPMETHOD.gsed?= build
+BUILDLINK_PACKAGES+= gsed
+BUILDLINK_PREFIX.gsed_DEFAULT= ${LOCALBASE}
+BUILDLINK_FILES.gsed= bin/${GNU_PROGRAM_PREFIX}sed
+EVAL_PREFIX+= BUILDLINK_PREFIX.gsed=gsed
+.endif
+
+.if ${_TOOLS_NEED_GNU.sed} == "YES" || ${_TOOLS_REPLACE.sed} == "YES"
+BUILDLINK_TARGETS+= gsed-buildlink gsed-buildlink-bin
+.endif
+
+gawk-buildlink: _BUILDLINK_USE
+gawk-buildlink-bin:
+.if ${_TOOLS_NEED_GNU.awk} == "YES" && empty(PKGPATH:Mlang/gawk)
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ [ ! -f ${BUILDLINK_DIR}/bin/awk ] && \
+ ${LN} -fs ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}awk \
+ ${BUILDLINK_DIR}/bin/awk
+.elif ${_TOOLS_REPLACE.awk} == "YES"
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ [ ! -f ${BUILDLINK_DIR}/bin/awk ] && \
+ ${LN} -fs ${AWK} ${BUILDLINK_DIR}/bin/awk
+.endif
+
+grep-buildlink: _BUILDLINK_USE
+grep-buildlink-bin:
+.if ${_TOOLS_NEED_GNU.grep} == "YES" && empty(PKGPATH:Mtextproc/grep)
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ [ ! -f ${BUILDLINK_DIR}/bin/grep ] && \
+ ${LN} -fs ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}grep \
+ ${BUILDLINK_DIR}/bin/grep
+.elif ${_TOOLS_REPLACE.grep} == "YES"
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ [ ! -f ${BUILDLINK_DIR}/bin/grep ] && \
+ ${LN} -fs ${GREP} ${BUILDLINK_DIR}/bin/grep
+.endif
+
+gsed-buildlink: _BUILDLINK_USE
+gsed-buildlink-bin:
+.if ${_TOOLS_NEED_GNU.sed} == "YES" && empty(PKGPATH:Mtextproc/gsed)
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ [ ! -f ${BUILDLINK_DIR}/bin/sed ] && \
+ ${LN} -fs ${LOCALBASE}/bin/${GNU_PROGRAM_PREFIX}sed \
+ ${BUILDLINK_DIR}/bin/sed
+.elif ${_TOOLS_REPLACE.sed} == "YES"
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ [ ! -f ${BUILDLINK_DIR}/bin/sed ] && \
+ ${LN} -fs ${SED} ${BUILDLINK_DIR}/bin/sed
+.endif
+
+.endif # USE_BUILDLINK2
+
+.endif # TOOLS_MK