--- global-5.7.1.orig/globash.rc +++ global-5.7.1/globash.rc @@ -28,8 +28,9 @@ # # [/usr/src/sys] ghelp # + bash_minorversion=$(echo ${BASH_VERSINFO[1]} | sed 's/[^0-9]//') -if !(( BASH_VERSINFO[0] > 2 || BASH_VERSINFO[0] == 2 && 10#${bash_minorversion} >= 4 )); then +if ! (( BASH_VERSINFO[0] > 2 || BASH_VERSINFO[0] == 2 && 10#${bash_minorversion} >= 4 )); then echo "GLOBASH ERROR: GloBash needs Bash version 2.04 or later." exit 1 fi --- global-5.7.1.orig/globash.1 +++ global-5.7.1/globash.1 @@ -0,0 +1,33 @@ +.TH GLOBASH 1 "6 August 2005" "Debian GNU/Linux" "GLOBAL Utilities" +.\" Copyright (c) 2005 Ron Lee. All rights reserved. +.\" This text may be distributed under the same terms as the GLOBAL source. +.\" All copies of this manual must acknowledge the author and include the +.\" above copyright statement. +.\" +.SH NAME +globash \- invoke a GLOBAL shell environment. +.SH SYNOPSIS +.B globash +.SH "DESCRIPTION" +.B globash +is a \fBbash\fP shell enviroment that provides easy access to \fBGLOBAL\fP +data about a project. More information about its use is available in the +\fIglobal.info\fP documentation, and from \fBglobash\fP itself at any time +with the \fBghelp\fP command that is available from inside it. +.SH OPTIONS +There are no options. Or blue pills. +Just a simple shortcut to a bigger shell game. +.SH FILES +.I /etc/globash.rc +\- where all the real machinery lives. +.SH BUGS +As a wrapper \fBglobash\fP gets to inherit bugs from other software too. +But its hardly big enough to have many on its own. +.SH "SEE ALSO" +.BR gtags (1), " global" (1), " htmake" (1), " htags" (1), +.br +and the \fBglobal\fP info documentation. +.SH AUTHOR +Ron Lee , wrote this manpage, added the \fBglobash\fP wrapper, +and made a few minor tweaks to the \fIglobash.rc\fP file which does all the +real work and was written by Shigio Yamaguchi. --- global-5.7.1.orig/globash +++ global-5.7.1/globash @@ -0,0 +1,3 @@ +#! /bin/sh +exec bash --rcfile /etc/globash.rc + --- global-5.7.1.orig/gtags-parser/gtags-parser.1 +++ global-5.7.1/gtags-parser/gtags-parser.1 @@ -71,7 +71,7 @@ \fB--langmap\fP=map Language mapping. Each comma-separated map consists of the language name, a colon, and a list of file extensions. -Default mapping is 'c:.c.h,yacc:.y,asm:.s.S,java:.java,cpp:.c++.cc.cpp.cxx.hxx.hpp.C.H,php:.php.php3.phtml'. +Default mapping is 'c:.c.h,\:yacc:.y,\:asm:.s.S,\:java:.java,\:cpp:.c++.cc.cpp.cxx.hxx.hpp.C.H,\:php:.php.php3.phtml'. .PP The \fB-r\fP and \fB-s\fP options override each other; the last one specified determines the method used. --- global-5.7.1.orig/debian/rules +++ global-5.7.1/debian/rules @@ -0,0 +1,83 @@ +#!/usr/bin/make -f +# debian/rules file by Ron Lee . +# originally set up by debmake, later converted to use Joey Hess' +# debhelper scripts + +package=global + + +build: build-stamp + +build-stamp: + dh_testdir + ./configure --prefix=/usr \ + && $(MAKE) + touch $@ + +clean: + dh_testdir + dh_testroot + -rm -f build-stamp + + # Ensure the auto-update stuff does not trigger if the + # timestamps are skewed (by cvs etc.) + touch Makefile.am \ + Makefile.in \ + acinclude.m4 \ + aclocal.m4 \ + configure.ac \ + config-h.in \ + configure + + # Don't touch this unconditionally, the mips and mipsel + # buildd at least seem to crap out trying to chmod it later. + if test -e config.status; then touch config.status; fi + + -$(MAKE) distclean + dh_clean + +install: + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) install-exec prefix=`pwd`/debian/$(package)/usr + $(MAKE) -C htags install-gtagsDATA prefix=$(CURDIR)/debian/$(package)/usr + set -e; cd htmake \ + && $(MAKE) install \ + DESTDIR=`pwd`/../debian/$(package)/usr \ + MANDIR=`pwd`/../debian/$(package)/usr/share/man + cp -p gtags.el `pwd`/debian/$(package)/usr/share/emacs/site-lisp/$(package) + + dh_install globash.rc etc + dh_install globash usr/bin + dh_lintian + + +binary-indep: build install +# no architecture-independent files generated by this package. + +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installman + dh_installinfo + dh_installchangelogs ChangeLog + dh_installemacsen + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch + + +.PHONY: build clean install binary-indep binary-arch binary + --- global-5.7.1.orig/debian/control +++ global-5.7.1/debian/control @@ -0,0 +1,34 @@ +Source: global +Section: devel +Priority: optional +Build-Depends: debhelper (>=6.0.7), texinfo +Maintainer: Ron Lee +Standards-Version: 3.8.0.1 + +Package: global +Architecture: any +Depends: ${shlibs:Depends} +Suggests: lynx | www-browser, doxygen (>=1.4.3), apache | httpd, id-utils +Description: Source code search and browse tools + GNU GLOBAL is a source code tag system that works the same way across + diverse environments. Currently, it supports the following: + . + o command line, and the 'globash' query subshell. + o vim plugin, and support for other vi clones. + o less + o emacs + o web browser + . + Supported languages are C, C++, yacc and Java. + You can locate a specified function in the source files and move + there easily. It is especially useful for hacking large projects + containing many subdirectories, many '#ifdef' and many main() + functions, like X or kernel source. + . + This package include the htmake(1) extension which allows GLOBAL's + hypertext search function to be implemented from a single central + cgi script. + . + Doxygen now supports using global as its source browser, with the + USE_HTAGS option. + --- global-5.7.1.orig/debian/compat +++ global-5.7.1/debian/compat @@ -0,0 +1 @@ +6 --- global-5.7.1.orig/debian/global.emacsen-startup +++ global-5.7.1/debian/global.emacsen-startup @@ -0,0 +1,12 @@ +;;========================================================================== +;; The next hack is needed for brain-dead Emacs19, which does not add +;; directories recursively to load-path +(if (string-match "^19." emacs-version) + (setq load-path (nconc load-path + (list (concat "/usr/share/" + (symbol-name debian-emacs-flavor) + "/site-lisp/global"))))) +(autoload 'gtags-mode "gtags" + "Minor mode for browsing source code using GLOBAL" t) +;;========================================================================== + --- global-5.7.1.orig/debian/changelog +++ global-5.7.1/debian/changelog @@ -0,0 +1,169 @@ +global (5.7.1-1) unstable; urgency=low + + * New upstream release. Closes: #491713 + * Install the new template files needed for dynamic page generation. + Closes: #466673 + * Tidy punctuation in the description. Closes: #444834 + + -- Ron Lee Thu, 24 Jul 2008 20:19:41 +0930 + +global (5.6.1-1) unstable; urgency=low + + * New upstream release. Closes: #378514, #387592, #430604 + * Add the prefix GNU in the package description. It was actually BSD global + when that description was first written, but if it makes it just a little + less ambiguous to search for, then why not. Closes: #385303 + + -- Ron Lee Fri, 21 Sep 2007 08:58:45 +0930 + +global (4.8.6-2) unstable; urgency=low + + * Don't touch config.status unconditionally, some of the buildd's + seem to choke on that. + + -- Ron Lee Sat, 6 Aug 2005 05:38:39 +0930 + +global (4.8.6-1) unstable; urgency=low + + * New upstream release. Closes: #262250, #318848 + * Update to policy 2.6.2.1 and DH_COMPAT 4. + * global.info is now monolithic, drop the * again. + * gctags is dead, replaced by gtags-parser, and htags has been + reimplemented in C. Performance gains are alleged. + Tentatively Closes: #159901, get back to me if pain persists. + * Suggest doxygen (>=1.4.3) as it can now use global as its + source browser. + * Include vim plugin and other goodies with examples. + * Don't build 'gnusort', use the system one. + * Add zero space breaks '\:' to long lines in the man pages. + * Fixes problem with --style-sheet option. The original + reporter's example will not actually work as he might have + anticipated, but this clearly still Closes: #182187 + which I could reproduce in 4.5-1. + * Install globash.rc in /etc with a couple of minor tweaks, + and a wrapper to call it in /usr/bin, with simple man page. + Noted in info docs. + + -- Ron Lee Thu, 4 Aug 2005 18:08:14 +0930 + +global (4.5-1.1) unstable; urgency=high + + * NMU + * Bump debhelper build-dep to >=3, change DH_COMPAT to 3, change + debian/global.info to 'doc/global.info*', and build-dep on texinfo. + really closes: #136357. + + -- Clint Adams Sat, 26 Oct 2002 14:19:35 -0400 + +global (4.5-1) unstable; urgency=low + + * New upstream release. + * Closes: #136357 (Fixed upstream and/or unreproducable) + + -- Ron Lee Mon, 15 Jul 2002 19:23:11 -0700 + +global (4.4-1) unstable; urgency=high + + * Security fix for html form exploit. + + -- Ron Lee Sat, 30 Mar 2002 21:55:27 -0800 + +global (4.1.1-1) unstable; urgency=low + + * New upstream release. + * Lots of bugfixes (possibly not all of these, but I'm sure + Yann will reopen them if any still do exist :) + Closes: #51837, #58210, #58238, #77198, #78509, #58233 + Closes: #58234, #58307, #76629, #77207, #77892, #78515 + * Fix info heading. Closes: #76988 + * Fixed emacsen support files install. Closes: #90429 + + -- Ron Lee Thu, 11 Oct 2001 07:28:10 -0700 + +global (4.0.1-2) unstable; urgency=medium + + * actually install gtags.el in the correct place this time, + and fixed *lots* of bugs inherited from the examples in + debian-emacs-policy which I stupidly trusted to be basically + sound - Closes: #74036 + + -- Ron Lee Thu, 5 Oct 2000 22:18:52 +0930 + +global (4.0.1-1) unstable; urgency=low + + * New upstream version. + * change of licence, GLOBAL 4.x is now GPL :-) + * repackaged with dh_*, updated for current policy. + * install gtags.el in line with debian-emacs-policy - Closes: #56122 + + -- Ron Lee Fri, 29 Sep 2000 03:17:41 +0930 + +global (3.55-1) unstable; urgency=medium + + * New upstream version. + * fixes bug in htags which could inadvertantly remove user files + if an error occurs. + + -- Ron C. Lee Thu, 23 Dec 1999 23:27:55 +1030 + +global (3.54-1) unstable; urgency=low + + * New upstream version. + * Many new features/fixes, including C++ support. + * Updated for standards version 3 and FHS compliance. + + -- Ron C. Lee Sat, 13 Nov 1999 08:18:22 +1030 + +global (3.44-2) unstable; urgency=low + + * /usr/lib/cgi-bin is now included in the package, + postinst no longer fails if httpd is not installed. Closes #38386 + * postrm split so that files in /usr/lib/cgi-bin are now removed + in prerm allowing dir to be correctly removed if empty. + * applied patch to enable build for powerpc arch, + Thumbs up to Konstantinos Margaritis.. Closes #37848 + + -- Ron C. Lee Sun, 18 Apr 1999 15:09:44 +0930 + +global (3.44-1) unstable; urgency=low + + * Initial release. My first package too! + * there's beer in that somewhere ;-) + * htmake released for use with the debian package. + - this is not incorporated upstream yet. + + -- Ron C. Lee Sat, 3 Apr 1999 22:47:43 +0930 + +global (3.44-0.8) unstable; urgency=low + + * new upstrem release. + * libdb1.85 is now statically linked - ./lib is gone so is ./dbpatches + in it's place we have ./libdb and ./libutil + * upstream change - gtags --config now searches /etc/gtags/global.conf + too. Thanks Shigio ;-) + * bugfix ACTION=hidden, superfluous lines removed from htags.pl + * upstream bugfix in global.cgi regex. + * htmake is now in beta test. + * postinst and postrm scripts added + + -- Ron C. Lee Sun, 21 Mar 1999 05:12:30 +1030 + +global (3.43-0.9.2) unstable; urgency=low + + * Initial package. + * Upstream Makefile.generic patched to debianise + ( to be incorporated by upstream author ) + * Bugfix - include libdb in gozilla/Imakefile for generic build + * systags manpage contributed by Sergio Talens-Oliag + ( systags/Makefile.generic patched to include it ) + * htags patched to include -C option to create html.gz files in place + of .ghtml ( as made with -c ) -- Debian handles these much cleaner. + systags.sh and manual pages also updated to handle -C option. + * patched gozilla - it now works with html.gz and .ghtml files too. + * htags tidied to clean perl warnings and undefs in global.cgi + + -- Ron C. Lee Sat, 13 Feb 1999 03:18:28 +1030 + +Local variables: +mode: debian-changelog +End: --- global-5.7.1.orig/debian/global.manpages +++ global-5.7.1/debian/global.manpages @@ -0,0 +1,8 @@ +global/global.1 +gozilla/gozilla.1 +gtags-parser/gtags-parser.1 +gtags/gtags.1 +htags/htags.1 +htmake/htmake.1 +htmake/htconfig.1 +globash.1 --- global-5.7.1.orig/debian/global.emacsen-install +++ global-5.7.1/debian/global.emacsen-install @@ -0,0 +1,29 @@ +#!/bin/sh -e + +FLAVOR=$1 +PACKAGE=global +el_files=gtags.el + +byte_compile_options="-batch -f batch-byte-compile" +el_dir="/usr/share/emacs/site-lisp/${PACKAGE}/" +elc_dir="/usr/share/${FLAVOR}/site-lisp/${PACKAGE}/" +el_path_list=`echo ${el_files} | perl -pe "s|^|${el_dir}|o"` +elc_path_list=`echo ${el_files} | perl -pe "s|^|${elc_dir}|o"` + +if [ ${FLAVOR} != emacs ] +then + echo install/${PACKAGE}: byte-compiling for ${FLAVOR} + + # Copy the temp .el files + install -m 755 -d ${elc_dir} + cp ${el_path_list} ${elc_dir} + + # Byte compile them + ${FLAVOR} ${byte_compile_options} ${elc_path_list} + + # remove the redundant .el files + # presumes that any .el files in the dir are trash. + rm ${elc_dir}/*.el +fi +exit 0; + --- global-5.7.1.orig/debian/global.postrm +++ global-5.7.1/debian/global.postrm @@ -0,0 +1,10 @@ +#! /bin/sh +set -e +if [ "$1" = "purge" ]; +then + rm -rf /etc/gtags + rm -rf /var/lib/gsearch +fi + +#DEBHELPER# + --- global-5.7.1.orig/debian/global.postinst +++ global-5.7.1/debian/global.postinst @@ -0,0 +1,10 @@ +#! /bin/sh +set -e +if [ "$1" = "configure" ]; +then + HOST=`hostname --fqdn` + htconfig -I -a http://${HOST}/cgi-bin/gsearch.cgi -p /var/lib/gsearch/pathdata /usr/lib/cgi-bin +fi + +#DEBHELPER# + --- global-5.7.1.orig/debian/global.dirs +++ global-5.7.1/debian/global.dirs @@ -0,0 +1,5 @@ +usr/bin +usr/lib/cgi-bin +usr/share/man/man1 +usr/share/emacs/site-lisp/global + --- global-5.7.1.orig/debian/copyright +++ global-5.7.1/debian/copyright @@ -0,0 +1,14 @@ +This package was debianized by Ron Lee +on Sat, 13 Feb 1999 03:18:28 +1030. + +It is available from http://www.tamacom.com/global + +All files in this package are now distributed under the terms of the GNU GPL. +A copy may be found in /usr/share/common-licenses on Debian systems. + + Copyright holder of GNU GLOBAL + ============================== + + Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006, 2007, 2008 Tama Communications Corporation. All rights reserved. + --- global-5.7.1.orig/debian/global.emacsen-remove +++ global-5.7.1/debian/global.emacsen-remove @@ -0,0 +1,14 @@ +#!/bin/sh -e + +FLAVOR=$1 +PACKAGE=global + +echo remove/${PACKAGE}: Handling removal of emacsen flavor ${FLAVOR} + +if [ ${FLAVOR} != emacs ] +then + echo emacsen-common: purging byte-compiled files for ${FLAVOR} + rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} +fi +exit 0; + --- global-5.7.1.orig/debian/global.lintian-overrides +++ global-5.7.1/debian/global.lintian-overrides @@ -0,0 +1,4 @@ +global: package-contains-empty-directory +global: script-not-executable ./usr/share/gtags/bless.sh.tmpl +global: script-not-executable ./usr/share/gtags/ghtml.cgi.tmpl +global: script-not-executable ./usr/share/gtags/global.cgi.tmpl --- global-5.7.1.orig/debian/global.prerm +++ global-5.7.1/debian/global.prerm @@ -0,0 +1,10 @@ +#! /bin/sh +set -e +if [ "$1" = "remove" ]; +then + rm -f /usr/lib/cgi-bin/gsearch.cgi + rm -f /usr/lib/cgi-bin/ghtml.cgi +fi + +#DEBHELPER# + --- global-5.7.1.orig/debian/README.debian +++ global-5.7.1/debian/README.debian @@ -0,0 +1,55 @@ + + GLOBAL for Debian + ----------------- + +See /usr/share/doc/global/README.gz and README.htmake.gz or the +global.info and relevant man pages for general usage details. + +The Debian version of GLOBAL has been configured to use a +centralised cgi search mechanism which I developed for it. +If you want to generate searchable html source but don't +like to have .htaccess files or cgi execution enabled all +over the place, then consider using 'htmake' in place of +'htags' to generate your hypertext source. See the htmake +manual page for details. + +I've also added a -C option for htags which produces gzipped +html files with a suffix of html.gz -- This makes use of the +ghtml.cgi file unnecessary for Debian systems, as they should +decompress html.gz files transparently. + +(UPDATE: FreeBSD (the upstream authors platform) does not +presently deal with html.gz files the same way that Debian +does, hence htags -c option creates .ghtml files by default. +The -C option has been added as a convenience for Debian +users, but this facility may be implemented differently +in the future. An alternate option for Debian users is +to specify html.gz as the default suffix in a global.conf +file which will override the suffix created with -c, but +be aware that this may raise platform dependency issues +in cross platform environments. We hope this issue will +be cleanly resolved in the future.) + +UPDATE-UPDATE: This issue is confused a little more, since +mozilla no longer does a sane thing by default with html.gz +(though lynx still does), while Debian apache will happily +decompress both html.gz and .ghtml on the fly, so either +way you do not need a helper cgi there. The -C option +still supresses its generation, while -c does not. + +In the ./examples directory you should find: + + - The gtags.vim plugin. + - Patches and a helper script for nvi. + - An example of the optional gtags.conf file. + +The globash.rc is now installed in /etc and may be invoked +via the globash(1) wrapper. + +Enjoy! + + Ron + + +Sat, 13 Feb 1999 03:18:28 +1030 + --- global-5.7.1.orig/debian/global.examples +++ global-5.7.1/debian/global.examples @@ -0,0 +1,4 @@ +gtags.conf +gtags.pl +gtags.vim + --- global-5.7.1.orig/debian/global.info +++ global-5.7.1/debian/global.info @@ -0,0 +1,2 @@ +doc/global.info + --- global-5.7.1.orig/debian/global.docs +++ global-5.7.1/debian/global.docs @@ -0,0 +1,4 @@ +README +FAQ +htmake/README.htmake + --- global-5.7.1.orig/htmake/COPYING +++ global-5.7.1/htmake/COPYING @@ -0,0 +1,8 @@ +htmake(1) and htconfig(1): + + Copyright (c) 1999, 2000 Ron Lee. + All rights reserved. + +These files may be distributed under the terms of the GNU GPL version 2 or later. + + --- global-5.7.1.orig/htmake/Makefile +++ global-5.7.1/htmake/Makefile @@ -0,0 +1,16 @@ +PROG = htconfig htmake + +DESTDIR = /usr +BINDIR = $(DESTDIR)/bin +MANDIR = $(DESTDIR)/man + +all: +install: + @for file in $(PROG); do\ + cp $$file.pl $(BINDIR)/$$file;\ + chmod 755 $(BINDIR)/$$file;\ + cp $$file.1 $(MANDIR)/man1;\ + chmod 644 $(MANDIR)/man1/$$file.1;\ + done +clean: + --- global-5.7.1.orig/htmake/htconfig.pl +++ global-5.7.1/htmake/htconfig.pl @@ -0,0 +1,381 @@ +#!/usr/bin/perl +# +# Copyright (c) 1999, 2000 +# Ron Lee All rights reserved. +# +# You may distribute this software under the terms of the GNU GPL version 2 +# or later. +# +# It is adapted from, and intended for use with, Shigio Yamaguchi's +# GLOBAL source code tagging and html generation suite. +# +# htconfig.pl 13-Mar-99 +# +# This program is for manipulating the database read by gsearch.cgi, +# an extended version of the global.cgi script. It allows for a +# single central script to search multiple hypertext source trees on +# your system. +# +# usage: +# htconfig -I [-z] [-a form-action] [-p pathdb] cgidir +# htconfig --install [--makeghtml] [--formaction=cgi] [--pathdb=pathsfile] cgidir +# +# htconfig -u base-url -d gtagsdbpath -s gtagsroot [dir] +# htconfig --url=base-url --tags=gtagsdbpath --src=gtagsroot [dir] +# +# defaults: ( all are expanded to absolute paths ) +# -u file:/dir +# -d, -s ./ +# [dir] ./HTML +# +# operation: +# htconfig -I installs the cgi scripts and configuration +# file. This file must contain the location of the database +# used to store path data created by htconfig and read by +# gsearch.cgi - the -p option can set this at creation time. +# -z installs ghtml.cgi as well as global.cgi. +# +# otherwise htconfig appends an entry to the database file +# based on the paths supplied. +# +# extra flags: -v --verbose +# +$com = $0; +$com =~ s/.*\///; +$usage = "usage: $com -I [-v][-z][-a form-action][-p pathdb] cgi-dir\n"; +$usage .= " $com --install [--makeghtml][--formaction=cgi-url][--pathdb=pathdatafile] cgi-dir\n\n"; +$usage .= " $com [-v][-u base-url][-d gtagsdbpath][-s gtagsroot][htmldir]\n"; +$usage .= " $com [--verbose][--url=base-url][--tags=gtagsdbpath][--src=gtagsroot][htmldir]\n"; +#----------------------------------------------------------------- +# DEFAULTS +#----------------------------------------------------------------- + +$CONFDIR = '/etc/gtags'; +$CONFIG = $CONFDIR .'/htmake.conf'; +chop($GHTML = `gtags --config gzipped_suffix`) if &usable('gtags'); +$GHTML = $GHTML || 'ghtml'; +$actiondir = $tags = $src = '.'; + +#---------------------------------------------------------------- +# UTILITIES +#---------------------------------------------------------------- + +sub getcwd { + local($dir) = `/bin/pwd`; + chop($dir); + $dir; +} +sub realpath { + local($dir) = @_; + local($cwd) = &getcwd; + chdir($dir) || &error("directory '$dir' not found."); + $dir = &getcwd; + chdir($cwd) || &error("Cannot return to '$cwd'."); + $dir; +} +sub usable { + local($command) = @_; + foreach (split(/:/, $ENV{'PATH'})) { + return 1 if (-x "$_/$command"); + } + return 0; +} +sub error { + print STDERR "$com: $_[0]\n\n"; + exit 1; +} +sub usage { + print STDERR $usage; + exit 1; +} + +#----------------------------------------------------------------- +# MAIN +#----------------------------------------------------------------- + +$id = $install = $makeghtml = $formaction = $pathdb = $url = $verbose = ''; +%longoption = ( install => 1, makeghtml => 1, pathdb => '', formaction => '', + verbose => 1, url => '', tags => '.', src => '.', +); +while ($ARGV[0] =~ /^-/) { + $opt = shift; + if ($opt =~ /^--(\w+)=?([-+.:~\/\w]*)/) { + &usage unless exists $longoption{$1}; + $$1 = $2 || $longoption{$1}; + next; + } + &usage if ($opt =~ /[^-Iadpsuvz]/); + if ($opt =~ /I/) { $install = 1; } + if ($opt =~ /v/) { $verbose = 1; } + if ($opt =~ /z/) { $makeghtml = 1; } + if ($opt =~ /a/) { + $opt = shift; + last if ($opt eq ''); + $formaction = $opt; + } elsif ($opt =~ /p/) { + $opt = shift; + last if ($opt eq ''); + $pathdb = $opt; + } elsif ($opt =~ /u/) { + $opt = shift; + last if ($opt eq ''); + $url = $opt; + } elsif ($opt =~ /d/) { + $opt = shift; + last if ($opt eq ''); + $tags = $opt; + } elsif ($opt =~ /s/) { + $opt = shift; + last if ($opt eq ''); + $src = $opt; + } +} +$actiondir = &realpath($ARGV[0]) if $ARGV[0]; + +#----------------------------------------------------------------- +# INSTALL +#----------------------------------------------------------------- + +if ($install) { + &usage if ($actiondir eq '.'); + -w $actiondir or &error("$actiondir is not writable."); + unless (-e $CONFIG) { + mkdir($CONFDIR, 0755) || &error("Cannot create dir $CONFDIR") unless (-d $CONFDIR); + local($gspathdata) = ($pathdb) ? "\n\$GSPATHDATA = '$pathdb';\n" : ''; + local($action) = ($formaction) ? "\n\$ACTION = '$formaction';" : ''; + &makeconfig($CONFIG,$gspathdata,$action) || &error("Cannot create $CONFIG"); + chmod(0644,$CONFIG) || &error("Cannot chmod $CONFIG"); + if ($verbose) { + print "** $CONFIG created\n"; + print " GSPATHDATA set to $pathdb\n" if $gspathdata; + print " ACTION set to $formaction\n" if $action; + } + } + &makegsearch("$actiondir/gsearch.cgi") || &error("Cannot create $actiondir/gsearch.cgi"); + chmod(0755,"$actiondir/gsearch.cgi") || &error("Cannot chmod $actiondir/gsearch.cgi"); + if ($makeghtml) { + &makeghtml("$actiondir/ghtml.cgi") || &error("Cannot create $actiondir/ghtml.cgi"); + chmod(0755,"$actiondir/ghtml.cgi") || &error("Cannot chmod $actiondir/ghtml.cgi"); + } + if ($verbose) { + print "** gsearch.cgi installed in $actiondir.\n"; + if ($makeghtml) { + print "** ghtml.cgi installed in $actiondir.\n"; + print " Your http server will need to be configured to use .ghtml files\n"; + print " For apache, ensure mod_mime and mod_actions are loaded, and add:\n"; + print " AddHandler htags-gzipped-html ghtml\n"; + print " Action htags-gzipped-html /cgi-bin/ghtml.cgi\n"; + print " to your httpd.conf or srm.conf files.\n"; + } + do $CONFIG; + print "\n** You must set \$GSPATHDATA in $CONFIG before using htmake or htconfig.\n\n" + unless $GSPATHDATA; + } + exit 0; +} + +#----------------------------------------------------------------- +# UPDATE +#----------------------------------------------------------------- + +-f $CONFIG and do $CONFIG or &error("Cannot read $CONFIG, see htconfig --install option first."); +&error("GSPATHDATA must be defined in $CONFIG") unless $GSPATHDATA; +$tags = &realpath($tags); +-f "$tags/GTAGS" or &error("GTAGS file was not located at $tags"); +$src = &realpath($src); +$actiondir .= '/HTML' if ($actiondir eq '.'); +$url =~ s/\/$//; +$suffix = 'html'; +if ($url && &usable('lynx')) { + $page = `lynx -source $url/mains.html 2>&1`; + $id = $1 if ($page =~ /name='id'\svalue='(\w+)'>/); + $suffix = 'ghtml' if ($page =~ /ghtml/); + $suffix = 'html.gz' if ($page =~ /html\.gz/); +} elsif (-e "$actiondir/mains.html") { + $url = 'file:' . &realpath($actiondir) unless $url; + open(FH,"<$actiondir/mains.html") or &error("Cannot open $actiondir/mains.html"); + while() { + $id = $1 if /name='id'\svalue='(\w+)'>/; + $suffix = 'ghtml' if /ghtml/; + $suffix = 'html.gz' if /html\.gz/; + } + close FH; +} else { + &error("Unable to find/parse mains.html for uniqueid"); +} +&error("Could not obtain uniqueid value.\n$url is not searchable unless generated with one.") unless $id; +unless (-f $GSPATHDATA) { + $GSPATHDATA =~ s/[^-+~.\/\w]//g; + chop($gspathdir = `dirname $GSPATHDATA`); + system('mkdir','-p','-m','0755',"$gspathdir") == 0 or &error("Cannot create $gspathdir") + unless (-d $gspathdir); + system('touch',"$GSPATHDATA") == 0 or &error("Cannot create $GSPATHDATA"); + chmod(0644,"$GSPATHDATA") || &error("Cannot chmod $GSPATHDATA"); +} +-w $GSPATHDATA or &error("Unable to update config, you do not have write permission for\n$GSPATHDATA"); +$newrecord = <$GSPATHDATA~") or &error("Cannot open $GSPATHDATA~"); + while() { + if(/eq\s'$id'/o) { + print WR $newrecord; + $done=1; + } elsif (!/^1;\n/) { + print WR; + } + } + print WR $newrecord unless $done; + print WR "1;\n"; + close WR; + close RD; + rename ($GSPATHDATA, "$GSPATHDATA.bak") and rename ("$GSPATHDATA~", $GSPATHDATA) + or &error("Could not replace $GSPATHDATA"); +} else { + &error("Cannot read $GSPATHDATA"); +} +if ($verbose) { + print "Path record " . (($done) ? "updated" : "created") . ".\n"; + print " id = $id\n"; + print " url = $url\n"; + print " source path = $src\n"; + print " GTAGS path = $tags\n"; + print " html suffix = $suffix\n\n"; +} + +exit 0; + +#---------------------------------------------------------------- +# GENERATE SCRIPTS +#---------------------------------------------------------------- + +sub makeconfig { + local ($file,$gspathdata,$action) = @_; + open(CFG, ">$file") || &error("Cannot open $file."); + $cfg = <$file") || &error("cannot make gsearch.cgi."); + $program = "#!/usr/bin/perl\n\$CONFILE = '$CONFIG';\n"; + $program .= <<'END_OF_SCRIPT'; +print "Content-type: text/html\n\n"; +print ""; +@pairs = split (/&/, $ENV{'QUERY_STRING'}); +foreach $p (@pairs) { + ($name, $value) = split(/=/, $p); + $value =~ tr/+/ /; + $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack("C", hex($1))/eg; + $form{$name} = $value; +} +if (!defined($form{'id'})) { + print "

