Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Install run-help and *.zwc files system wide in build system
Sorry, I attached the wrong patch. The correct one is here...
--- 1/Completion/Zsh/Command/_run-help
+++ 1/Completion/Zsh/Command/_run-help
@@ -0,0 +1,7 @@
+#compdef run-help
+local d expl
+local HELPDIR=${HELPDIR:-/usr/share/zsh/$ZSH_VERSION/help}
+[[ -d $HELPDIR ]] && {
+ d=($HELPDIR/*(:t))
+ (($#d)) && _wanted commands expl 'command' compadd -a d
+} || _man
--- 1/Doc/Makefile.in
+++ 1/Doc/Makefile.in
@@ -33,6 +33,7 @@
VPATH = @srcdir@
sdir = @srcdir@
sdir_top = @top_srcdir@
+runhelpdir = @runhelpdir@
INSTALL = @INSTALL@
@DEFS_MK@
@@ -82,7 +83,7 @@
# ========== DEPENDENCIES FOR BUILDING ==========
-all: man texi ../META-FAQ
+all: man runhelp texi ../META-FAQ
.PHONY: all
everything: all dvi html pdf info
@@ -183,6 +184,11 @@
man: $(MAN)
.PHONY: man
+runhelp: man
+ test x"$(runhelpdir)" = x"" || \
+ ${SHELL} $(sdir)/generate-help.sh $(sdir_top) $(sdir)/runhelp $(lc_ctype)
+.PHONY: runhelp
+
$(MAN): zmacros.yo zman.yo
zsh.1 zshall.1: Zsh/intro.yo Zsh/metafaq.yo Zsh/invoke.yo Zsh/files.yo \
@@ -285,12 +291,12 @@
# ========== DEPENDENCIES FOR INSTALLING ==========
-# install just installs the manual pages
-install: install.man
+# install just installs the manual and runhelp pages
+install: install.man install.runhelp
.PHONY: install
-# uninstall just unistalls the manual pages
-uninstall: uninstall.man
+# uninstall just uninstalls the manual and runhelp pages
+uninstall: uninstall.man uninstall.runhelp
.PHONY: uninstall
# install man pages, creating install directory if necessary
@@ -302,6 +308,17 @@
done
.PHONY: install.man
+# install runhelp pages, creating install directory if necessary
+install.runhelp: runhelp
+ if test x"$(runhelpdir)" != x""; then \
+ ${SHELL} $(sdir_top)/mkinstalldirs $(DESTDIR)$(runhelpdir); \
+ for file in $(sdir)/runhelp/*; do \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(runhelpdir); \
+ test -h $$file && cp -P $$file $(DESTDIR)$(runhelpdir) || :; \
+ done; \
+ fi
+.PHONY: install.runhelp
+
# install info pages, creating install directory if necessary
install.info: texi
${SHELL} $(sdir_top)/mkinstalldirs $(DESTDIR)$(infodir)
@@ -334,6 +349,11 @@
done
.PHONY: uninstall.man
+# uninstall runhelp pages
+uninstall.runhelp:
+ test x"$(runhelpdir)" = x"" || rm -rf -- $(DESTDIR)$(runhelpdir)
+.PHONY: uninstall.runhelp
+
# uninstall info pages
uninstall.info:
rm -f $(DESTDIR)$(infodir)/$(tzsh).info
--- 1/Doc/generate-help.sh
+++ 1/Doc/generate-help.sh
@@ -0,0 +1,83 @@
+#!/usr/bin/env sh
+
+Echo() {
+ printf '%s\n' "${*}"
+}
+
+[ ${#} -ge 2 ] && test -f "${1}/Doc/zshbuiltins.1" || { Echo \
+'Usage: generate-help.sh zsh-sources-directory destination-directory [LC_CTYPE]
+If you pass LC_CTYPE it must be utf8 aware.
+If you do not pass LC_CTYPE a heuristics is used to guess some for your system'
+ exit 1
+}
+
+case ${1} in
+/*) S=${1};;
+*) S=${PWD}/${1};;
+esac
+D=${2}
+
+Die() {
+ Echo "generate-help.sh: fatal: ${*}" >&2
+ exit 1
+}
+
+Info() {
+ Echo "generate-help.sh: ${*}"
+}
+
+test -d "${D}" || mkdir -- "${D}" || Die "failed to create ${D}"
+
+# We need GROFF_NO_SGR to produce "classical" formatting:
+export GROFF_NO_SGR=
+
+# This is self-explaining
+export MANWIDTH=80
+
+# In case the user has exported this, we restore the default:
+unset MANPL MANROFFSEQ
+
+# Now we must prepare locales:
+# Problem is LC_CTYPE since this must be utf8-aware for man to work properly.
+# Since there is no standard utf8-aware locale, we must use heuristics.
+unset LC_ALL LC_CTYPE
+export LANG=C
+if [ ${#} -eq 3 ]
+then LC_CTYPE=${3}
+else # Prefer en*utf8* (case ignored) over *utf8* over en*|*.* over rest
+ unset i j
+ for i in `locale -a 2>/dev/null`
+ do case ${i} in
+ en*[uU][tT][fF]8*)
+ LC_CTYPE=${i}
+ break;;
+ *[uU][tT][fF]8*)
+ [ -n "${LC_CTYPE}" ] || LC_CTYPE=${i};;
+ en*|*.*)
+ j=${i};;
+ esac
+ done
+ [ -n "${LC_CTYPE}" ] || [ -z "${j}" ] || LC_CTYPE=${j}
+fi
+if [ -z "${LC_CTYPE}" ]
+then Info "LC_CTYPE unset"
+else Info "LC_CTYPE=${LC_CTYPE}"
+ export LC_CTYPE
+fi
+
+Info "generating files into ${D}"
+
+# It is necessary to be paranoid about the success of the following pipe,
+# since any change in locale or environment can break it completely.
+# In the lack of pipestatus, we better use temporary files
+rm -f -- "${D}/tmp1" "${D}/tmp2"
+man "${S}/Doc/zshbuiltins.1" >"${D}/tmp1" || Die 'man zshbuiltins.1 failed'
+colcrt "${D}/tmp1" >"${D}/tmp2" || Die 'colcrt failed'
+( cd -- "${D}" >/dev/null 2>&1 || Die "cannot cd to ${D}"
+perl "${S}/Util/helpfiles" <tmp2 || Die 'perl Util/helpfiles failed' )
+rm -f -- "${D}/tmp1" "${D}/tmp2"
+
+# Finally, we make a sanity check:
+
+test -r "${D}/zmodload" || Die 'did not produce all required files'
+Info 'success'
--- 1/Makefile.in
+++ 1/Makefile.in
@@ -63,8 +63,8 @@
$(MAKE) install STRIPFLAGS="-s"
# install/uninstall most things
-install: install.bin install.modules install.fns install.man
-uninstall: uninstall.bin uninstall.modules uninstall.fns uninstall.man
+install: install.bin install.modules install.fns install.man install.runhelp
+uninstall: uninstall.bin uninstall.modules uninstall.fns uninstall.man uninstall.runhelp
# install/uninstall just the binary
install.bin uninstall.bin:
@@ -78,6 +78,10 @@
install.man uninstall.man:
@cd Doc && $(MAKE) $(MAKEDEFS) $@
+# install/uninstall just the runhelp files
+install.runhelp uninstall.runhelp:
+ @cd Doc && $(MAKE) $(MAKEDEFS) $@
+
# install/uninstall just the shell functions
install.fns:
if test x$(fndir) != x && test x$(fndir) != xno; then \
--- 1/StartupFiles/zshrc
+++ 1/StartupFiles/zshrc
@@ -75,7 +75,7 @@
# Some environment variables
export MAIL=/var/spool/mail/$USERNAME
export LESS=-cex3M
-export HELPDIR=/usr/local/lib/zsh/help # directory for run-help function to find docs
+export HELPDIR=/usr/share/zsh/$ZSH_VERSION/help # directory for run-help function to find docs
MAILCHECK=300
HISTSIZE=200
--- 1/configure.ac
+++ 1/configure.ac
@@ -216,11 +216,22 @@
AC_DEFINE_UNQUOTED(GLOBAL_ZLOGOUT, "$zlogout")
fi
+ifdef([runhelpdir],[undefine([runhelpdir])])dnl
+AC_ARG_ENABLE(runhelpdir,
+AC_HELP_STRING([--enable-runhelpdir=DIR], [the default directory for the run-help files]),
+[if test x"$enableval" = xno; then
+ runhelpdir=
+else
+ runhelpdir="$enableval"
+fi], [runhelpdir="/usr/share/zsh/$VERSION/help"])
+
+
AC_SUBST(zshenv)dnl
AC_SUBST(zshrc)dnl
AC_SUBST(zprofile)dnl
AC_SUBST(zlogin)dnl
AC_SUBST(zlogout)dnl
+AC_SUBST(runhelpdir)dnl
dnl Do you want dynamically loaded binary modules.
ifdef([dynamic],[undefine([dynamic])])dnl
Messages sorted by:
Reverse Date,
Date,
Thread,
Author