commit 8a73911ed82454de0c77c2479eb865c4dee8b3d2
Author: Ximin Luo <[email protected]>
Date:   Mon May 19 14:50:50 2014 +0100

    fix out-of-source builds and `make distcheck`
---
 facilitator/Makefile.am |    6 ++++--
 mkman.sh                |    9 +++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/facilitator/Makefile.am b/facilitator/Makefile.am
index e16ea37..c4d8617 100644
--- a/facilitator/Makefile.am
+++ b/facilitator/Makefile.am
@@ -46,12 +46,14 @@ subst_vars = sed -e 's,[@]cgibindir[@],$(cgibindir),g'
 # our own targets
 
 doc/%.1: % mkman.sh mkman.inc Makefile
+# mkdir needed for out-of-source build
+       $(MKDIR_P) $$(dirname "$@")
        { $(PYENV) $(PYTHON) "$<" --help; } \
-         | { $(PYENV) ./mkman.sh "$<" $(VERSION) > "$@"; }
+         | { $(PYENV) $(srcdir)/mkman.sh "$<" $(VERSION) > "$@"; }
 
 examples/fp-facilitator.conf: examples/fp-facilitator.conf.in Makefile
 # mkdir needed for out-of-source build
-       mkdir -p $$(dirname "$@")
+       $(MKDIR_P) $$(dirname "$@")
        $(subst_vars) "$<" > "$@"
 
 pylint: $(dist_bin_SCRIPTS)
diff --git a/mkman.sh b/mkman.sh
index cd4ecff..2532194 100755
--- a/mkman.sh
+++ b/mkman.sh
@@ -43,6 +43,7 @@ fi
 prog="$1"
 ver="$2"
 name="${3:-$(get_description "$1")}"
+progname="$(basename "$prog")"
 
 # Prepare a temporary executable file that just dumps its own contents.
 trap 'rm -rf .tmp.$$' EXIT INT TERM
@@ -51,11 +52,11 @@ mkdir -p ".tmp.$$"
 {
 echo "$shebang"
 cat
-} > ".tmp.$$/$prog"
-test $(size ".tmp.$$/$prog") -gt $((${#shebang} + 1)) || { echo >&2 "no input 
received; abort"; exit 1; }
-chmod +x ".tmp.$$/$prog"
+} > ".tmp.$$/$progname"
+test $(size ".tmp.$$/$progname") -gt $((${#shebang} + 1)) || { echo >&2 "no 
input received; abort"; exit 1; }
+chmod +x ".tmp.$$/$progname"
 
-help2man ".tmp.$$/$prog" --help-option="-q" \
+help2man ".tmp.$$/$progname" --help-option="-q" \
   --name="$name" --version-string="$ver" \
   --no-info --include "$(dirname "$0")/mkman.inc" \
   | help2man_fixup

_______________________________________________
tor-commits mailing list
[email protected]
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits

Reply via email to