No form id. Please regenerate hypertext with htmake.

\n"; + &finish(); +} +-f "$CONFILE" and do "$CONFILE" or &alertmissing($CONFILE); +&alertmissing('db') unless (defined($GSPATHDATA)); +-f "$GSPATHDATA" and do "$GSPATHDATA" or &alertmissing($GSPATHDATA); +&alertmissing('id') unless (defined($hpath)); +# call sanity/security checks here before executing global/setting ENV +$ENV{'GTAGSROOT'} = $srcpath; +$ENV{'GTAGSDBPATH'} = $dbpath; +if ($form{'pattern'} eq '') { + print "

Pattern not specified. [return]

\n"; + &finish(); +} +$pattern = $form{'pattern'}; +$flag = ($form{'type'} eq 'definition') ? '' : 'r'; +$words = ($form{'type'} eq 'definition') ? 'definitions' : 'references'; +print "

\"$pattern\"

\n"; +print "Following $words are matched to above pattern.
\n"; +$pattern =~ s/'//g; # to shut security hole +chdir("$srcpath"); +unless (open(PIPE, "/usr/bin/global -x$flag '$pattern' |")) { + print "

Cannot execute global. [return]

\n"; + &finish(); +} +$cnt = 0; +print "
\n";
+while () {
+	$cnt++;
+	($tag, $lno, $filename) = split;
+	chop($fileno = `/usr/bin/btreeop -K "./$filename" GPATH`);
+	s/($tag)/$1<\/A>/;
+	print;
+}
+close(PIPE);
+print "
\n"; +if ($cnt == 0) { + print "

