summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorseb <seb>2002-02-18 15:14:00 +0000
committerseb <seb>2002-02-18 15:14:00 +0000
commit3d0911b16019865b66bd0db4ae4768f4d13d0909 (patch)
treec84409a165bd501342b10b825394cf1eb3684d02 /mk
parent41d99a9521443bed0b4de1c8b7469d9717545251 (diff)
downloadpkgsrc-3d0911b16019865b66bd0db4ae4768f4d13d0909.tar.gz
Introduce new framework for handling info files generation and installation.
Summary of changes: - removal of USE_GTEXINFO - addition of mk/texinfo.mk - inclusion of this file in package Makefiles requiring it - `install-info' substituted by `${INSTALL_INFO}' in PLISTs - tuning of mk/bsd.pkg.mk: removal of USE_GTEXINFO INSTALL_INFO added to PLIST_SUBST `${INSTALL_INFO}' replace `install-info' in target rules print-PLIST target now generate `${INSTALL_INFO}' instead of `install-info' - a couple of new patch files added for a handful of packages - setting of the TEXINFO_OVERRIDE "switch" in packages Makefiles requiring it - devel/cssc marked requiring texinfo 4.0 - a couple of packages Makefiles were tuned with respect of INFO_FILES and makeinfo command usage See -newly added by this commit- section 10.24 of Packages.txt for further information.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk21
-rw-r--r--mk/texinfo.mk83
2 files changed, 90 insertions, 14 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 23f8fef56b9..3af82b73f14 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.927 2002/02/15 10:12:52 skrll Exp $
+# $NetBSD: bsd.pkg.mk,v 1.928 2002/02/18 15:14:34 seb Exp $
#
# This file is in the public domain.
#
@@ -213,18 +213,10 @@ MAKE_ENV+= F77="${F77}"
MAKE_ENV+= FC="${FC}"
.endif
-.if defined(INFO_FILES)
-USE_GTEXINFO= yes
-.endif
-
.if ((defined(NEED_NCURSES)) && (${NEED_NCURSES} == YES))
DEPENDS+= ncurses>=5.0:../../devel/ncurses
.endif
-.if defined(USE_GTEXINFO) && !exists(/usr/bin/install-info)
-DEPENDS+= gtexinfo>=3.12:../../devel/gtexinfo
-.endif
-
# Automatically increase process limit where necessary for building.
_ULIMIT_CMD=
.if defined(UNLIMIT_RESOURCES)
@@ -514,6 +506,7 @@ PLIST_SUBST+= OPSYS=${OPSYS} \
CHGRP=${CHGRP:Q} \
CHMOD=${CHMOD:Q} \
CHOWN=${CHOWN:Q} \
+ INSTALL_INFO=${INSTALL_INFO:Q} \
MKDIR=${MKDIR:Q} \
RMDIR=${RMDIR:Q} \
RM=${RM:Q} \
@@ -1950,9 +1943,9 @@ real-su-install: ${MESSAGE}
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} post-install
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} post-install-script
.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}
+ ${_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
@# PLIST must be generated at this late point (instead of
@# depending on it somewhere earlier), as the
@@ -3427,9 +3420,9 @@ print-PLIST:
} \
{ \
if (/\.info$$/) { \
- print "\@unexec install-info --delete --info-dir=%D/info %D/" $$0; \
+ print "\@unexec $${INSTALL_INFO} --delete --info-dir=%D/info %D/" $$0; \
print $$0; \
- print "\@exec install-info --info-dir=%D/info %D/" $$0; \
+ print "\@exec $${INSTALL_INFO} --info-dir=%D/info %D/" $$0; \
} else if (!/^info\/dir$$/) { \
print $$0; \
} \
diff --git a/mk/texinfo.mk b/mk/texinfo.mk
new file mode 100644
index 00000000000..d5a2b23ee62
--- /dev/null
+++ b/mk/texinfo.mk
@@ -0,0 +1,83 @@
+# $NetBSD: texinfo.mk,v 1.1 2002/02/18 15:14:35 seb Exp $
+#
+# This Makefile fragment is included by packages that provide info files.
+#
+
+.if !defined(TEXINFO_MK)
+TEXINFO_MK= # defined
+
+# Does the system have the GNU texinfo tools and if yes, what version are they?
+_INSTALL_INFO= /usr/bin/install-info
+.if exists(${_INSTALL_INFO})
+. if !defined(INSTALL_INFO_VERSION)
+_INSTALL_INFO_VERSION_OUTPUT!= ${_INSTALL_INFO} --version 2>/dev/null
+# if install-info departs from the [0-9].[0-9] numbering scheme, 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]*}
+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
+EVAL_PREFIX= _GTEXINFO_PREFIX=gtexinfo
+.else
+_GTEXINFO_PREFIX= ${_INSTALL_INFO:C|/bin/install-info$||}
+.endif
+
+#
+# Advertise in environment which install-info and makeinfo should be used.
+#
+INSTALL_INFO= ${_GTEXINFO_PREFIX}/bin/install-info
+MAKEINFO= ${_GTEXINFO_PREFIX}/bin/makeinfo
+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 embeded 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 # TEXINFO_MK