diff options
authorNik Clayton <nik@FreeBSD.org>1999-08-28 09:50:49 +0000
committerNik Clayton <nik@FreeBSD.org>1999-08-28 09:50:49 +0000
commitde9128a9490b1668c59d442893d6b73e5ce8d391 (patch)
parentd1b17042d0920dc5785bcfb29217bec47809030b (diff)
Define new LANGCODE variable, which should contain the language name
and encoding for the documentation that's currently being built (e.g., 'en_US.ISO_8859-1', or 'es_ES.ISO_8859-1'). Used when building packages to create part of the package file name. Setting this involves an 'interesting' kludge -- suggestions for how better to achieve this within make(1) welcomed. package-*: No need to remove PLIST, it's always overwritten. Create empty COMMENT and DESCR files if they don't exist. Makes it easier to test this, without committing COMMENT and DESCR files all over the tree. Use the ${LANGCODE} variable in the package name. For example, the HTML pkg for the FAQ now looks like faq.en_US.ISO_8859-1.html.tgz, instead of just faq.html.tgz.
Notes: svn path=/head/; revision=5464
1 files changed, 24 insertions, 3 deletions
diff --git a/share/mk/docproj.docbook.mk b/share/mk/docproj.docbook.mk
index f6b0233303..bc064650cb 100644
--- a/share/mk/docproj.docbook.mk
+++ b/share/mk/docproj.docbook.mk
@@ -1,5 +1,5 @@
-# $Id: docproj.docbook.mk,v 1.10 1999-08-26 19:37:13 nik Exp $
+# $Id: docproj.docbook.mk,v 1.11 1999-08-28 09:50:49 nik Exp $
# This include file <docproj.docbook.mk> handles installing documentation
# from the FreeBSD Documentation Project.
KNOWN_FORMATS= html html-split html-split.tar txt rtf ps pdf tex dvi tar
# ------------------------------------------------------------------------
+# Work out the language and encoding used for this document. Normally,
+# this will be the directory name two levels up from us, but the user
+# might want to override this from the command line.
+# If the directory name is further up the tree, (say, three directories)
+# change the '.for' line to
+# .for _ in 1 2 3
+# I haven't had to use tricks like this since writing MS-DOS batch files.
+# Of course, you could just send ${.CURDIR} out through sed(1) or perl(1),
+# but this saves that overhead.
+.for _ in 1 2
+# ------------------------------------------------------------------------
# If DOC_PREFIX is not set then try and generate a sensible value for it.
# If they have used an unedited /usr/share/examples/cvsup/doc-supfile to
@@ -292,14 +312,15 @@ validate:
.for _curformat in ${KNOWN_FORMATS}
package-${_curformat}: install-${_curformat}
- rm PLIST
+ [ ! -e COMMENT ] || touch COMMENT
+ [ ! -e DESCR ] || touch DESCR
.if ${_cf} == "html-split"
cp HTML.manifest PLIST
echo ${DOC}.${_curformat} > PLIST
pkg_create -v -c COMMENT -d DESCR -f PLIST -p ${DESTDIR} \
- ${DOC}.${_curformat}.tgz
+ ${.CURDIR:T}.${LANGCODE}.${_curformat}.tgz