From ee685fdd2c00c837bfd86f7b9f0a4b4340068d38 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Thu, 26 Aug 1999 19:37:13 +0000 Subject: 1. Fix a subtle bug in the use of ${DOC}. If you ran make(1) and defined ${FORMATS} on the command line then it would assume that you wanted to build a document in the current directory, based on the setting of ${DOC}. If ${DOC} wasn't set, it defaulted to the name of the current directory. Any Makefile that includes this, and expects to have documentation built in the current directory must now explicitly define DOC. All the current ones do anyway. This should be a non-problem when docproj.docbook.mk is split out in to smaller, more modular files. Move the comments for DOC from the non-mandatory to the mandatory section. 2. Clarify the meaning of DESTDIR, it's changed a little bit since it was first documented. 3. Initial, tentative support for building pkg_* packages from the formatted documentation. Needs work, but I've had the patch out for review for a couple of days, and no comments either way -- so if people hate it, this should at least spur them on to say so. # cd /path/to/doc/to/turn/into/a/package # touch COMMENT DESCR # make 'FORMATS=this that and the other' package to build 'n' packages, one per format. "make install" is run as part of the package dependency, so this will overwrite documentation you have already got installed. 4. Remove DOC_INSTALL_PREFIX. Should have been DOCDIR from the start. --- share/mk/docproj.docbook.mk | 84 +++++++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/share/mk/docproj.docbook.mk b/share/mk/docproj.docbook.mk index 1bde7f3b14..f6b0233303 100644 --- a/share/mk/docproj.docbook.mk +++ b/share/mk/docproj.docbook.mk @@ -1,5 +1,5 @@ # -# $Id: docproj.docbook.mk,v 1.9 1999-08-19 00:07:09 nik Exp $ +# $Id: docproj.docbook.mk,v 1.10 1999-08-26 19:37:13 nik Exp $ # # This include file handles installing documentation # from the FreeBSD Documentation Project. @@ -18,27 +18,29 @@ # Valid values are in ${KNOWN_FORMATS} # # SRCS One or more files that comprise your documentation. - -# -# Optional variable definitions # -# DESTDIR Directory in which files will be installed. Defaults -# to /usr/local/share/doc/fdp/{articles,books}/, -# but can be overridden. +# DOC Controls several things +# +# 1. ${DOC}.sgml is assumed to be the name of the +# master source file (which will use entities +# to include any other .sgml files. # -# DOC Controls several things +# 2. ${DOC}. will be the name of the output +# files (${DOC}.html, ${DOC}.tex, ${DOC}.ps, and +# so on. Ignored for the "html-split" format, +# where the output file(s) start with index.html. # -# 1. ${DOC}.sgml is assumed to be the name of the -# master source file (which will use entities -# to include any other .sgml files. + # -# 2. ${DOC}. will be the name of the output -# files (${DOC}.html, ${DOC}.tex, ${DOC}.ps, and -# so on. Ignored for the "html-split" format, -# where the output file(s) start with index.html. +# Optional variable definitions # -# If not set, defaults to the name of the current -# directory. +# DESTDIR Directory in which files will be installed. Note +# that this works on a per-document basis. If you +# try and install two docs with the same DESTDIR they +# will most likely overwrite one another. If you +# want to install more than one document in to a new +# directory tree you probably want to set the DOCDIR +# variable. # # JADEFLAGS Additional options to pass to Jade. Typically # used to define "IGNORE" entities to "INCLUDE" @@ -59,9 +61,9 @@ # (such as share/sgml/catalog) are expected to # be under this path. Defaults to /usr/doc. # -# DOC_INSTALL_PREFIX The root prefix under which all docs are expected -# to install themselves. Defaults to -# /usr/local/share/doc/fdp +# DOCDIR The root prefix under which all docs are expected +# to install themselves. Defaults to +# /usr/share/doc # # EXTRA_CATALOGS Additional catalog files that should be used by # any SGML processing applications. @@ -75,10 +77,6 @@ .include "${.CURDIR}/../Makefile.inc" .endif -DOC?= ${.CURDIR:T} - -DOC_INSTALL_PREFIX?= /usr/local/share/doc/fdp - JADE= /usr/local/bin/jade DSLHTML= ${DOC_PREFIX}/share/sgml/freebsd.dsl DSLPRINT= ${DOC_PREFIX}/share/sgml/freebsd.dsl @@ -90,7 +88,7 @@ DSSSLCATALOG= /usr/local/share/sgml/docbook/dsssl/modular/catalog JADEOPTS= ${JADEFLAGS} -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG} ${EXTRA_CATALOGS:S/^/-c /g} -KNOWN_FORMATS= html html-split html-split.tar txt rtf ps pdf tex dvi tar doc +KNOWN_FORMATS= html html-split html-split.tar txt rtf ps pdf tex dvi tar # ------------------------------------------------------------------------ # If DOC_PREFIX is not set then try and generate a sensible value for it. @@ -153,6 +151,7 @@ DOC_PREFIX=/usr/doc # and INSTALL_COMPRESSED variables are wrong. # +.if defined(DOC) && !empty(DOC) .for _curformat in ${FORMATS} _cf=${_curformat} .if ${_cf} == "html-split" @@ -188,6 +187,7 @@ _docs+= ${DOC}.doc CLEANFILES+= ${DOC}.doc .endif .endfor +.endif # # Build a list of install-${format}.${compress_format} targets to be @@ -280,6 +280,36 @@ ${DOC}.tar: validate: nsgmls -s -c ${FREEBSDCATALOG} -c ${DOCBOOKCATALOG} ${EXTRA_CATALOGS:S/^/-c /g} ${DOC}.sgml +# ------------------------------------------------------------------------ +# +# Package building +# + +# +# Build a list of package targets for each output format. Each package +# target depends on the corresponding install target running. +# +.for _curformat in ${KNOWN_FORMATS} +_cf=${_curformat} +package-${_curformat}: install-${_curformat} + rm PLIST +.if ${_cf} == "html-split" + cp HTML.manifest PLIST +.else + echo ${DOC}.${_curformat} > PLIST +.endif + pkg_create -v -c COMMENT -d DESCR -f PLIST -p ${DESTDIR} \ + ${DOC}.${_curformat}.tgz +.endfor + +# +# Build one or more pkg_add(1)'able packages, based on all the current +# values of ${FORMATS}. Do this by listing all the appropriate +# package-* targets as dependencies. +# + +package: ${FORMATS:S/^/package-/} + # ------------------------------------------------------------------------ # # Compress targets @@ -348,12 +378,15 @@ install: beforeinstall realinstall afterinstall # Build a list of install-format targets to be installed. These will be # dependencies for the "realinstall" target. # +.if defined(DOC) && !empty(DOC) .if !defined(INSTALL_ONLY_COMPRESSED) || empty(INSTALL_ONLY_COMPRESSED) _curinst+= ${FORMATS:S/^/install-/g} .endif +.endif realinstall: ${_curinst} +.if defined(DOC) && !empty(DOC) .for _curformat in ${KNOWN_FORMATS} _cf=${_curformat} .if !target(install-${_cf}) @@ -396,6 +429,7 @@ install-${_cf}.${_compressext}: ${DOC}.${_cf}.${_compressext} .endif .endif .endfor +.endif .for __target in beforeinstall afterinstall depend _SUBDIR .if !target(${__target}) -- cgit v1.2.3