Pattern not found. [return]

\n"; +} +&finish(); + +sub alertmissing { + if (@_ eq 'id') { + print "

No path data configured for this hypertext source

\n"; + print " Please run htconfig on it to enable this search form
\n"; + } elsif (@_ eq 'db') { + print "

Path database location not defined.

\n"; + print " Please set GSPATHDATA in $CONFILE
\n"; + } else { + print "

Unable to read @_

\n"; + print "

Please ensure this file exists, and is readable by
\n"; + print " the user or group that your cgi scripts run as.\n"; + print "

UID: $< or GID: $(\n"; + } + &finish(); +} +sub finish { + print "\n"; + exit 0; +} +END_OF_SCRIPT + + print PROGRAM $program; + close(PROGRAM); +} +sub makeghtml { + local($file) = @_; + open(PROGRAM, ">$file") || &error("cannot make unzip script."); + $program = < + +See the included file 'COPYING' or 'copyright' for licence information. + --- global-5.7.1.orig/htmake/htmake.1 +++ global-5.7.1/htmake/htmake.1 @@ -0,0 +1,109 @@ +.TH HTMAKE 1 "27 March 1999" "Debian GNU/Linux" "GLOBAL cgi Utilities" +.\" Copyright (c) 1999, 2000 Ron Lee. All rights reserved. +.\" This text may be distributed under the same terms as the htmake source. +.\" All copies of this manual must acknowledge the author and include the +.\" above copyright statement. +.\" +.\" In cases of discrepancy the source is authorative. Duh 8^} +.SH NAME +htmake \- create GLOBAL hypertext source searchable by gsearch.cgi +.SH SYNOPSIS +.BR htmake " [" "htags options" "] [" --url=base-url ] +.RI [ destdir ] +.SH "DESCRIPTION" +.B htmake +is a wrapper script that creates searchable hypertext from program +source code and records information into a \fBpath database\fP +needed for a centralised search mechanism. +.PP +Prior to using this command you must have installed gsearch.cgi +using the \fBhtconfig -I\fP option and configured the location +of the \fBpath database\fP in \fIhtmake.conf\fP +.PP +Before you can create the hypertext source you need to execute +\fBgtags\fP(1) from the root directory of the source tree. +\fBhtmake\fP is then called from the same place. +.PP +\fBhtmake\fP uses \fBhtags\fP(1) to create the hypertext with a +unique id and \fBhtconfig\fP(1) to make the required entries in +the \fBpath database\fP. +.SH OPTIONS +The following options will be passed to \fBhtags\fP(1) if used. +.TP +.B -a +Make an alphabetical function index. +.TP +.B -c +Compress html. Use gzip(1) with .ghtml suffix. +.TP +.B -C +Compress html. Use gzip(1) with .html.gz suffix. +.TP +.B -d \fItagdir\fP, --tags=gtagsdbpath +Specifies the directory in which GTAGS and GRTAGS exist. The default is the current directory. +.TP +.B -F +Use frames for definition index, file index and main view. +.TP +.B -l +Make a name tag for each line of hypertext created. +.TP +.B -n +Print out the line numbers. +.TP +.B -t title +The title of this hypertext. Defaults to the last component of the current path. +.TP +.B --action=cgi-url +Specify the location search queries are submitted to. +Defaults to the value set in \fBhtmake.conf\fP or to +.br +.I http://localhost/cgi-bin/gsearch.cgi +.PP +The remaining options are more general or are passed to \fBhtconfig\fP(1). +.TP +.B --url=base-url +the base url for your new hypertext source. +For best results always use absolute url's here. +.br +eg. \fIhttp://host/~user/mysource\fP +.br +It defaults to \fIfile:/destdir\fP +.TP +.I destdir +The directory in which hypertext is generated. +The default is \fI./HTML\fP +.TP +.B -v, --verbose +Activate the inbuilt screen saver. Give your phosphors a workout. +.SH EXAMPLES +$ cd /usr/src/myprog +.br +$ gtags +.br +$ htmake +.PP +$ cd /usr/src/myprog +.br +$ gtags -c +.br +$ htmake \-c \-\-url=http://host/~user/prog/HTML \\ + /home/user/public_html/prog +.SH FILES +.I /etc/gtags/htmake.conf +.br +.I path database +.SH BUGS +As a wrapper \fBhtmake\fP gets to inherit bugs from other software too. +Isn't life fun. +.PP +This is \fIalpha\fP software \- expect anything! +.SH "SEE ALSO" +.BR htconfig (1), " htags" (1), " gtags" (1), " global" (1). +.SH AUTHOR +Ron Lee +.SH CREDITS +Thanks to Shigio Yamaguchi for creating +\fBGLOBAL\fP and releasing it as free software. +.br +A truly cool productivity tool! --- global-5.7.1.orig/htmake/htmake.pl +++ global-5.7.1/htmake/htmake.pl @@ -0,0 +1,141 @@ +#!/usr/bin/perl +# +# Copyright (c) 1999, 2000 +# Ron Lee All rights reserved. +# +# You may distribute this software under the terms of the GNU GPL version 2 +# or later. +# +# htmake.pl 25-Mar-99 +# +# htmake is a wrapper that calls htags(1) with an --id attribute +# and runs htconfig on the generated hypertext. +# +# OPERATION: generate unique id. +# call htags to make html source +# call htconfig to update database. +# must be called from src dir. +# +# htmake [htags options] --action=cgi-action --url=base-url --tags=gtagsdbpath [destdir] +# +# TODO: add --rebuild option, to recycle old id. ?? +# + +$com = $0; +$com =~ s/.*\///; +$usage = "usage: $com [-a][-c|-C][-h][-l][-n][-v][-d tagdir, --tags=tagdir][-t title]\n"; +$usage .= " [--action=cgi-url][--url=base-url][destdir]\n"; + +#----------------------------------------------------------------- +# DEFAULTS +#----------------------------------------------------------------- + +$CONFIG = '/etc/gtags/htmake.conf'; +$action = 'http://localhost/cgi-bin/gsearch.cgi'; + +#---------------------------------------------------------------- +# UTILITIES +#---------------------------------------------------------------- + +sub getcwd { + local($dir) = `/bin/pwd`; + chop($dir); + $dir; +} +sub realpath { + local($dir) = @_; + local($cwd) = &getcwd; + chdir($dir) || &error("directory '$dir' not found."); + $dir = &getcwd; + chdir($cwd) || &error("Cannot return to '$cwd'."); + $dir; +} +sub usable { + local($command) = @_; + foreach (split(/:/, $ENV{'PATH'})) { + return 1 if (-x "$_/$command"); + } + return 0; +} +sub error { + print STDERR "$com: $_[0]\n\n"; + exit 1; +} +sub usage { + print STDERR $usage; + exit 1; +} + +#----------------------------------------------------------------- +# MAIN +#----------------------------------------------------------------- + +&usable('htags') or &error("htags function not availiable."); +&usable('htconfig') or &error("htconfig function not availiable."); +-f $CONFIG and do $CONFIG or &error("Cannot read $CONFIG, see htconfig --install option first."); +&error("GSPATHDATA must be defined in $CONFIG") unless $GSPATHDATA; +$action = $ACTION if $ACTION; +$destdir = $url = $tags = ''; +$htagsflags = 'f'; +%longoption = ( action => '/cgi-bin/gsearch.cgi', url => '', tags => '', verbose => 1, ); +while ($ARGV[0] =~ /^-/) { + $opt = shift; + if ($opt =~ /^--(\w+)=?([-+.:~\/\w]*)/) { + &usage unless exists $longoption{$1}; + $$1 = $2 || $longoption{$1}; + next; + } + &usage if ($opt =~ /[^-acCdFlntv]/); + if ($opt =~ /a/) { $htagsflags .= 'a'; } + if ($opt =~ /c/) { $htagsflags .= 'c'; } + if ($opt =~ /C/) { $htagsflags .= 'C'; } + if ($opt =~ /F/) { $htagsflags .= 'F'; } + if ($opt =~ /l/) { $htagsflags .= 'l'; } + if ($opt =~ /n/) { $htagsflags .= 'n'; } + if ($opt =~ /v/) { $verbose = 1; } + if ($opt =~ /d/) { + $opt = shift; + last if ($opt eq ''); + $tags = $opt; + } elsif ($opt =~ /t/) { + $opt = shift; + last if ($opt eq ''); + $title = $opt; + } +} +$destdir = &realpath($ARGV[0]) if $ARGV[0]; + +# get unique id +# +&getcwd =~ /([^\/]*)$/ and $id = $1; +$id =~ s/[^\w]//g; +$id .= time; + +# call htags +# +$htagsflags .= 'v' if $verbose; +@htagsopt = ("-$htagsflags"); +push @htagsopt,('-t',"$title") if $title; +push @htagsopt,('-d',"$tags") if $tags; +print "Executing: htags @htagsopt --action=$action --id=$id --nocgi $destdir\n" if $verbose; + +# htags is a C program now, so the number of arguments is important. +# +if ($destdir eq '') { + system('htags',@htagsopt,"--action=$action","--id=$id","--nocgi") == 0 or + &error("Failed to execute htags."); +} else { + system('htags',@htagsopt,"--action=$action","--id=$id","--nocgi","$destdir") == 0 or + &error("Failed to execute htags."); +} + +# call htconfig +# +@htconfigopt =(); +push @htconfigopt,('-v') if $verbose; +push @htconfigopt,("--url=$url") if $url; +push @htconfigopt,("--tags=$tags") if $tags; +print "Executing: htconfig @htconfigopt $destdir\n" if $verbose; +system('htconfig',@htconfigopt,"$destdir") == 0 or &error("Failed to execute htconfig."); + +exit 0; --- global-5.7.1.orig/htmake/htconfig.1 +++ global-5.7.1/htmake/htconfig.1 @@ -0,0 +1,244 @@ +.TH HTCONFIG 1 "27 March 1999" "Debian GNU/Linux" "GLOBAL cgi Utilities" +.\" Copyright (c) 1999, 2000 Ron Lee. All rights reserved. +.\" This text may be distributed under the same terms as the htconfig source. +.\" All copies of this manual must acknowledge the author and include the +.\" above copyright statement. +.\" +.\" In cases of discrepancy the source is authorative. Duh 8^} +.SH NAME +htconfig \- create/update GLOBAL gsearch.cgi files +.SH SYNOPSIS +.nh +.B htconfig -I +.RB [ -v ] +.RB [ -z ] +.RB [ -a +.IR action ] +.RB [ -p +.IR pathdb ] +.I cgidir +.HP +.B htconfig --install +.RB [ --verbose ] +.RB [ --makeghtml ] +.RB [ --formaction=\fIcgi\fP ] +.RB [ --pathdb=\fIpaths-file\fP ] +.I cgidir +.HP +.B htconfig +.RB [ -v ] +.RB [ -u +.IR url ] +.RB [ -d +.IR GTAGSDBPATH ] +.RB [ -s +.IR GTAGSROOT ] +.RI [ htmldir ] +.HP +.B htconfig +.RB [ --verbose ] +.RB [ --url=\fIbase-url\fP ] +.RB [ --tags=\fIGTAGSDBPATH\fP ] +.RB [ --src=\fIGTAGSROOT\fP ] +.RI [ htmldir ] +.hy +.SH "DESCRIPTION" +.B htconfig +is a program to create and maintain a centralised cgi interface +for hypertext created with +.nh +Shigio Yamaguchi's +.hy +\fBGLOBAL\fP source +code tag system. +.PP +.B htconfig +is used to create the necessary scripts in your system's favoured +cgi-bin directory, and to maintain the \fIpaths database\fP, which +.B gsearch.cgi +uses to locate your hypertext source and the associated TAGS files. +This enables \fBGLOBAL\fP's hypertext search facilities without +requiring you to enable cgi execution outside of a system-wide +cgi-bin directory. +.PP +.B htconfig +acts as a backend for the \fBhtmake\fP(1) script which automates the +process of generating hypertext source with the relevant options +to \fBhtags\fP(1) and adding required entries to the paths database. +.B htconfig +can also optionally create a centralised \fBghtml.cgi\fP script, for +users of the \fBhtags -c\fP option which creates compressed hypertext +with a .ghtml suffix. +.SH OPTIONS +.SS Common Options +.TP +.B -v, --verbose +uh, you get one guess. +.SS Install Options +These options are to be used during the initial installation of +the centralised cgi mechanism. +If you installed this as a binary package you probably won't +need to use these and can skip to the next section. +Otherwise you \fImust\fP run +.nh +.B "htconfig --install" +.hy +with any or all of the following options \fIbefore\fP using +\fBhtmake\fP(1) or any of the \fBDatabase Options\fP of +\fBhtconfig\fP. +.TP +.B -I, --install +Creates \fBgsearch.cgi\fP in \fIcgidir\fP and creates the config file +.nh +\fI/etc/gtags/htmake.conf\fP +.hy +if it doesn't already exist. You \fImust\fP specify \fIcgidir\fP, +there is no default. +.TP +.B -a action, --formaction=action +Puts the default submit action for hypertext created with +\fBhtmake\fP(1) into +.nh +\fI/etc/gtags/htmake.conf\fP +.hy +when that file is created. You can edit \fIhtmake.conf\fP at any time +to change it, or override its setting from the command line. +Setting this to the absolute url of \fBgsearch.cgi\fP on your +system is probably what you want here unless you understand why not. +.br +.nh +eg. +.B --formaction=http://host/cgi\-bin/gsearch.cgi +.hy +.TP +.B -p paths-database, --pathdb=paths-database +Puts the filesystem location of the \fIpaths database\fP file into +.nh +\fI/etc/gtags/htmake.conf\fP +.hy +when that file is created. You \fImust\fP define a location for +the \fIpaths database\fP either with this option or by editing +the \fBGSPATHDATA\fP option in \fIhtmake.conf\fP before using +.nh +\fBhtmake\fP(1) +.hy +or the Database options of \fBhtconfig\fP(1). +.br +Due to file system variations there is no default for this. +For Debian GNU/Linux systems the preferred location is: +.br +.I /var/lib/gsearch/pathdata +.br +One suggestion for *BSD systems would be: +.br +.I /var/gsearch/pathdata +.TP +.B -z, --makeghtml +Installs the ghtml.cgi script in \fIcgidir\fP. +You will also need edit your http server config to make use of this. +For \fBapache\fP this involves ensuring \fImod_mime\fP and \fImod_actions\fP +are loaded and adding lines like: +.br +.B AddHandler htags-gzipped-html ghtml +.br +.B Action htags-gzipped-html \fI/cgi-bin/ghtml.cgi\fP +.br +to your \fIhttpd.conf\fP file. +.SS Database Options +These options are used to configure and maintain the \fBpath database\fP +that allows gsearch.cgi to find your hypertext source and it's tag files. +You should call \fBhtconfig\fP with these options when you move files or +create a new hypertext source tree with \fBhtags\fP(1). +The \fBpath database\fP requires the hypertext source to be generated +with a \fIunique id\fP using the \fBhtags --id=someid\fP option. +.PP +When creating a \fInew\fP hypertext source tree you may prefer to use +\fBhtmake\fP(1) which invokes \fBhtags\fP with the desired options and +then calls \fBhtconfig\fP to update the \fBpath database\fP as a single +operation. +.TP +.I htmldir +specifies the filesystem path to the root of your hypertext source tree. +It defaults to \fI./HTML\fP in line with \fBhtags\fP(1) defaults and is +not required at all if the \fB--url\fP option is used \fIand\fP your system +has \fBlynx\fP(1) availiable, +.TP +.B -u base-url, --url=base-url +the base url of your hypertext source. +For best results always use absolute url's here. +.br +eg. \fIhttp://host/~user/mysource\fP +.br +It defaults to \fIfile:/htmldir\fP +.TP +.B -d gtagsdbpath, --tags=gtagsdbpath +the filesystem path to the \fBGTAGS\fP files associated with your source. +It defaults to the current directory. +.TP +.B -s gtagsroot, --src=gtagsroot +the filesystem path to the root of your original plaintext source tree. +It defaults to the current directory. +.SH EXAMPLES +To initialise and install cgi and config files: +.PP +# htconfig -I -a http://host/cgi-bin/gsearch.cgi \\ + -p /var/lib/gsearch/pathdata /usr/lib/cgi-bin +.PP +To generate hypertext and update \fBpath database\fP: +.PP +$ cd /usr/src/myprog +.br +$ gtags +.br +$ htags --action=http://host/cgi-bin/gsearch.cgi \\ + --id=uniqueid --nocgi +.br +$ htconfig +.PP +or more simply: +.PP +$ cd /usr/src/myprog +.br +$ gtags +.br +$ htmake +.PP +To update the \fBpath database\fP if you relocate your hypertext, TAGS files, +or the original program source: +.PP +$ htconfig -u new-url -d new-gtagsdbpath \\ + -s new-gtagsdbroot newhtmldir +.PP +.RS +some of these option may be inferred - See their defaults under +.B Database Options +.RE +.PP +The user running \fBhtconfig\fP or \fBhtmake\fP must have write permission for the +.B path database. +.SH FILES +.I /etc/gtags/htmake.conf +.br +.I gsearch.cgi +.br +.I ghtml.cgi +.br +.I path database +.SH BUGS +.B htconfig +currently has no automatic housekeeping mechanism for 'stale' database entries. +This should be fixed RSN. +.PP +There is presently no file locking mechanism for database updates. +Attempting simultaneous updates could prove 'surprising' ^_^ +.PP +This is \fIalpha\fP software \- expect anything! +.SH "SEE ALSO" +.BR htmake (1), " htags" (1), " global" (1). +.SH AUTHOR +Ron Lee +.SH CREDITS +Thanks to Shigio Yamaguchi for creating +\fBGLOBAL\fP and releasing it as free software. +.br +A truly cool productivity tool! --- global-5.7.1.orig/doc/global.texi +++ global-5.7.1/doc/global.texi @@ -647,6 +647,13 @@ @end example +On Debian systems you may instead simply invoke globash(1). +@example + + $ globash + +@end example + You will see a prompt like this: @example --- global-5.7.1.orig/doc/global.info +++ global-5.7.1/doc/global.info @@ -548,6 +548,10 @@ $ bash --rcfile /usr/local/share/gtags/globash.rc + On Debian systems you may instead simply invoke globash(1). + + $ globash + You will see a prompt like this: [/usr/src/sys]/kern _ --- global-5.7.1.orig/htags/htags.1 +++ global-5.7.1/htags/htags.1 @@ -3,7 +3,7 @@ .SH NAME htags \- generate hypertext from source code. .SH SYNOPSIS -\fBhtags\fP [-acDfFghInosTvwx][-d \fIdbpath\fP][-m \fIname\fP][-S \fIcgidir\fP][-t \fItitle\fP][\fIdir\fP] +\fBhtags\fP [-acCDfFghInosTvwx][-d \fIdbpath\fP][-m \fIname\fP][-S \fIcgidir\fP][-t \fItitle\fP][\fIdir\fP] .br .SH DESCRIPTION \fBHtags\fP makes hypertext of C, C++, Yacc, Java, PHP and Assembly source code. @@ -42,6 +42,11 @@ is invoked for each compressed file. See \'HTML/.htaccess\' that is generated by htags. .TP +\fB-C\fP +Make compressed html files with a \fIhtml.gz\fP suffix. +Debian systems can usually uncompress these transparently +without the need for a CGI helper. +.TP \fB--cvsweb\fP \fIurl\fP Include cvsweb URL. \fIurl\fP is used as base of URL. When directory \'CVS\' exists in the root directory of source project, --- global-5.7.1.orig/htags/global.cgi.tmpl +++ global-5.7.1/htags/global.cgi.tmpl @@ -1,4 +1,4 @@ -#! /usr/local/bin/perl +#! /usr/bin/perl #------------------------------------------------------------------ # YOU ARE COMING TO THE DESTINATION ALMOST. PLEASE DO A LITTLE EFFORT. # --- global-5.7.1.orig/htags/htags.c +++ global-5.7.1/htags/htags.c @@ -98,7 +98,7 @@ * options */ int aflag; /* --alphabet(-a) option */ -int cflag; /* --compact(-c) option */ +int cflag; /* --compact(-c|-C) option */ int fflag; /* --form(-f) option */ int Fflag; /* --frame(-F) option */ int gflag; /* --gtags(-g) option */ @@ -231,6 +231,7 @@ int colorize_warned_line = 0; /* colorize warned line */ const char *script_alias = "/cgi-bin"; /* script alias of WWW server */ const char *gzipped_suffix = "ghtml"; /* suffix of gzipped html file */ +const char *alt_gz_suffix = "html.gz"; /* suffix of -C compressed file */ const char *normal_suffix = "html"; /* suffix of normal html file */ const char *HTML; const char *action = "cgi-bin/global.cgi";/* default action */ @@ -1452,7 +1453,7 @@ if (htags_options) argv = append_options(&argc, argv); - while ((optchar = getopt_long(argc, argv, "acd:DfFghIm:noqsS:t:Tvwx", long_options, &option_index)) != EOF) { + while ((optchar = getopt_long(argc, argv, "acCd:DfFghIm:noqsS:t:Tvwx", long_options, &option_index)) != EOF) { switch (optchar) { case 0: /* already flags set */ @@ -1491,7 +1492,10 @@ aflag++; break; case 'c': - cflag++; + cflag = 'c'; + break; + case 'C': + cflag = 'C'; break; case 'd': strlimcpy(arg_dbpath, optarg, sizeof(arg_dbpath)); @@ -1670,7 +1674,7 @@ strlimcpy(dbpath, cwdpath, sizeof(dbpath)); if (cflag && !usable("gzip")) { - warning("'gzip' command not found. -c option ignored."); + warning("'gzip' command not found. -%c option ignored.", cflag ); cflag = 0; } if (!title) { @@ -1768,7 +1772,7 @@ /* * check directories */ - if (fflag || cflag || dynamic) { + if (fflag || cflag == 'c' || dynamic) { if (cgidir && !test("d", cgidir)) die("'%s' not found.", cgidir); if (!Sflag) { @@ -1785,7 +1789,7 @@ *------------------------------------------------------------------ * HTML/cgi-bin/global.cgi ... CGI program (1) * HTML/cgi-bin/ghtml.cgi ... unzip script (1) - * HTML/.htaccess ... skeleton of .htaccess (1) + * HTML/.htaccess.skel ... skeleton of .htaccess (1) * HTML/help.html ... help file (2) * HTML/R/ ... references (3) * HTML/D/ ... definitions (3) @@ -1806,7 +1810,8 @@ signal_setup(); sethandler(clean); - HTML = (cflag) ? gzipped_suffix : normal_suffix; + HTML = (cflag == 'c') ? gzipped_suffix + : (cflag == 'C') ? alt_gz_suffix : normal_suffix; message("[%s] Htags started", now()); start_all_time = time(NULL); @@ -1834,7 +1839,7 @@ if (symbol) make_directory_in_distpath(SYMS); } - if (cgi && (fflag || cflag || dynamic)) + if (cgi && (fflag || cflag == 'c' || dynamic)) make_directory_in_distpath("cgi-bin"); if (Iflag) make_directory_in_distpath("icons"); @@ -1858,9 +1863,9 @@ } else { message("[%s] (1) making CGI program ...(skipped)", now()); } - if (cgi && cflag) { - makehtaccess(".htaccess"); - if (chmod(makepath(distpath, ".htaccess", NULL), 0644) < 0) + if (cgi && cflag == 'c') { + makehtaccess(".htaccess.skel"); + if (chmod(makepath(distpath, ".htaccess.skel", NULL), 0644) < 0) die("cannot chmod .htaccess skeleton."); if (cgidir) { makeghtml(cgidir, "ghtml.cgi"); @@ -1985,7 +1990,7 @@ message(" Your system may need to be setup to decompress *.%s files.", gzipped_suffix); message(" This can be done by having your browser compiled with the relevant"); message(" options, or by configuring your http server to treat these as"); - message(" gzipped files. (Please see 'HTML/.htaccess')\n"); + message(" gzipped files. (Please see 'HTML/.htaccess.skel')\n"); } if (fflag || dynamic) { const char *format = " You need to setup http server so that %s is executed as a CGI script."; --- global-5.7.1.orig/htags/manual.in +++ global-5.7.1/htags/manual.in @@ -25,7 +25,7 @@ @HEADER HTAGS,1,March 2008,GNU Project @NAME htags - generate hypertext from source code. @SYNOPSIS - @name{htags} [-acDfFghInosTvwx][-d @arg{dbpath}][-m @arg{name}][-S @arg{cgidir}][-t @arg{title}][@arg{dir}] + @name{htags} [-acCDfFghInosTvwx][-d @arg{dbpath}][-m @arg{name}][-S @arg{cgidir}][-t @arg{title}][@arg{dir}] @DESCRIPTION @name{Htags} makes hypertext of C, C++, Yacc, Java, PHP and Assembly source code. @@ -59,6 +59,10 @@ You need to set up a web server so that @xref{gzip,1} is invoked for each compressed file. See @file{HTML/.htaccess} that is generated by htags. + @item{@option{-C}} + Makes compressed html files with a html.gz suffix. + Some systems (eg. Debian GNU/Linux) can uncompress these + transparently without the need for a CGI helper. @item{@option{--cvsweb} @arg{url}} Include cvsweb URL. @arg{url} is used as base of URL. When directory @file{CVS} exists in the root directory of source project,