Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: modify functions hierarchy (was: Install run-help and *.zwc files system wide in build system)



On Sun, 17 Nov 2013 13:01:18 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> I'm looking at, for example, Doc/Makefile.in "install.info" which
> creates a local directory named "infodir" where it builds tzsh.texi
> and then installs into the target location and removes infodir again
> when it's finished.  Why is generating helfiles from the pre-built
> manual pages different than this?

OK, is this good enough?

If it's roughly on lines no one objects to, I'll commit it and let
anyone else tie up the loose ends with other patches.  Otherwise, I'll
leave it to someone else to have yet a third go.

If anyone thinks there's anything else left to do (presumably just local
tweaks at this stage), please also supply a patch.

diff --git a/Config/defs.mk.in b/Config/defs.mk.in
index 58ef110..5c19cc4 100644
--- a/Config/defs.mk.in
+++ b/Config/defs.mk.in
@@ -51,6 +51,7 @@ sitefndir       = @sitefndir@
 scriptdir       = @scriptdir@
 sitescriptdir   = @sitescriptdir@
 htmldir         = @htmldir@
+runhelpdir      = @runhelpdir@
 
 # compilation
 CC              = @CC@
diff --git a/Config/installfns.sh b/Config/installfns.sh
index cf587c4..149f359 100755
--- a/Config/installfns.sh
+++ b/Config/installfns.sh
@@ -10,6 +10,8 @@ allfuncs="`grep ' functions=.' ${dir_top}/config.modules |
 
 allfuncs="`cd $sdir_top; echo ${allfuncs}`"
 
+test -d installfnsdir || mkdir installfnsdir
+
 # We now have a list of files, but we need to use `test -f' to check
 # (1) the glob got expanded (2) we are not looking at directories.
 for file in $allfuncs; do
@@ -44,8 +46,22 @@ for file in $allfuncs; do
         ;;
       esac
     fi
-    test -d $instdir || /bin/sh $sdir_top/mkinstalldirs $instdir || exit 1
-    $INSTALL_DATA $sdir_top/$file $instdir || exit 1
+    basename=`basename $file`
+    ok=0
+    if test -d $instdir || /bin/sh $sdir_top/mkinstalldirs $instdir; then
+      if sed "s|@runhelpdir@|$runhelpdir|" <$sdir_top/$file \
+        >installfnsdir/$basename; then
+	if $INSTALL_DATA installfnsdir/$basename $instdir; then
+	  ok=1
+	fi
+      fi
+    fi
+    case $ok in
+      0)
+      rm -rf installfnsdir
+      exit 1
+      ;;
+    esac
     read line < $sdir_top/$file
     case "$line" in
       '#!'*)
@@ -54,3 +70,5 @@ for file in $allfuncs; do
     esac
   fi
 done
+
+rm -rf installfnsdir
diff --git a/Doc/Makefile.in b/Doc/Makefile.in
index 5893cc8..eae3301 100644
--- a/Doc/Makefile.in
+++ b/Doc/Makefile.in
@@ -33,7 +33,6 @@ dir_top = ..
 VPATH           = @srcdir@
 sdir            = @srcdir@
 sdir_top        = @top_srcdir@
-runhelpdir      = @runhelpdir@
 INSTALL         = @INSTALL@
 LN_S            = @LN_S@
 
diff --git a/Functions/Misc/run-help b/Functions/Misc/run-help
index c817b67..e351dd6 100644
--- a/Functions/Misc/run-help
+++ b/Functions/Misc/run-help
@@ -10,7 +10,7 @@
 
 emulate -RL zsh
 
-local HELPDIR="${HELPDIR:-/usr/share/zsh/$ZSH_VERSION/help}"
+local HELPDIR="${HELPDIR:-@runhelpdir@}"
 
 [[ $1 == "." ]] && 1="dot"
 [[ $1 == ":" ]] && 1="colon"
diff --git a/Makefile.in b/Makefile.in
index d771033..cb74e94 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -88,7 +88,7 @@ install.fns:
 	  test x$(sitefndir) != xno && \
 	    $(SHELL) $(sdir_top)/mkinstalldirs $(DESTDIR)$(sitefndir); \
 	  sdir_top="$(sdir_top)" fndir="$(fndir)" dir_top="$(dir_top)" \
-	  scriptdir="$(scriptdir)" \
+	  scriptdir="$(scriptdir)" runhelpdir="$(runhelpdir)" \
 	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
 	  INSTALL_DATA="$(INSTALL_DATA)" \
 	  INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author