This eliminates one temporary directory in the process.
---
Makefile.am | 12 ++----------
autotools/docbook-wrapper | 7 ++++---
2 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index aa7f254..fd44560 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -287,19 +287,11 @@ doc/%.png: doc/%.dot
man/%.7.in man/%.8.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
@test -n "$(DOCBOOK2MAN)" || { echo 'docbook2man' not found during
configure; exit 1; }
- TMPDIR=`mktemp -d` && { \
- $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $$TMPDIR/$(patsubst
man/%.in,%,$@) ; \
- mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
- rm -rf "$$TMPDIR" ; \
- }
+ $(DOCBOOK_WRAPPER) "$(DOCBOOK2MAN)" $< $(notdir $(@:.in=)) $@
man/%.html.in: man/%.sgml man/footer.sgml $(DOCBOOK_WRAPPER)
@test -n "$(DOCBOOK2HTML)" || { echo 'docbook2html' not found during
configure; exit 1; }
- TMPDIR=`mktemp -d` && { \
- $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $$TMPDIR/$(patsubst
man/%.in,%,$@) ; \
- mv $$TMPDIR/$(patsubst man/%.in,%,$@) $@ ; \
- rm -rf "$$TMPDIR" ; \
- }
+ $(DOCBOOK_WRAPPER) "$(DOCBOOK2HTML) --nochunks" $< $(notdir $(@:.in=))
$@
man/%.7: man/%.7.in stamp-directories $(REPLACE_VARS_SED)
sed -f $(REPLACE_VARS_SED) < $< > $@
diff --git a/autotools/docbook-wrapper b/autotools/docbook-wrapper
index f525f16..681d9c1 100755
--- a/autotools/docbook-wrapper
+++ b/autotools/docbook-wrapper
@@ -2,7 +2,7 @@
set -e
-if test "$#" != 3
+if test "$#" != 4
then
echo "Wrong number of arguments." >&2
exit 1
@@ -10,7 +10,8 @@ fi
cmd="${1}"
input="${2}"
-output="${3}"
+cmdoutputfile="${3}"
+output="${4}"
# docbook2man inserts a date formatted using the current locale into its
# output. Using the "C" locale makes sure it's always in the default format.
@@ -26,7 +27,7 @@ then
exit 1
fi
-mv "${tmpdir}/`basename "${output}"`" "${output}"
+mv "${tmpdir}/${cmdoutputfile}" "${output}"
# Needed for make to recognize output file
touch "${output}"
--
1.6.3.4