Browse Source

Remove GEM

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41478 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 15 years ago
parent
commit
2d94043c63
70 changed files with 0 additions and 18185 deletions
  1. 0 1
      Makefile
  2. 0 324
      gem/LICENSE
  3. 0 19
      gem/Makefile
  4. 0 39
      gem/NEWS
  5. 0 239
      gem/README
  6. 0 1122
      gem/actions.c
  7. 0 62
      gem/actions.h
  8. 0 239
      gem/at_exit_funcs.c
  9. 0 36
      gem/at_exit_funcs.h
  10. 0 4378
      gem/docs/GEM-Manual.lyx
  11. 0 1336
      gem/docs/GEM-Manual.tex
  12. 0 30
      gem/docs/GEM-Manual/GEM-Manual.css
  13. 0 2394
      gem/docs/GEM-Manual/GEM-Manual.html
  14. 0 10
      gem/docs/GEM-Manual/WARNINGS
  15. 0 5
      gem/docs/GEM-Manual/images.aux
  16. 0 240
      gem/docs/GEM-Manual/images.log
  17. 0 180
      gem/docs/GEM-Manual/images.pl
  18. 0 247
      gem/docs/GEM-Manual/images.tex
  19. BIN
      gem/docs/GEM-Manual/img1.old
  20. BIN
      gem/docs/GEM-Manual/img1.png
  21. BIN
      gem/docs/GEM-Manual/img10.png
  22. BIN
      gem/docs/GEM-Manual/img11.png
  23. BIN
      gem/docs/GEM-Manual/img12.png
  24. BIN
      gem/docs/GEM-Manual/img13.png
  25. BIN
      gem/docs/GEM-Manual/img14.png
  26. BIN
      gem/docs/GEM-Manual/img15.png
  27. BIN
      gem/docs/GEM-Manual/img16.png
  28. BIN
      gem/docs/GEM-Manual/img17.png
  29. BIN
      gem/docs/GEM-Manual/img18.png
  30. BIN
      gem/docs/GEM-Manual/img2.png
  31. BIN
      gem/docs/GEM-Manual/img3.png
  32. BIN
      gem/docs/GEM-Manual/img4.png
  33. BIN
      gem/docs/GEM-Manual/img5.png
  34. BIN
      gem/docs/GEM-Manual/img6.png
  35. BIN
      gem/docs/GEM-Manual/img7.png
  36. BIN
      gem/docs/GEM-Manual/img8.png
  37. BIN
      gem/docs/GEM-Manual/img9.png
  38. 0 2394
      gem/docs/GEM-Manual/index.html
  39. 0 58
      gem/docs/GEM-Manual/internals.pl
  40. 0 117
      gem/docs/GEM-Manual/labels.pl
  41. 0 18
      gem/docs/make-html.sh
  42. 0 73
      gem/error.c
  43. 0 35
      gem/error.h
  44. 0 183
      gem/globals.h
  45. 0 858
      gem/main.c
  46. 0 462
      gem/reg_deps.c
  47. 0 38
      gem/reg_deps.h
  48. 0 873
      gem/reg_entries.c
  49. 0 39
      gem/reg_entries.h
  50. 0 549
      gem/reg_html.c
  51. 0 36
      gem/reg_html.h
  52. 0 29
      gem/skeleton/README
  53. 0 6
      gem/skeleton/authors
  54. 0 5
      gem/skeleton/bugs
  55. 0 3
      gem/skeleton/commands
  56. 0 22
      gem/skeleton/depends
  57. 0 7
      gem/skeleton/description
  58. 0 20
      gem/skeleton/entries-gisman
  59. 0 29
      gem/skeleton/entries-gisman2
  60. 0 7
      gem/skeleton/headers
  61. 0 2
      gem/skeleton/id
  62. 0 6
      gem/skeleton/info
  63. 0 7
      gem/skeleton/libs
  64. 0 340
      gem/skeleton/license
  65. 0 6
      gem/skeleton/name
  66. 0 66
      gem/skeleton/post
  67. 0 56
      gem/skeleton/uninstall
  68. 0 13
      gem/skeleton/version
  69. 0 858
      gem/tools.c
  70. 0 69
      gem/tools.h

+ 0 - 1
Makefile

@@ -46,7 +46,6 @@ DIRS = \
 	locale \
 	man \
 	swig \
-	gem \
 	macosx
 
 SUBDIRS = $(DIRS)

+ 0 - 324
gem/LICENSE

@@ -1,324 +0,0 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Contact information:
-
-Benjamin Ducke
-Archaeo-Information Science
-Institute of Archaeology
-University of Kiel, Germany
-benjamin.ducke@ufg.uni-kiel.de
-
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.

+ 0 - 19
gem/Makefile

@@ -1,19 +0,0 @@
-MODULE_TOPDIR = ..
-
-include $(MODULE_TOPDIR)/include/Make/Other.make
-include $(MODULE_TOPDIR)/include/Make/Compile.make
-
-GEM = gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR)
-
-default: $(ARCH_BINDIR)/$(GEM)$(EXE)
-
-$(ARCH_BINDIR)/$(GEM)$(EXE): $(ARCH_OBJS)
-	$(call linker_base,$(LINK),$(LDFLAGS) $(EXTRA_LDFLAGS),$(FMODE_OBJ) $(LIBES) $(EXTRA_LIBS))
-
-install: $(UNIX_BIN)/$(GEM)$(EXE)
-
-$(UNIX_BIN)/$(GEM)$(EXE): $(ARCH_BINDIR)/$(GEM)$(EXE)
-	$(INSTALL)  $< $@
-	-strip $@
-
-.PHONY: install

+ 0 - 39
gem/NEWS

@@ -1,39 +0,0 @@
-gem 1.0.1
-===========
-fixed a bug where installing GUI entries corrupts newer versions of d.m
-
-gem 1.0
-===========
-possible to pass options to configure script of extension
-GUI entries for d.m and gis.m supported
-fixed annoyances related to temporary files clean-up
-fixed registration of HTML man pages
-fixed several bugs
-
-gem 0.98
-========
-New argument --options allows user to pass compiler options.
-
-Support extensions in uncompressed .tar files.
-
-Default compiler option -I/usr/local/grasslib/include/ for people running Lorenzo Moretti's GRASS version on Mac OS X.
-
-Mac OS X systems should no longer show a warning upon removal of temporary extension files by GEM.
-
-Fixed a very nasty bug in temp file handling that could potentially delete wrong directories!
-
-gem 0.97
-========
-Fixed filename handling (installation of extension packages stored
-in different directories).
-
-Invocation: user must now always specify a valid action.
-
-gem 0.95
-========
-Feature-complete version
-Lots of bugfixes
-
-gem 0.9
-=======
-First public release

+ 0 - 239
gem/README

@@ -1,239 +0,0 @@
-August 18th 2005
-
-GRASS Extensions Manager (GEM)
-Version 0.97
-
-This software is licensed under the GNU public license.
-
-!!! WARNING !!!
-
-This is beta software that may still contain serious bugs.
-I particularly recommend you backup your GIS Manager menu file
-$(PATH_TO_GRASS)/etc/dm/menu.tcl in case d.m ceases working
-after installation/deinstallation of extensions using GEM. 
-
-!!! WARNING !!!
-
-
-Author: Benjamin Ducke
-	benducke@compuserve.de
-
-
-
-Purpose: 
-	this software configures, compiles and installs additional modules
-	for use with GRASS GIS version 6.0.0 and up.
-	An additional menu entry "Xtns" will show up in the GIS Manager's
-	main menu bar and the extension's modules will be registered in a
-	nested submenu.
-	HTML documentation will also integrate seamlessly into the GRASS
-	HTML doc tree. There will be a new section "Extensions" accessible
-	from the main HTML page $(PATH_TO_GRASS)/docs/html/index.html.
-	
-Compiling: 
-	just type 'make'
-
-Installing: 
-	if you want, copy the executable 'gem' into an appropriate
-	directory, e.g. /usr/local/bin
-
-Requirements: 
-	GNU C compiler and maketools for compilation.
-	Tar, gzip, unzip, bunzip2 for handling various archive formats.
-	Wget for fetching extensions from the internet.
-
-Usage: start 'gem' w/o parameters for information
-
-	To install a module into your GRASS installation, in this example
-	/usr/local/grass-7.0.0, simply pass the name of the archive containing
-	the extension or the directory with the unpacked files (e.g. 'cva.tgz'):
-	
-	$ gem --grass=/usr/local/grass-7.0.0 -i cva.tgz
-
-	You will be asked for the password of the user owning the GRASS
-	binary files, if required.
-	
-	If you invoke gem from inside a running GRASS session, you can
-	ommit the "--grass=" option. We will assume this for the following
-	usage examples. If any errors occur, use option "-v" (verbose) to see 
-	what is going on.
-	
-	Get info about an extension:
-	
-	$ gem -q cva.tgz
-	
-	List installed extensions (shows name, version and type of installation, 
-	i.e. binaries or compiled from source):
-	
-	$ gem -q
-	
-	Uninstall an extension (take name from list produced by above command):
-	
-	$ gem -u AdvancedViewshedAnalysis
-	
-	Quit and restart the GIS-Manager (d.m) to see the effects of these actions.
-	
-	If something goes wrong unexpectedly or you accidentally overwrite
-	GIS Manager's menu config file ($(PATH_TO_GRASS)/etc/dm/menu.tcl):
-	
-	$ gem --restore
-	
-	will try to put everything back in order. The program will also create
-	a backup copy menu.tcl.gem.bak before it alters menu.tcl. The "restore"
-	action is also useful if you update or re-install GIS-Manager or the
-	GRASS HTML-Documentation in which case both menu entries and HTML references
-	have to be restored for all extensions installed.
-	
-Background:		
-	A GRASS extension is essentially a minimal replication of the GRASS source
-	tree including all necessary makefiles. It contains only the source code
-	for a few modules that constitute the extensions. On the top level, you
-	will find a number of ASCII files that contain the information gem needs
-	to manage the extension. All information is managed in plain ASCII format.
-	Installed extensions will be registered in $(PATH_TO_GRASS)/etc/extensions.db.
-	This registry file also contains version and dependencies information.
-	Each extension should also provide an uninstall script to be run when the
-	user wants to get rid of that extension. They are stored in
-	$(PATH_TO_GRASS)/etc/uninstall.<extension_name>.
-	
-	Extension may add a submenu to the GIS Manager. The first extension installed
-	creates an additional "Xtns" top level menu under which each extension
-	can register a nested submenu. Gem modifies $(PATH_TO_GRASS)/etc/d.m/menu.tcl
-	for this.
-	
-	The extension source code is in the 'src' directory, along with all the
-	necessary makefiles. Other directories may hold pre-compiled binaries
-	and should be named appropriately ('win32', 'macosx', ...).
-	
-	Extensions may provide code for C language modules and libraries, scripts
-	and HTML documentation.
-	
-Caveats:
-	
-	The installation is sensitive to the precise syntax of menu.tcl.
-	If the user has altered this file substantially it is likely that
-	registering the extension submenu entries will fail.
-		
-	There is no clean way to upgrade an existing extension and
-	respecting dependencies _automatically_. You can use '-f' to force 
-	over-write of an extension, but it is safer to uninstall, 
-	then install the new version.
-	
-	
-	
-==================================
-
-
-An extension package provides a nearly complete GRASS 6 source compilation
-environment. Thus, changes to module makefiles can be kept to a minimum.
-
-The g.install program exports three environmental variables that point
-to the directories holding GRASS 6 headers and libs and to the
-install location:
-
-	GINSTALL_INC
-	GINSTALL_LIB
-	GINSTALL_DST
-	
-These are added to the makefiles so that externally compiled modules
-are able to see those GRASS headers and libs they need. To achieve this, the following files were slightly altered for the external installation scheme:
-
-include/Make
-	/Grass.make.in
-		L32: added  -I$(GINSTALL_INC) to GRASS_INC
-		L53: added  -L$(GINSTALL_LIB) to ARCH_LIBPATH
-		L81: added  $(GEM_C_OPTS) to CFLAGS
-		
-	/Rules.make
-		L37: the path to the HTML docs is now expanded with /extensions/<extension>
-		     the name for the extension is read from GEM_EXT_NAME which is
-		     exported by gem
-	
-		L55: added :$(GINSTALL_LIB) to definition of LD_LIBRARY_PATH_VAR
-		
-		L49: this now make two different copies: one to go into the extension's HTML folder
-		     (docs/extensions/$(GEM_EXT_NAME) and one -- with adjusted relative links -- to
-		     go into docs/html !
-		     GEM_EXT_NAME is exported by the GEM installer tool
-		     
-include/Shlib.make
-			
-		L3: SHLIB = $(ARCH_LIBDIR)/$(SHLIB_PREFIX)$(SHLIB_NAME).$(GEM_EXT_VERSION)$(SHLIB_SUFFIX)	
-		L14 $(SHLIB): $(SHLIB_OBJS)
-			$(SHLIB_LD) -o $@ $(LDFLAGS) $^ $(EXTRA_LIBS) && ln -sf $(notdir $@) $(patsubst 			
-			%.$(GEM_EXT_VERSION)$(SHLIB_SUFFIX),%$(SHLIB_SUFFIX),$@)
-			
-			(GEM_EXT_VERSION installs lib with version number from 'version' file in Extension package)
-
-main Makefile
-		L168: target real-install:
-		     commented out everything that seems not strictly necessary 
-		     for a module installation and might interfere with the
-		     user's GRASS installation
-		     
-		     exit with error code 1 on write permission problems
-		     this can be caught by 'gem' and dealt with
-		     
-		     only create 'error.log' if a module did not compile. Use
-		     this to check for compilation errors and abort, if necessary.
-		     
-		L171: comment out stuff for creating GRASS startup script
-
-lib/init/Makefile
-		L32: commented out everything that seems not strictly necessary 
-		     for a module installation and might interfere with the
-		     user's GRASS installation
-		     
-build_html_index.sh		     
-		L16: expand HTML with /extensions/$GEM_EXT_NAME (exported by gem)				
-		
-		the HTML default text has been altered in many places to reflect its new function
-		for describing extensions.
-		
-		gem also exports the following variables to enrich the HTML default text:
-			GEM_EXT_VERSION	(extension's version)
-			...
-
-The module's makefile itself can stay largely the way it is. The only thing
-that may need to be adjusted is the MODULE_TOPDIR = .. statement that points
-to the location of the makefile include directory.
-
-The version file include/VERSION should contain four lines that specify the
-release version of the extension in the same manner GRASS would:
-major
-minor
-release
-date
-
-e.g:
-
-1
-0
-0
-2005
-
-For version 1.0.0 release 2005.
-
-
-main Makefile:
-l28: INST_DIR is set according to GINSTALL_DST which has to be exported by g.install
-
-lib Makefile:
-	cut out the part that wants to install header files (not needed)
-
-configure script:
-
-In summary print-out section at end of script:
-got rid of:
-	echo " Startup script in directory: ${bindir}"
-
-
-A script that creates an extension package would have to:
-	- copy the build environment into the tar file
-	- copy source code for modules into the cmd dir
-	- copy source code for libs into the RIGHT lib dir
-	- set include/VERSION
-
-
-	
-	

File diff suppressed because it is too large
+ 0 - 1122
gem/actions.c


+ 0 - 62
gem/actions.h

@@ -1,62 +0,0 @@
-
-/***************************************************************************
- *            actions.h
- *
- *  Mon Apr 18 15:29:34 2005
- *  Copyright  2005  Benjamin Ducke
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _ACTIONS_H
-#define _ACTIONS_H
-
-#include "globals.h"
-
-void check_extension(char *package, char *name, int *major, int *minor,
-		     int *revision);
-
-void unpack_extension(char *package);
-
-void query_extension(char *package, char *name, int major, int minor,
-		     int revision, char *short_name, char *invocation,
-		     char *org_name);
-
-void source_install(char *package, char *gisbase, char *pkg_short_name,
-		    int pkg_major, int pkg_minor, int pkg_revision,
-		    char *grass_version);
-
-void bin_install(char *package, char *gisbase, char *bins,
-		 char *pkg_short_name, int pkg_major, int pkg_minor,
-		 int pkg_revision, char *grass_version);
-
-void test_install(char *package, char *gisbase, char *pkg_short_name,
-		  int pkg_major, int pkg_minor, int pkg_revision,
-		  char *grass_version);
-
-void uninstall(char *package, char *pkg_short_name, char *gisbase,
-	       char *grass_version);
-
-int source_clean(char *package);
-
-void restore(char *gisbase, char *grass_version);
-
-void list_extensions(char *gisbase);
-
-void run_post(char *package, int action, char *bins, char *gisbase);
-
-#endif /* _ACTIONS_H */

+ 0 - 239
gem/at_exit_funcs.c

@@ -1,239 +0,0 @@
-
-/***************************************************************************
- *            at_exit_funcs.c
- *
- *  Mon Apr 18 14:52:20 2005
- *  Copyright  2005  Benjamin Ducke
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "globals.h"
-
-
-/* unset environment variables */
-void exit_env(void)
-{
-
-    /*
-       NOT NECESSARY, as process cannot set env vars of caller anyway and this
-       gives trouble with MINGW compilation, too.
-     */
-
-    /*
-       unsetenv ("GINSTALL_DST");
-       unsetenv ("GINSTALL_INC");
-       unsetenv ("GINSTALL_LIB");   
-       unsetenv ("UNINSTALL_BASE");
-       unsetenv ("GEM_EXT_NAME");
-       unsetenv ("GEM_EXT_VERSION");                
-       unsetenv ("GEM_EXT_DESCR");
-       unsetenv ("GEM_EXT_INFO");
-       unsetenv ("GEM_EXT_DEPS");   
-       unsetenv ("GEM_EXT_BUGS");
-       unsetenv ("GEM_EXT_AUTHORS");
-       unsetenv ("GEM_GRASS_DIR");
-       unsetenv ("GEM_ACTION");
-       unsetenv ("INSTALL_BASE");
-       unsetenv ("INSTALL_TYPE");
-       unsetenv ("GEM_FORCE");
-       unsetenv ("GEM_VERBOSE");
-       unsetenv ("GEM_GUI");
-       unsetenv ("GEM_C_OPTS");
-       unsetenv ("EXT_BASE");
-     */
-}
-
-/* delete temp directory */
-void exit_tmp(void)
-{
-    int error;
-    char tmp[MAXSTR];
-
-    DIR *dir;
-
-    /* if TMPDIR is not set: do not call rmdir! */
-    if (!strcmp(TMPDIR, "")) {
-	TMPCLEAN = 1;
-	return;
-    }
-
-    if (TMPCLEAN == 0) {	/* a dirty trick to make sure this only runs once */
-
-	/* step out of temporary dir, in case this extension has been */
-	/* installed from an archived dir */
-	chdir(CWD);
-
-	sprintf(tmp, "rm -rf %s/*", TMPDIR);
-
-	if (VERBOSE) {
-	    fprintf(stdout, "Removing temporary extension files...");
-	}
-	error = system(tmp);
-
-	sprintf(tmp, "rmdir %s", TMPDIR);
-	error = system(tmp);
-
-	/* check if extension dir still exists and if so: warn */
-	dir = opendir(TMPDIR);
-	if (dir != NULL) {
-	    print_warning
-		("could not remove temporary directory %s.\nPlease remove manually.\n",
-		 TMPDIR);
-	}
-	if (VERBOSE) {
-	    print_done();
-	}
-	TMPCLEAN = 1;
-    }
-}
-
-/* delete temp database */
-void exit_db(void)
-{
-    int error;
-    char tmp[MAXSTR];
-
-    if (TMPDBCLEAN == 0) {	/* a dirty trick to make sure this only runs once */
-
-	/* step out of temporary dir, in case this extension has been */
-	/* installed from an archived dir */
-	chdir(CWD);
-
-	if (VERBOSE) {
-	    fprintf(stdout, "Removing temporary registration files...");
-	}
-
-	if (strcmp(TMPDB, "")) {
-	    sprintf(tmp, "rm -rf %s", TMPDB);
-	    error = system(tmp);
-	    if (error != 0) {
-		print_warning
-		    ("could not remove temporary file %s.\nPlease remove manually.\n",
-		     TMPDB);
-	    }
-	}
-
-	if (strcmp(TMP_GISMAN, "")) {
-	    sprintf(tmp, "rm -f %s", TMP_GISMAN);
-	    error = system(tmp);
-	    if (error != 0) {
-		print_warning
-		    ("could not remove temporary file %s.\nPlease remove manually.\n",
-		     TMP_GISMAN);
-	    }
-	}
-
-	if (strcmp(TMP_DESCR, "")) {
-	    sprintf(tmp, "rm -f %s", TMP_DESCR);
-	    error = system(tmp);
-	    if (error != 0) {
-		print_warning
-		    ("could not remove temporary file %s.\nPlease remove manually.\n",
-		     TMP_DESCR);
-	    }
-	}
-
-	if (strcmp(TMP_INFO, "")) {
-	    sprintf(tmp, "rm -f %s", TMP_INFO);
-	    error = system(tmp);
-	    if (error != 0) {
-		print_warning
-		    ("could not remove temporary file %s.\nPlease remove manually.\n",
-		     TMP_INFO);
-	    }
-	}
-
-	if (strcmp(TMP_DEPS, "")) {
-	    sprintf(tmp, "rm -f %s", TMP_DEPS);
-	    error = system(tmp);
-	    if (error != 0) {
-		print_warning
-		    ("could not remove temporary file %s.\nPlease remove manually.\n",
-		     TMP_INFO);
-	    }
-	}
-
-	if (strcmp(TMP_BUGS, "")) {
-	    sprintf(tmp, "rm -f %s", TMP_BUGS);
-	    error = system(tmp);
-	    if (error != 0) {
-		print_warning
-		    ("could not remove temporary file %s.\nPlease remove manually.\n",
-		     TMP_INFO);
-	    }
-	}
-
-	if (strcmp(TMP_AUTHORS, "")) {
-	    sprintf(tmp, "rm -f %s", TMP_AUTHORS);
-	    error = system(tmp);
-	    if (error != 0) {
-		print_warning
-		    ("could not remove temporary file %s.\nPlease remove manually.\n",
-		     TMP_INFO);
-	    }
-	}
-
-	if (strcmp(TMP_HTML, "")) {
-	    sprintf(tmp, "rm -f %s", TMP_HTML);
-	    error = system(tmp);
-	    if (error != 0) {
-		print_warning
-		    ("could not remove temporary file %s.\nPlease remove manually.\n",
-		     TMP_HTML);
-	    }
-	}
-
-	if (!VERBOSE) {
-	    if (strcmp(TMP_NULL, "")) {
-		sprintf(tmp, "rm -f %s", TMP_NULL);
-		error = system(tmp);
-		if (error != 0) {
-		    print_warning
-			("could not remove temporary file %s.\nPlease remove manually.\n",
-			 TMP_NULL);
-		}
-	    }
-	}
-
-	if (VERBOSE) {
-	    print_done();
-	}
-	TMPDBCLEAN = 1;
-    }
-}
-
-/* show a message at end of program */
-void exit_msg(void)
-{
-    if (ERROR < 0) {
-	fprintf(stdout,
-		"Program exited with an error (code %i). Operation aborted.\n",
-		ERROR);
-    }
-    else {
-	if (WARNINGS == 1) {
-	    fprintf(stdout,
-		    "Job done but there was one warning. Please check.\n");
-	}
-	if (WARNINGS > 1) {
-	    fprintf(stdout,
-		    "Job done but there were %i warnings. Please check.\n",
-		    WARNINGS);
-	}
-    }
-}

+ 0 - 36
gem/at_exit_funcs.h

@@ -1,36 +0,0 @@
-
-/***************************************************************************
- *            at_exit_funcs.h
- *
- *  Mon Apr 18 14:55:36 2005
- *  Copyright  2005  Benjamin Ducke
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _AT_EXIT_FUNCS_H
-#define _AT_EXIT_FUNCS_H
-
-void exit_env(void);
-
-void exit_tmp(void);
-
-void exit_db(void);
-
-void exit_msg(void);
-
-#endif /* _AT_EXIT_FUNCS_H */

File diff suppressed because it is too large
+ 0 - 4378
gem/docs/GEM-Manual.lyx


File diff suppressed because it is too large
+ 0 - 1336
gem/docs/GEM-Manual.tex


+ 0 - 30
gem/docs/GEM-Manual/GEM-Manual.css

@@ -1,30 +0,0 @@
-/* Century Schoolbook font is very similar to Computer Modern Math: cmmi */
-.MATH    { font-family: "Century Schoolbook", serif; }
-.MATH I  { font-family: "Century Schoolbook", serif; font-style: italic }
-.BOLDMATH { font-family: "Century Schoolbook", serif; font-weight: bold }
-
-/* implement both fixed-size and relative sizes */
-SMALL.XTINY		{ font-size : xx-small }
-SMALL.TINY		{ font-size : x-small  }
-SMALL.SCRIPTSIZE	{ font-size : smaller  }
-SMALL.FOOTNOTESIZE	{ font-size : small    }
-SMALL.SMALL		{  }
-BIG.LARGE		{  }
-BIG.XLARGE		{ font-size : large    }
-BIG.XXLARGE		{ font-size : x-large  }
-BIG.HUGE		{ font-size : larger   }
-BIG.XHUGE		{ font-size : xx-large }
-
-/* heading styles */
-H1		{  }
-H2		{  }
-H3		{  }
-H4		{  }
-H5		{  }
-
-/* mathematics styles */
-DIV.displaymath		{ }	/* math displays */
-TD.eqno			{ }	/* equation-number cells */
-
-
-/* document-specific styles come next */

File diff suppressed because it is too large
+ 0 - 2394
gem/docs/GEM-Manual/GEM-Manual.html


+ 0 - 10
gem/docs/GEM-Manual/WARNINGS

@@ -1,10 +0,0 @@
-No implementation found for style `pslatex'
-No implementation found for style `fontenc'
-No implementation found for style `geometry'
-No implementation found for style `calc'
-No implementation found for style `setspace'
-No implementation found for style `url'
-
-redefining command \url 
-
-previous meaning of \url will be lost

+ 0 - 5
gem/docs/GEM-Manual/images.aux

@@ -1,5 +0,0 @@
-\relax 
-\select@language{english}
-\@writefile{toc}{\select@language{english}}
-\@writefile{lof}{\select@language{english}}
-\@writefile{lot}{\select@language{english}}

+ 0 - 240
gem/docs/GEM-Manual/images.log

@@ -1,240 +0,0 @@
-This is TeX, Version 3.14159 (Web2C 7.4.5) (format=latex 2006.3.18)  10 JUL 2006 18:57
-**./images.tex
-(./images.tex
-LaTeX2e <2001/06/01>
-Babel <v3.7h> and hyphenation patterns for american, french, german, ngerman, n
-ohyphenation, loaded.
-
-(/usr/share/texmf/tex/latex/base/article.cls
-Document Class: article 2001/04/21 v1.4e Standard LaTeX document class
-(/usr/share/texmf/tex/latex/base/size11.clo
-File: size11.clo 2001/04/21 v1.4e Standard LaTeX file (size option)
-)
-\c@part=\count79
-\c@section=\count80
-\c@subsection=\count81
-\c@subsubsection=\count82
-\c@paragraph=\count83
-\c@subparagraph=\count84
-\c@figure=\count85
-\c@table=\count86
-\abovecaptionskip=\skip41
-\belowcaptionskip=\skip42
-\bibindent=\dimen102
-) (/usr/share/texmf/tex/latex/base/ifthen.sty
-Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
-) (/usr/share/texmf/tex/latex/misc/pslatex.sty
-Package: pslatex 1996/07/24 v1.2 pslatex emulation (DPC)
-LaTeX Font Info:    Redeclaring symbol font `operators' on input line 65.
-LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
-(Font)                  OT1/cmr/m/n --> OT1/ptmcm/m/n on input line 65.
-LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
-(Font)                  OT1/cmr/bx/n --> OT1/ptmcm/m/n on input line 65.
-LaTeX Font Info:    Redeclaring symbol font `letters' on input line 66.
-LaTeX Font Info:    Overwriting symbol font `letters' in version `normal'
-(Font)                  OML/cmm/m/it --> OML/ptmcm/m/it on input line 66.
-LaTeX Font Info:    Overwriting symbol font `letters' in version `bold'
-(Font)                  OML/cmm/b/it --> OML/ptmcm/m/it on input line 66.
-LaTeX Font Info:    Redeclaring symbol font `symbols' on input line 67.
-LaTeX Font Info:    Overwriting symbol font `symbols' in version `normal'
-(Font)                  OMS/cmsy/m/n --> OMS/pzccm/m/n on input line 67.
-LaTeX Font Info:    Overwriting symbol font `symbols' in version `bold'
-(Font)                  OMS/cmsy/b/n --> OMS/pzccm/m/n on input line 67.
-LaTeX Font Info:    Redeclaring symbol font `largesymbols' on input line 68.
-LaTeX Font Info:    Overwriting symbol font `largesymbols' in version `normal'
-(Font)                  OMX/cmex/m/n --> OMX/psycm/m/n on input line 68.
-LaTeX Font Info:    Overwriting symbol font `largesymbols' in version `bold'
-(Font)                  OMX/cmex/m/n --> OMX/psycm/m/n on input line 68.
-\symbold=\mathgroup4
-\symitalic=\mathgroup5
-LaTeX Font Info:    Redeclaring math alphabet \mathbf on input line 74.
-LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `normal'
-(Font)                  OT1/cmr/bx/n --> OT1/ptm/bx/n on input line 74.
-LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `bold'
-(Font)                  OT1/cmr/bx/n --> OT1/ptm/bx/n on input line 74.
-LaTeX Font Info:    Redeclaring math alphabet \mathit on input line 75.
-LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `normal'
-(Font)                  OT1/cmr/m/it --> OT1/ptm/m/it on input line 75.
-LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `bold'
-(Font)                  OT1/cmr/bx/it --> OT1/ptm/m/it on input line 75.
-) (/usr/share/texmf/tex/latex/base/fontenc.sty
-Package: fontenc 2001/06/05 v1.94 Standard LaTeX package
-(/usr/share/texmf/tex/latex/base/t1enc.def
-File: t1enc.def 2001/06/05 v1.94 Standard LaTeX file
-LaTeX Font Info:    Redeclaring font encoding T1 on input line 38.
-)) (/usr/share/texmf/tex/latex/base/inputenc.sty
-Package: inputenc 2001/07/10 v0.99a Input encoding file 
-(/usr/share/texmf/tex/latex/base/latin1.def
-File: latin1.def 2001/07/10 v0.99a Input encoding file 
-)) (/usr/share/texmf/tex/latex/misc/geometry.sty
-Package: geometry 2002/07/08 v3.2 Page Geometry
-(/usr/share/texmf/tex/latex/graphics/keyval.sty
-Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
-\KV@toks@=\toks14
-)
-\Gm@cnth=\count87
-\Gm@cntv=\count88
-\c@Gm@tempcnt=\count89
-\Gm@bindingoffset=\dimen103
-\Gm@wd@mp=\dimen104
-\Gm@odd@mp=\dimen105
-\Gm@even@mp=\dimen106
-\Gm@dimlist=\toks15
-(/usr/share/texmf/tex/latex/config/geometry.cfg
-File: geometry.cfg 2001/06/05 v1.0 teTeX (uncustomised setup)
-)) (/usr/share/texmf/tex/latex/tools/calc.sty
-Package: calc 1998/07/07 v4.1b Infix arithmetic (KKT,FJ)
-\calc@Acount=\count90
-\calc@Bcount=\count91
-\calc@Adimen=\dimen107
-\calc@Bdimen=\dimen108
-\calc@Askip=\skip43
-\calc@Bskip=\skip44
-LaTeX Info: Redefining \setlength on input line 59.
-LaTeX Info: Redefining \addtolength on input line 60.
-\calc@denominator=\count92
-) (/usr/share/texmf/tex/latex/graphics/color.sty
-Package: color 1999/02/16 v1.0i Standard LaTeX Color (DPC)
-(/usr/share/texmf/tex/latex/config/color.cfg
-File: color.cfg 2001/08/31 v1.1 color configuration of teTeX/TeXLive
-)
-Package color Info: Driver file: dvips.def on input line 125.
-(/usr/share/texmf/tex/latex/graphics/dvips.def
-File: dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
-) (/usr/share/texmf/tex/latex/graphics/dvipsnam.def
-File: dvipsnam.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
-)) (/usr/share/texmf/tex/latex/misc/setspace.sty
-Package: setspace 2000/12/01 6.7 Contributed and Supported LaTeX2e package
-Package: `setspace' 6.7 <2000/12/01>
-) (/usr/share/texmf/tex/latex/html/url.sty
-Package: url 1999/03/02  ver 1.4  Verb mode for urls, email addresses, and file
- names
-) (/usr/share/texmf/tex/generic/babel/babel.sty
-Package: babel 2001/03/01 v3.7h The Babel package
-(/usr/share/texmf/tex/generic/babel/english.ldf
-Language: english 2001/04/15 v3.3l English support from the babel system
-(/usr/share/texmf/tex/generic/babel/babel.def
-File: babel.def 2001/03/01 v3.7h Babel common definitions
-\babel@savecnt=\count93
-\U@D=\dimen109
-)
-\l@canadian = a dialect from \language\l@english 
-))
-\sizebox=\box26
-\lthtmlwrite=\write3
-(./images.aux)
-\openout1 = `images.aux'.
-
-LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 148.
-LaTeX Font Info:    ... okay on input line 148.
-LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 148.
-LaTeX Font Info:    ... okay on input line 148.
-LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 148.
-LaTeX Font Info:    ... okay on input line 148.
-LaTeX Font Info:    Checking defaults for OMS/pzccm/m/n on input line 148.
-LaTeX Font Info:    Try loading font information for OMS+pzccm on input line 14
-8.
-(/usr/share/texmf/tex/latex/psnfss/omspzccm.fd
-File: omspzccm.fd 2000/01/03 Fontinst v1.801 font definitions for OMS/pzccm.
-)
-LaTeX Font Info:    ... okay on input line 148.
-LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 148.
-LaTeX Font Info:    ... okay on input line 148.
-LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 148.
-LaTeX Font Info:    ... okay on input line 148.
-
-Package geometry Warning: The marginal notes would fall off the page.
-     Add 12.0945pt and more to the right margin.
-
--------------------- Geometry parameters
-paper: a4paper
-landscape: --
-twocolumn: --
-twoside: --
-asymmetric: --
-h-parts: 56.9055pt, 483.69687pt, 56.9055pt
-v-parts: 71.13188pt, 702.78308pt, 71.13188pt
-hmarginratio: --
-vmarginratio: --
-lines: --
-heightrounded: --
-bindingoffset: 0.0pt
-truedimen: --
-includehead: --
-includefoot: --
-includemp: --
-driver: 
--------------------- Page layout dimensions and switches
-\paperwidth  597.50787pt
-\paperheight 845.04684pt
-\textwidth  349.0pt
-\textheight 731.64497pt
-\oddsidemargin  -15.36449pt
-\evensidemargin -15.36449pt
-\topmargin  0.0pt
-\headheight 0.0pt
-\headsep    0.0pt
-\footskip   0.0pt
-\marginparwidth 59.0pt
-\marginparsep   10.0pt
-\columnsep  10.0pt
-\skip\footins  10.0pt plus 4.0pt minus 2.0pt
-\hoffset 0.0pt
-\voffset 0.0pt
-\mag 1000
-
-(1in=72.27pt, 1cm=28.45pt)
------------------------
-
-latex2htmlLength hsize=349.0pt
-
-latex2htmlLength vsize=731.64497pt
-
-latex2htmlLength hoffset=0.0pt
-
-latex2htmlLength voffset=0.0pt
-
-latex2htmlLength topmargin=0.0pt
-
-latex2htmlLength topskip=0.00003pt
-
-latex2htmlLength headheight=0.0pt
-
-latex2htmlLength headsep=0.0pt
-
-latex2htmlLength parskip=6.0pt plus 2.0pt minus 2.0pt
-
-latex2htmlLength oddsidemargin=-15.36449pt
-
-latex2htmlLength evensidemargin=-15.36449pt
-
-
-Overfull \hbox (6.79999pt too wide) detected at line 188
- [] 
- []
-
-l2hSize :tex2html_wrap1186:10.82399pt::55.26086pt::349.0pt.
-[1
-
-
-
-]
-Overfull \hbox (6.79999pt too wide) detected at line 204
- [] 
- []
-
-l2hSize :tex2html_wrap1268:10.82399pt::88.2544pt::349.0pt.
-[2
-
-
-] (./images.aux) ) 
-Here is how much of TeX's memory you used:
- 1807 strings out of 95847
- 22464 string characters out of 1195948
- 69635 words of memory out of 1000001
- 4758 multiletter control sequences out of 10000+50000
- 7803 words of font info for 18 fonts, out of 500000 for 1000
- 14 hyphenation exceptions out of 1000
- 25i,5n,21p,203b,262s stack positions out of 1500i,500n,5000p,200000b,5000s
-
-Output written on images.dvi (2 pages, 1580 bytes).

+ 0 - 180
gem/docs/GEM-Manual/images.pl

@@ -1,180 +0,0 @@
-# LaTeX2HTML 2002-2-1 (1.71)
-# Associate images original text with physical files.
-
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>28Note:anextensioCdevelopmenttoolsinstalled.<comment_mark>29minipage{}<comment_mark>30;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="180" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img6.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: an extension ...
-...and avoiding the need
-to have C development tools installed. %
-\end{minipage}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>24Note:inordertoisinganinternetsearchengine.<comment_mark>25minipage{}<comment_mark>26;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="236" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img5.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: in order to i...
-...to locate
-a copy for your OS using an internet search engine.%
-\end{minipage}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>44Note:pleasealwarovidelicensinginformation!<comment_mark>45minipage{}<comment_mark>46;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="26" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img10.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: please always provide licensing information!%
-\end{minipage}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>72Note:ifyouwantttheMacOSXinstallationmedia.<comment_mark>73minipage{}<comment_mark>74;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="79" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img17.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: if you want t...
-...GNU C development tools from the Mac OS X installation media.%
-\end{minipage}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>64Note:duetogreatnzoMoretti'sGRASSforMacOSX.<comment_mark>65minipage{}<comment_mark>66;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="102" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img15.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: due to great ...
-...orms such as Cygwin
-and Lorenzo Moretti's GRASS for Mac OS X.%
-\end{minipage}}%">|; 
-
-$key = q/framebox{parbox[t][1totalheight]{1columnwidth}{<comment_mark>20Note:OperationofGdsectionA.2onWindowsspecificissues.<comment_mark>21}}<comment_mark>22;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="53" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img4.png"
- ALT="\framebox{\parbox[t][1\totalheight]{1\columnwidth}{%
-Note: Operation of GEM unde...
-...' or {}\lq\lq -verbose'')! Please read section A.2
-on Windows specific issues.%
-}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>68Note:ifyourexteingdevelopertoolsinstalled!<comment_mark>69minipage{}<comment_mark>70;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="128" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img16.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: if your exten...
-...stall those scripts without having developer tools installed!%
-\end{minipage}}%">|; 
-
-$key = q/framebox{parbox[t][1totalheight]{1columnwidth}{<comment_mark>16Note:ifconfiguratofindthePostgreSQLsoftware.<comment_mark>17}}<comment_mark>18;LFS=11;FSF=1.6;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="158" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img3.png"
- ALT="\framebox{\parbox[t][1\totalheight]{1\columnwidth}{%
-Note: if configuration fail...
-...use national language
-support but not try to find the PostgreSQL software.%
-}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>60Note:beverycaregeitcandototheuser'ssystem!<comment_mark>61minipage{}<comment_mark>62;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="105" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img14.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: be very caref...
-...ere is
-no limit to the damage it can do to the user's system!%
-\end{minipage}}%">|; 
-
-$key = q/framebox{parbox[t][1totalheight]{1columnwidth}{<comment_mark>76Note:OperationofGisinterfereswithGEM'smessagehiding.<comment_mark>77}}<comment_mark>78;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="79" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img18.png"
- ALT="\framebox{\parbox[t][1\totalheight]{1\columnwidth}{%
-Note: Operation of GEM unde...
-...nnot redirect output to stderr. This interferes with GEM's message
-hiding.%
-}}%">|; 
-
-$key = q/framebox{parbox[t][1totalheight]{1columnwidth}{<comment_mark>8Note:pleasemakesuretoconsultyoursystem'sadministrator.<comment_mark>9}}<comment_mark>10;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="105" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img1.png"
- ALT="\framebox{\parbox[t][1\totalheight]{1\columnwidth}{%
-Note: please make sure that...
-...ning \emph{ldconfig}. You may have to consult your system's
-administrator.%
-}}%">|; 
-
-$key = q/framebox{parbox[t][1totalheight]{1columnwidth}{<comment_mark>12Note:pleasebeawardpackage.Seesection4forhowtodothis.<comment_mark>13}}<comment_mark>14;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="53" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img2.png"
- ALT="\framebox{\parbox[t][1\totalheight]{1\columnwidth}{%
-Note: please be aware that ...
-...modules in a specially
-prepared package. See section 4 for how to do this.%
-}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>40Note:the{}``--t,usethe{}``--force''option.<comment_mark>41minipage{}<comment_mark>42;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="105" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img9.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: the {}\lq\lq -tes...
-...mpilation. If this annoys, you, use the {}\lq\lq -force'' option.%
-\end{minipage}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>56Note:beverycareaminimumifyouhavetomakeany.<comment_mark>57minipage{}<comment_mark>58;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="105" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img13.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: be very caref...
-...ry to keep
-your changes to a minimum if you have to make any.%
-\end{minipage}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>48Note:allotherthsHTMLtags,eveniftheyarenot!<comment_mark>49minipage{}<comment_mark>50;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="53" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img11.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: all other thi...
-...\lq &gt;'' will be filtered
-out as HTML tags, even if they are not!%
-\end{minipage}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>36Note:ifyourextefileinyourextensionpackage.<comment_mark>37minipage{}<comment_mark>38;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="79" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img8.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: if your exten...
-...ed to adapt the top-level Makefile
-in your extension package.%
-\end{minipage}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>52Note:yourmodulet{..slash..slashhtmlslash}.<comment_mark>53minipage{}<comment_mark>54;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="79" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img12.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: your modules'...
-...hat are not part of the extension with \texttt{../../html/}. %
-\end{minipage}}%">|; 
-
-$key = q/framebox{minipage{[t][1totalheight]{1columnwidth}<comment_mark>32Note:AwfuldetaittheendoftheGEMcommandline!<comment_mark>33minipage{}<comment_mark>34;LFS=11;AAT/;
-$cached_env_img{$key} = q|<IMG
- WIDTH="566" HEIGHT="53" ALIGN="BOTTOM" BORDER="0"
- SRC="|."$dir".q|img7.png"
- ALT="\framebox{\begin{minipage}[t][1\totalheight]{1\columnwidth}%
-Note: Awful detail:...
-...query='' and it has to be at the end of
-the GEM command line!%
-\end{minipage}}%">|; 
-
-1;
-

+ 0 - 247
gem/docs/GEM-Manual/images.tex

@@ -1,247 +0,0 @@
-\batchmode
-
-\documentclass[11pt,english]{article}
-\RequirePackage{ifthen}
-
-
-\usepackage{pslatex}
-\usepackage[T1]{fontenc}
-\usepackage[latin1]{inputenc}
-\usepackage{geometry}
-\geometry{verbose,a4paper,tmargin=2.5cm,bmargin=2.5cm,lmargin=2cm,rmargin=2cm}
-\setcounter{secnumdepth}{2}
-\setcounter{tocdepth}{2}
-
-\setlength \parskip{\medskipamount}
-
-\setlength \parindent{0pt}
-\usepackage{calc}
-\usepackage{color}
-\usepackage{setspace}
-\onehalfspacing
-\IfFileExists{url.sty}{\usepackage{url}}
-                      {%
-\providecommand{\url}{\texttt} }
-
-
-\makeatletter
-
-%
-\newenvironment{lyxcode}{\begin{list}{}{
-\setlength{\rightmargin}{\leftmargin}
-\setlength{\listparindent}{0pt}% needed for AMS classes
-\raggedright
-\setlength{\itemsep}{0pt}
-\setlength{\parsep}{0pt}
-\normalfont\ttfamily}%
- \item[]}
-{\end{list}} 
-
-
-\usepackage{babel}
-\makeatother
-
-
-
-\pagecolor[gray]{.7}
-
-\usepackage[]{inputenc}
-
-
-
-\makeatletter
-
-\makeatletter
-\count@=\the\catcode`\_ \catcode`\_=8 
-\newenvironment{tex2html_wrap}{}{}%
-\catcode`\<=12\catcode`\_=\count@
-\newcommand{\providedcommand}[1]{\expandafter\providecommand\csname #1\endcsname}%
-\newcommand{\renewedcommand}[1]{\expandafter\providecommand\csname #1\endcsname{}%
-  \expandafter\renewcommand\csname #1\endcsname}%
-\newcommand{\newedenvironment}[1]{\newenvironment{#1}{}{}\renewenvironment{#1}}%
-\let\newedcommand\renewedcommand
-\let\renewedenvironment\newedenvironment
-\makeatother
-\let\mathon=$
-\let\mathoff=$
-\ifx\AtBeginDocument\undefined \newcommand{\AtBeginDocument}[1]{}\fi
-\newbox\sizebox
-\setlength{\hoffset}{0pt}\setlength{\voffset}{0pt}
-\addtolength{\textheight}{\footskip}\setlength{\footskip}{0pt}
-\addtolength{\textheight}{\topmargin}\setlength{\topmargin}{0pt}
-\addtolength{\textheight}{\headheight}\setlength{\headheight}{0pt}
-\addtolength{\textheight}{\headsep}\setlength{\headsep}{0pt}
-\setlength{\textwidth}{349pt}
-\newwrite\lthtmlwrite
-\makeatletter
-\let\realnormalsize=\normalsize
-\global\topskip=2sp
-\def\preveqno{}\let\real@float=\@float \let\realend@float=\end@float
-\def\@float{\let\@savefreelist\@freelist\real@float}
-\def\liih@math{\ifmmode$\else\bad@math\fi}
-\def\end@float{\realend@float\global\let\@freelist\@savefreelist}
-\let\real@dbflt=\@dbflt \let\end@dblfloat=\end@float
-\let\@largefloatcheck=\relax
-\let\if@boxedmulticols=\iftrue
-\def\@dbflt{\let\@savefreelist\@freelist\real@dbflt}
-\def\adjustnormalsize{\def\normalsize{\mathsurround=0pt \realnormalsize
- \parindent=0pt\abovedisplayskip=0pt\belowdisplayskip=0pt}%
- \def\phantompar{\csname par\endcsname}\normalsize}%
-\def\lthtmltypeout#1{{\let\protect\string \immediate\write\lthtmlwrite{#1}}}%
-\newcommand\lthtmlhboxmathA{\adjustnormalsize\setbox\sizebox=\hbox\bgroup\kern.05em }%
-\newcommand\lthtmlhboxmathB{\adjustnormalsize\setbox\sizebox=\hbox to\hsize\bgroup\hfill }%
-\newcommand\lthtmlvboxmathA{\adjustnormalsize\setbox\sizebox=\vbox\bgroup %
- \let\ifinner=\iffalse \let\)\liih@math }%
-\newcommand\lthtmlboxmathZ{\@next\next\@currlist{}{\def\next{\voidb@x}}%
- \expandafter\box\next\egroup}%
-\newcommand\lthtmlmathtype[1]{\gdef\lthtmlmathenv{#1}}%
-\newcommand\lthtmllogmath{\dimen0\ht\sizebox \advance\dimen0\dp\sizebox
-  \ifdim\dimen0>.95\vsize
-   \lthtmltypeout{%
-*** image for \lthtmlmathenv\space is too tall at \the\dimen0, reducing to .95 vsize ***}%
-   \ht\sizebox.95\vsize \dp\sizebox\z@ \fi
-  \lthtmltypeout{l2hSize %
-:\lthtmlmathenv:\the\ht\sizebox::\the\dp\sizebox::\the\wd\sizebox.\preveqno}}%
-\newcommand\lthtmlfigureA[1]{\let\@savefreelist\@freelist
-       \lthtmlmathtype{#1}\lthtmlvboxmathA}%
-\newcommand\lthtmlpictureA{\bgroup\catcode`\_=8 \lthtmlpictureB}%
-\newcommand\lthtmlpictureB[1]{\lthtmlmathtype{#1}\egroup
-       \let\@savefreelist\@freelist \lthtmlhboxmathB}%
-\newcommand\lthtmlpictureZ[1]{\hfill\lthtmlfigureZ}%
-\newcommand\lthtmlfigureZ{\lthtmlboxmathZ\lthtmllogmath\copy\sizebox
-       \global\let\@freelist\@savefreelist}%
-\newcommand\lthtmldisplayA{\bgroup\catcode`\_=8 \lthtmldisplayAi}%
-\newcommand\lthtmldisplayAi[1]{\lthtmlmathtype{#1}\egroup\lthtmlvboxmathA}%
-\newcommand\lthtmldisplayB[1]{\edef\preveqno{(\theequation)}%
-  \lthtmldisplayA{#1}\let\@eqnnum\relax}%
-\newcommand\lthtmldisplayZ{\lthtmlboxmathZ\lthtmllogmath\lthtmlsetmath}%
-\newcommand\lthtmlinlinemathA{\bgroup\catcode`\_=8 \lthtmlinlinemathB}
-\newcommand\lthtmlinlinemathB[1]{\lthtmlmathtype{#1}\egroup\lthtmlhboxmathA
-  \vrule height1.5ex width0pt }%
-\newcommand\lthtmlinlineA{\bgroup\catcode`\_=8 \lthtmlinlineB}%
-\newcommand\lthtmlinlineB[1]{\lthtmlmathtype{#1}\egroup\lthtmlhboxmathA}%
-\newcommand\lthtmlinlineZ{\egroup\expandafter\ifdim\dp\sizebox>0pt %
-  \expandafter\centerinlinemath\fi\lthtmllogmath\lthtmlsetinline}
-\newcommand\lthtmlinlinemathZ{\egroup\expandafter\ifdim\dp\sizebox>0pt %
-  \expandafter\centerinlinemath\fi\lthtmllogmath\lthtmlsetmath}
-\newcommand\lthtmlindisplaymathZ{\egroup %
-  \centerinlinemath\lthtmllogmath\lthtmlsetmath}
-\def\lthtmlsetinline{\hbox{\vrule width.1em \vtop{\vbox{%
-  \kern.1em\copy\sizebox}\ifdim\dp\sizebox>0pt\kern.1em\else\kern.3pt\fi
-  \ifdim\hsize>\wd\sizebox \hrule depth1pt\fi}}}
-\def\lthtmlsetmath{\hbox{\vrule width.1em\kern-.05em\vtop{\vbox{%
-  \kern.1em\kern0.8 pt\hbox{\hglue.17em\copy\sizebox\hglue0.8 pt}}\kern.3pt%
-  \ifdim\dp\sizebox>0pt\kern.1em\fi \kern0.8 pt%
-  \ifdim\hsize>\wd\sizebox \hrule depth1pt\fi}}}
-\def\centerinlinemath{%
-  \dimen1=\ifdim\ht\sizebox<\dp\sizebox \dp\sizebox\else\ht\sizebox\fi
-  \advance\dimen1by.5pt \vrule width0pt height\dimen1 depth\dimen1 
- \dp\sizebox=\dimen1\ht\sizebox=\dimen1\relax}
-
-\def\lthtmlcheckvsize{\ifdim\ht\sizebox<\vsize 
-  \ifdim\wd\sizebox<\hsize\expandafter\hfill\fi \expandafter\vfill
-  \else\expandafter\vss\fi}%
-\providecommand{\selectlanguage}[1]{}%
-\makeatletter \tracingstats = 1 
-
-
-\begin{document}
-\pagestyle{empty}\thispagestyle{empty}\lthtmltypeout{}%
-\lthtmltypeout{latex2htmlLength hsize=\the\hsize}\lthtmltypeout{}%
-\lthtmltypeout{latex2htmlLength vsize=\the\vsize}\lthtmltypeout{}%
-\lthtmltypeout{latex2htmlLength hoffset=\the\hoffset}\lthtmltypeout{}%
-\lthtmltypeout{latex2htmlLength voffset=\the\voffset}\lthtmltypeout{}%
-\lthtmltypeout{latex2htmlLength topmargin=\the\topmargin}\lthtmltypeout{}%
-\lthtmltypeout{latex2htmlLength topskip=\the\topskip}\lthtmltypeout{}%
-\lthtmltypeout{latex2htmlLength headheight=\the\headheight}\lthtmltypeout{}%
-\lthtmltypeout{latex2htmlLength headsep=\the\headsep}\lthtmltypeout{}%
-\lthtmltypeout{latex2htmlLength parskip=\the\parskip}\lthtmltypeout{}%
-\lthtmltypeout{latex2htmlLength oddsidemargin=\the\oddsidemargin}\lthtmltypeout{}%
-\makeatletter
-\if@twoside\lthtmltypeout{latex2htmlLength evensidemargin=\the\evensidemargin}%
-\else\lthtmltypeout{latex2htmlLength evensidemargin=\the\oddsidemargin}\fi%
-\lthtmltypeout{}%
-\makeatother
-\setcounter{page}{1}
-\onecolumn
-
-% !!! IMAGES START HERE !!!
-
-\setcounter{secnumdepth}{2}
-\setcounter{tocdepth}{2}
-\stepcounter{section}
-\stepcounter{section}
-\stepcounter{section}
-\stepcounter{subsection}
-\stepcounter{subsection}
-{\newpage\clearpage
-\lthtmlpictureA{tex2html_wrap1186}%
-\framebox{\parbox[t][1\totalheight]{1\columnwidth}{%
-Note: please make sure that you system-wide linker path includes the
-location of the GRASS dynamic libraries (e.g. \emph{/usr/local/grass-6.1.cvs/libs}).
-This is usually done by adding an appropriate entry to \emph{/etc/ld.so.conf}
-and running \emph{ldconfig}. You may have to consult your system's
-administrator.%
-}}%
-%
-\lthtmlpictureZ
-\lthtmlcheckvsize\clearpage}
-
-\stepcounter{subsection}
-{\newpage\clearpage
-\lthtmlpictureA{tex2html_wrap1268}%
-\framebox{\parbox[t][1\totalheight]{1\columnwidth}{%
-Note: if configuration fails, this is likely due to your operating
-system missing some external default software (such as the PostgreSQL
-database). You can use GEM's {}``--configure='' option to pass the
-same options that you passed to the GRASS configuration script (use
-quotation marks for more than one option), e.g. --configure='--with-nls
---without-postgres' will configure the extension to use national language
-support but not try to find the PostgreSQL software.%
-}}%
-%
-\lthtmlpictureZ
-\lthtmlcheckvsize\clearpage}
-
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{section}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsubsection}
-\stepcounter{subsubsection}
-\stepcounter{subsubsection}
-\stepcounter{subsubsection}
-\stepcounter{subsubsection}
-\appendix
-\stepcounter{section}
-\stepcounter{subsection}
-\stepcounter{subsection}
-\stepcounter{subsubsection}
-\stepcounter{section}
-\stepcounter{subsection}
-\stepcounter{subsubsection}
-\stepcounter{subsubsection}
-\stepcounter{subsection}
-\stepcounter{subsubsection}
-\stepcounter{subsubsection}
-\stepcounter{subsubsection}
-\stepcounter{subsubsection}
-\stepcounter{subsubsection}
-\stepcounter{subsubsection}
-\stepcounter{subsubsection}
-\stepcounter{subsection}
-\stepcounter{subsection}
-
-\end{document}

BIN
gem/docs/GEM-Manual/img1.old


BIN
gem/docs/GEM-Manual/img1.png


BIN
gem/docs/GEM-Manual/img10.png


BIN
gem/docs/GEM-Manual/img11.png


BIN
gem/docs/GEM-Manual/img12.png


BIN
gem/docs/GEM-Manual/img13.png


BIN
gem/docs/GEM-Manual/img14.png


BIN
gem/docs/GEM-Manual/img15.png


BIN
gem/docs/GEM-Manual/img16.png


BIN
gem/docs/GEM-Manual/img17.png


BIN
gem/docs/GEM-Manual/img18.png


BIN
gem/docs/GEM-Manual/img2.png


BIN
gem/docs/GEM-Manual/img3.png


BIN
gem/docs/GEM-Manual/img4.png


BIN
gem/docs/GEM-Manual/img5.png


BIN
gem/docs/GEM-Manual/img6.png


BIN
gem/docs/GEM-Manual/img7.png


BIN
gem/docs/GEM-Manual/img8.png


BIN
gem/docs/GEM-Manual/img9.png


File diff suppressed because it is too large
+ 0 - 2394
gem/docs/GEM-Manual/index.html


+ 0 - 58
gem/docs/GEM-Manual/internals.pl

@@ -1,58 +0,0 @@
-# LaTeX2HTML 2002-2-1 (1.71)
-# Associate internals original text with physical files.
-
-
-$key = q/sub:Arranging-the-Source/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:GEM-Developers_-Support/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Basic-Usage/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:GRASS-under-Windows/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Version-Information/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:The-Skeleton-Package/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Developers_-Guidelines/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Mac-OS-X/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Installation-of-Pre-compiled/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sec:Developing-Extensions-for/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sec:OS-Specific-Issues/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Providing-GUI-Hooks/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Program-Installation/;
-$ref_files{$key} = "$dir".q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-1;
-

+ 0 - 117
gem/docs/GEM-Manual/labels.pl

@@ -1,117 +0,0 @@
-# LaTeX2HTML 2002-2-1 (1.71)
-# Associate labels original text with physical files.
-
-
-$key = q/sub:Arranging-the-Source/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:GEM-Developers_-Support/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Basic-Usage/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:GRASS-under-Windows/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Version-Information/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:The-Skeleton-Package/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Developers_-Guidelines/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Mac-OS-X/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Installation-of-Pre-compiled/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sec:Developing-Extensions-for/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sec:OS-Specific-Issues/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Providing-GUI-Hooks/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Program-Installation/;
-$external_labels{$key} = "$URL/" . q|GEM-Manual.html|; 
-$noresave{$key} = "$nosave";
-
-1;
-
-
-# LaTeX2HTML 2002-2-1 (1.71)
-# labels from external_latex_labels array.
-
-
-$key = q/sub:Arranging-the-Source/;
-$external_latex_labels{$key} = q|4.3|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:GEM-Developers_-Support/;
-$external_latex_labels{$key} = q|4.1|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Basic-Usage/;
-$external_latex_labels{$key} = q|3.4|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:GRASS-under-Windows/;
-$external_latex_labels{$key} = q|A.2|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Version-Information/;
-$external_latex_labels{$key} = q|4.5|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:The-Skeleton-Package/;
-$external_latex_labels{$key} = q|4.2|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Developers_-Guidelines/;
-$external_latex_labels{$key} = q|4.12|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Mac-OS-X/;
-$external_latex_labels{$key} = q|A.1|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Installation-of-Pre-compiled/;
-$external_latex_labels{$key} = q|3.5|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sec:Developing-Extensions-for/;
-$external_latex_labels{$key} = q|4|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sec:OS-Specific-Issues/;
-$external_latex_labels{$key} = q|A|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Providing-GUI-Hooks/;
-$external_latex_labels{$key} = q|4.7|; 
-$noresave{$key} = "$nosave";
-
-$key = q/sub:Program-Installation/;
-$external_latex_labels{$key} = q|3.1|; 
-$noresave{$key} = "$nosave";
-
-1;
-

+ 0 - 18
gem/docs/make-html.sh

@@ -1,18 +0,0 @@
-#!/bin/sh
-
-echo "Did you export a fresh .tex file from LyX first?"
-echo
-rm -rf GEM-Manual
-rm -f index.html
-latex GEM-Manual.tex
-latex GEM-Manual.tex
-latex GEM-Manual.tex
-
-latex2html -split 0 -show_section_numbers -image_type gif GEM-Manual.tex
-
-rm -f GEM-Manual.aux
-rm -f GEM-Manual.dvi
-rm -f GEM-Manual.log
-rm -f GEM-Manual.toc
-
-rm -f *~

+ 0 - 73
gem/error.c

@@ -1,73 +0,0 @@
-
-/***************************************************************************
- *            error.c
- *
- *  Mon Apr 18 15:00:13 2005
- *  Copyright  2005  Benjamin Ducke
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <stdarg.h>
-
-#include "globals.h"
-
-/*
-   Displays an error message
- */
-void print_error(int err_code, char *msg, ...)
-{
-    char buffer[MAXSTR];
-    va_list ap;
-
-    va_start(ap, msg);
-    vsprintf(buffer, msg, ap);
-    va_end(ap);
-
-    fprintf(stderr, "\033[1;31m\nERROR:\033[0m %s", buffer);
-
-    ERROR = err_code;
-
-    exit(err_code);
-}
-
-
-/*
-   Displays a warning message
- */
-void print_warning(char *msg, ...)
-{
-    char buffer[MAXSTR];
-    va_list ap;
-
-    va_start(ap, msg);
-    vsprintf(buffer, msg, ap);
-    va_end(ap);
-
-    fprintf(stderr, "\033[0;33m\nWARNING:\033[0m %s", buffer);
-
-    WARNINGS = WARNINGS + 1;
-}
-
-
-/*
-   Prints a fancy "DONE." on the screen
- */
-void print_done(void)
-{
-    fprintf(stdout, "\033[0;32mDONE.\n\033[0m");
-}

+ 0 - 35
gem/error.h

@@ -1,35 +0,0 @@
-
-/***************************************************************************
- *            tools.h
- *
- *  Mon Apr 18 15:04:11 2005
- *  Copyright  2005  Benjamin Ducke
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _ERROR_H
-#define _ERROR_H
-
-void print_error(int err_code, char *msg, ...)
-    __attribute__ ((format(printf, 2, 3)));
-
-void print_warning(char *msg, ...) __attribute__ ((format(printf, 1, 2)));
-
-void print_done(void);
-
-#endif /* _ERROR_H */

+ 0 - 183
gem/globals.h

@@ -1,183 +0,0 @@
-
-/***************************************************************************
- *            globals.h
- *
- *  Mon Apr 18 15:04:11 2005
- *  Copyright  2005  Benjamin Ducke
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef _GLOBALS_H
-#define _GLOBALS_H
-
-/* put a 
-   #define LOCAL
-   into main.c ! */
-
-#ifdef LOCAL
-#define EXTERN
-#else
-#define EXTERN extern
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include "at_exit_funcs.h"
-#include "error.h"
-#include "tools.h"
-#include "reg_deps.h"
-#include "reg_entries.h"
-#include "reg_html.h"
-#include "actions.h"
-
-
-#define PROGVERSION 1.03
-
-#define MAXSTR 2048		/* maximum length of strings this program handles */
-
-/* possible actions */
-#define NONE 0
-#define HELP 1
-#define VERSION 2
-#define INSTALL 3
-#define BIN_INSTALL 4
-#define QUERY 5
-#define CLEAN 6
-#define LICENSE 7
-#define TEST_INSTALL 8
-#define DETAILS 9
-#define UNINSTALL 10
-#define RESTORE 11
-#define LIST 12
-
-/* error codes */
-#define ERR_INVOCATION -1
-#define ERR_NO_ACCESS_EXT -2
-#define ERR_CONFIGURE_EXT -3
-#define ERR_COMPILE_EXT -4
-#define ERR_INSTALL_EXT -5
-#define ERR_INVALID_EXT -6
-#define ERR_UNPACK_EXT -7
-#define ERR_RM_TMPDIR -8
-#define ERR_MISSING_CMD -9
-#define ERR_NO_LICENSE -10
-#define ERR_VERSION -11
-#define ERR_MISSING_BINS -12
-#define ERR_UNINSTALL_EXT -13
-#define ERR_SU -14
-#define ERR_REGISTER_EXT -15
-#define ERR_EXISTS_EXT -16
-#define ERR_CHECK_DEPS -17
-#define ERR_MISSING_DEPS -18
-#define ERR_DEREGISTER_EXT -19
-#define ERR_DOWNLOAD -20
-#define ERR_REGISTER_ENTRIES_GISMAN -21
-#define ERR_DEREGISTER_ENTRIES_GISMAN -22
-#define ERR_DUMP_PLAIN_TXT -23
-#define ERR_REGISTER_HTML -24
-#define ERR_DEREGISTER_HTML -25
-#define ERR_RESTORE -26
-#define ERR_MISSING_CFG -27
-#define ERR_DUMP_HTML -28
-#define ERR_LIST -29
-#define ERR_TMPFILE -30
-#define ERR_RM_TMPFILE -31
-#define ERR_REGISTER_ENTRIES_GISMAN2 -32
-#define ERR_DEREGISTER_ENTRIES_GISMAN2 -33
-
-#define TYPE_UNKNOWN 0
-#define TAR_GZIP 1
-#define TAR_BZIP2 2
-#define ZIP 3
-#define TAR 4
-
-#define TOKEN_SUBMENU 0
-#define TOKEN_ENTRY 1
-#define TOKEN_COMMAND 2
-#define TOKEN_SEPARATOR 3
-
-
-/* ENVIRONMENT VARIABLES */
-EXTERN char GINSTALL_DST[MAXSTR];
-EXTERN char GINSTALL_INC[MAXSTR];
-EXTERN char GINSTALL_LIB[MAXSTR];
-EXTERN char UNINSTALL_BASE[MAXSTR];
-EXTERN char GEM_EXT_NAME[MAXSTR];
-EXTERN char GEM_EXT_VERSION[MAXSTR];
-EXTERN char GEM_EXT_DESCR[MAXSTR];
-EXTERN char GEM_EXT_INFO[MAXSTR];
-EXTERN char GEM_EXT_DEPS[MAXSTR];
-EXTERN char GEM_EXT_BUGS[MAXSTR];
-EXTERN char GEM_EXT_AUTHORS[MAXSTR];
-EXTERN char GEM_GRASS_DIR[MAXSTR];
-EXTERN char GEM_ACTION[MAXSTR];
-EXTERN char INSTALL_BASE[MAXSTR];
-EXTERN char INSTALL_TYPE[MAXSTR];
-EXTERN char GEM_FORCE[MAXSTR];
-EXTERN char GEM_VERBOSE[MAXSTR];
-EXTERN char GEM_GUI[MAXSTR];
-EXTERN char GEM_C_OPTS[MAXSTR];
-EXTERN char EXT_BASE[MAXSTR];
-
-
-/* GLOBAL VARIABLES */
-EXTERN int VERBOSE;
-EXTERN char TMPDIR[MAXSTR];
-EXTERN char TMPDB[MAXSTR];
-EXTERN char TMP_GISMAN[MAXSTR];
-EXTERN char TMP_DESCR[MAXSTR];
-EXTERN char TMP_INFO[MAXSTR];
-EXTERN char TMP_DEPS[MAXSTR];
-EXTERN char TMP_BUGS[MAXSTR];
-EXTERN char TMP_AUTHORS[MAXSTR];
-EXTERN char TMP_NULL[MAXSTR];	/* pipe all output that should be hidden to this file */
-
-EXTERN char TMP_HTML[MAXSTR];
-EXTERN int TMPCLEAN;
-EXTERN int TMPDBCLEAN;
-EXTERN int FORCE;
-EXTERN int UPGRADE;
-EXTERN int SKIP_CFG;
-
-EXTERN char GISMAN_CMD[MAXSTR];
-EXTERN char GISMAN2_CMD[MAXSTR];
-EXTERN char HTML_CMD[MAXSTR];
-EXTERN char QGIS_CMD[MAXSTR];
-EXTERN char UNINSTALL_CMD[MAXSTR];
-EXTERN char CONFIG_OPTS[MAXSTR];
-EXTERN char CONFIG_CMD[MAXSTR];
-EXTERN char MAKE_CMD[MAXSTR];
-
-/* stores current working directory */
-EXTERN char CWD[MAXSTR];
-
-/* this are used to generate a summary message on exit */
-EXTERN int ERROR;		/* error code: set to < 0 on abnormal program exit */
-EXTERN int WARNINGS;		/* number of warnings issued during program run */
-
-
-
-#endif /* _GLOBALS_H */

+ 0 - 858
gem/main.c

@@ -1,858 +0,0 @@
-
-/***************************************************************************
- *            main.c
- *
- *  Mon Apr 18 15:19:04 2005
- *  Copyright  2005  Benjamin Ducke
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-
-/* TODO:
-
-   for 1.04:                    
-
-   EASY STUFF:
-
-
-   - tried to install GeneralStatistics w/o first installing RasterTools or anything else: attempts to install, fails because
-   of missing raster tools headers! Even though line 379 in reg_deps.c should check for this case !!!
-
-   - include $GISBASE/lib in linker path for compilation of extensions [NOT FIXED: see lines preceeding INSTALL action case: 693
-   -L is added to command line, but problems still exist]
-   MAYBE EXPORT LD_LIBRARY_PATH ??? (only add $GISBASE/lib if it does not already exist)
-
-   - version number in HTML documentation index seems to not get updated when installing a newer version of an extension
-
-   - remember to update version number in globals.h
-
-
-   for 1.2 (GRASS 6.4 ?):
-   - make GRASS store its ./configure command line options in a file in the GISBASE/etc directory, so that
-   it will be possible for GEM to automatically configure extensions according to the system setup
-   [this means that configure file needs to be kept in sync with GEM; --configure option can be used
-   to overwrite this behaviour]
-   - configure script should not fail but disable options and create config.msgs the
-   contents of this should be displayed and deleted afterwards
-   - check if it works with this Mac version of GRASS, as well: http://openosx.com/grass/
-   - before release: any problems expected with native Win32-Kompilation?:
-   - location for tmp-files?
-   - a simple wrapper g.install with GRASS style parameters. Should start an xterm and ask for su pwd,
-   if necessary
-   - action to check dependencies of installed extensions
-   - instead of aborting on each failed dependency: build list of all failed
-   dependencies before aborting
-   - mechanism to recursively download and install missing deps from a
-   provided list of URLs
-   - instead of calling external tar, switch to tarlib and zlib
-   - action --validate for checking an extension archive/dir
-   - add link to HTML help index into each extension's submenu in GIS Manager
-   - g.install with a real custom-made GUI
-   [VARIABLE GUI must be set appropriately in run_post() for post script]        
-   this should be an independent Tcl/Tk GUI: install/uninstall/query extensions
-   - extension database on the internet that can be queried and used with either gem
-   or g.install
-   - entries for QGIS
-   - simplified scheme for installing just a single module
-   - new scheme for registering menu entries in GIS Manager with stable hooks in menu.tcl
-
-
-   NEED HELP
-   - GRASS' make install installs all files BENEATH top level dir with UID
-   set to benni !!! Is this intentional?
-   - provide gem7x as link in /usr/local/bin as part of grass 7.x base install
-   - description.html should not contain </body> or </html> as Rules.Make seems
-   to append those ?
-   - source install copies files COPYING README REQUIREMENTS.html to somewhere (but where?)
-   -> into <extension>/src but where else ?     
-   - menu.tcl in GRASS 6.0.0 has "all options 1", but 6.1 will have "all options $tmenu".
-   How to cater for such things? Maybe in the future there should always be an
-   Xtns menu provided by GIS Manager and always delimited by reliable tags
-   - d.m window is a bit to small horizontally
-
-   CAVEATS:
-   - does not allow installation of different versions of the same extension within
-   the same GRASS bin tree
-   - does not have a real upgrading mechanism: option --upgrade has been disabled for now
-   - restore cannot fix partially corrupted entries in HTML and TCL files
-   - Links to other extension's modules will only work if those extensions are installed
-
-   DOCS:
-
-   - skeleton contains GPL as default license. Creators of new extensions
-   need to be aware of this!
-
-   - menu.tcl will be backed up as menu.tcl.gem.bak
-
-   - HTML docs: users must prefix references to GRASS modules outside the Extension with
-   "../../html/" !!!    
-   - description files: things inside "<" and ">" will be filtered out as HTML tags, even
-   if they are none!
-   - make clear that there are some files which will be rendered both as text and HTML
-   and therefore need things like <br> while others DO NOT (which ones?)!
-
-   - configure script should not fail but disable options and create 'config.msgs'
-   - deletes config.msg after display
-
-   - State clearly that it is recommended to uninstall an older
-   extension version before installing a new one. STATE CLEARLY that --upgrade is rather
-   another version of --force than a real updating mechanism (RENAME to --newer)
-   - document all env vars that gem sets
-   - STATE CLEARLY, that users should not meddle with stuff in index.html, menu.tcl,
-   gem-entries/ and docs/extensions/ !!!
-   - provide a unix man page, ASCII and HTML documentation (write HTML and convert)
-   - files in the skeleton should always be present, even if they do not containing
-   information
-   - make it clear, that uninstall and postinstall are run with su privileges! thus,
-   author must make sure, that only objects in the GRASS install tree are affected
-   - user may specify either file name or extension name for uninstall action
-   - user may list installed extensions by using -q w/o filename. Explain
-   what is meant by type (e.g. 'src')
-   - uninstallation works only by extension name, NOT file name !
-   - compiling extensions on a GRASS install with all but the most basic options
-   disabled should give very portable binaries! (statically linked binaries?)
-
-   BUGS:
-   - remove cva, install again: WARNING: list item 'cva' exists in index.html (?)
-   - superfluous warning upon uninstall of extension w/o "entries-gisman"
-   - due to bad command line parsing, listing installed extensions only works like this:
-   ./gem70 --grass=/usr/local/grass-7.0.svn -q
-   NOT like this:
-   ./gem70 -q --grass=/usr/local/grass-7.0.svn
-
-
- */
-
-#include <getopt.h>
-#include <fcntl.h>
-
-#define LOCAL
-#include "globals.h"
-
-
-void show_help(void)
-{
-    fprintf(stdout, "Usage: gem70 [OPTION] [ACTION] [FILE|DIR]\n");
-    fprintf(stdout, "Install a GRASS extension from FILE or DIR.\n");
-    fprintf(stdout, "Manage (installed) GRASS extension(s).\n");
-    fprintf(stdout, "\nPossible ACTIONs are:\n");
-    fprintf(stdout, "  -i, --install=EXT\tinstall a GRASS extension\n");
-    fprintf(stdout,
-	    "  -u, --uninstall=EXT\tremove an extension from GRASS\n");
-    fprintf(stdout,
-	    "  -q, --query=EXT\tdisplay information about extension/list installed\n");
-    fprintf(stdout,
-	    "  -d, --details=EXT\tdisplay additional details about an extension\n");
-    fprintf(stdout,
-	    "  -c, --clean=EXT\tclean extension's source code directories\n");
-    fprintf(stdout,
-	    "  -t, --test=EXT\tconfigure and compile extension, but don't install\n");
-    fprintf(stdout,
-	    "  -l, --license=EXT\tshow copyright information for an extension\n");
-    fprintf(stdout,
-	    "  -r, --restore\t\trecreate HTML links and GIS Manager entries\n");
-    fprintf(stdout, "  -h, --help\t\tdisplay this help and exit\n");
-    fprintf(stdout,
-	    "  -V, --version\t\toutput version information and exit\n\n");
-    fprintf(stdout, "\nPossible OPTIONs are:\n");
-    fprintf(stdout, "  -g, --grass=PATH\tpath to GRASS installation dir\n");
-    fprintf(stdout,
-	    "  -b, --binary=NAME\tno compilation: use binary files for system NAME\n");
-    fprintf(stdout,
-	    "  -f, --force\t\tforce action, regardless of dependencies\n");
-    fprintf(stdout,
-	    "  -v, --verbose\t\tdisplay detailed status information\n");
-    fprintf(stdout, "  -s, --skip-config\tskip configure script\n");
-    fprintf(stdout,
-	    "  -x, --config-opts=OPTS\tpass OPTS to configure script\n");
-    fprintf(stdout,
-	    "  -o, --options=OPTS\toptions to pass to the C compiler/linker\n");
-    fprintf(stdout,
-	    "  -C, --config-cmd=CMD\tDefine custom 'configure' command (default=configure)\n");
-    fprintf(stdout,
-	    "  -m, --make-cmd=CMD\tDefine custom 'make' command (default=make)\n");
-    fprintf(stdout,
-	    "\nWhen run from within a GRASS session, locations of libs, header files\n");
-    fprintf(stdout,
-	    "and installation target dir will be assumed to match those of the active\n");
-    fprintf(stdout, "GRASS version. ");
-    fprintf(stdout,
-	    "Option -g can be used to override these or install extensions\nfrom outside");
-    fprintf(stdout, "of a GRASS session.\n");
-    fprintf(stdout,
-	    "Per default, extensions will be compiled from source and then installed.\n");
-    fprintf(stdout,
-	    "If the exension package contains binaries for the user's platform, they can\n");
-    fprintf(stdout, "be installed instead using the -b option. ");
-    fprintf(stdout,
-	    "For installation from source code, a C compiler and make tools are needed.\n");
-    fprintf(stdout, "\nExample:\n");
-    fprintf(stdout,
-	    "\tgem70 -b macosx --grass=/usr/local/grass-7.0.0 -i myExtension\n");
-    fprintf(stdout,
-	    "Installs the MacOS X binaries for 'myExtension' in /usr/local/grass-7.0.0.\n");
-    exit(0);
-}
-
-
-void show_details(char *package)
-{
-    int error;
-    char tmp[MAXSTR];
-
-    sprintf(tmp, "%s", basename(package));
-    error = chdir(tmp);
-    if (error < 0) {
-	print_error(ERR_NO_ACCESS_EXT,
-		    "extension '%s' not accessible: (%s)\n", package,
-		    strerror(errno));
-    }
-
-    dump_ascii("info", "Detailed information");
-
-
-    /* run post action script */
-    system("sh post");
-
-    exit(0);
-}
-
-
-void show_license(char *package)
-{
-    int error;
-    char tmp[MAXSTR];
-
-    sprintf(tmp, "%s", basename(package));
-    error = chdir(tmp);
-    if (error < 0) {
-	print_error(ERR_NO_ACCESS_EXT,
-		    "extension '%s' not accessible: (%s)\n", package,
-		    strerror(errno));
-    }
-
-    dump_ascii("license", "Detailed information");
-
-    /* run post action script */
-    system("sh post");
-
-    exit(0);
-}
-
-
-void show_version(void)
-{
-    fprintf(stdout, "gem70 (GRASS extensions manager) %.2f\n", PROGVERSION);
-    fprintf(stdout, "Written by Benjamin Ducke\n");
-    fprintf(stdout, "\nCopyright (C) 2005 Benjamin Ducke\n");
-    fprintf(stdout,
-	    "This is free software; see the source for copying conditions.  There is NO\n");
-    fprintf(stdout,
-	    "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
-    exit(0);
-}
-
-
-/* determine options to pass to extension's configure script */
-/* TODO: check, if system configuration meets a set of requirements */
-/* THIS FUNCTION IS CURRENTLY NOT USED */
-void get_configure_options(char *gisbase)
-{
-
-    FILE *fp;
-    char str[MAXSTR];
-
-    if (strcmp(CONFIG_OPTS, "")) {
-	/* if user has specified config options on the GEM command line: override anything else */
-	return;
-    }
-
-    /* check if GISBASE/etc/config.system exists and if so, read options from it */
-    sprintf(str, "%s/etc/config.system", gisbase);
-    fp = fopen(str, "r");
-    if (fp == NULL) {
-	print_warning
-	    ("could not open %s for read access. Using default configure options.\n",
-	     str);
-	return;
-    }
-
-    /* config.system may also contain nothing, only comments and/or whitespace */
-    if (nc_fgets_nb(str, MAXSTR, fp) != NULL) {
-	strcpy(CONFIG_OPTS, str);
-    }
-}
-
-
-int main(int argc, char *argv[])
-{
-    char *gisbase;
-    char *grass_version;
-    char *grass_major;
-    char *grass_minor;
-    char *grass_revision;
-    char *tmp;
-    char *url;
-    char *filepart;
-    char version_file[MAXSTR];
-    char package[MAXSTR];
-    char orgname[MAXSTR];
-    char pkg_name[MAXSTR];
-    char *bins;
-    int pkg_major, pkg_minor, pkg_revision;
-    FILE *f;
-    int fd;
-
-    char pkg_short_name[MAXSTR];
-    char invocation[MAXSTR];
-
-    char coptions[MAXSTR];
-
-    int major, minor, revision;
-    int option;
-    int action;
-    int valid;
-
-    struct stat buf;
-    struct stat buf2;
-    int error;
-    int is_directory = 0;
-    DIR *dir;
-    struct dirent *dir_entry;
-    int dir_found;
-
-    int option_index = 0;
-    static struct option long_options[] = {
-	{"install", 1, NULL, 'i'},
-	{"uninstall", 1, NULL, 'u'},
-	{"query", 2, NULL, 'q'},
-	{"details", 1, NULL, 'd'},
-	{"clean", 1, NULL, 'c'},
-	{"test", 1, NULL, 't'},
-	{"license", 1, NULL, 'l'},
-	{"restore", 0, NULL, 'r'},
-	{"help", 0, NULL, 'h'},
-	{"version", 0, NULL, 'V'},
-
-	{"grass", 1, NULL, 'g'},
-	{"options", 1, NULL, 'o'},
-	{"binary", 1, NULL, 'b'},
-	{"force", 0, NULL, 'f'},
-	{"verbose", 0, NULL, 'v'},
-	{"skip-config", 0, NULL, 's'},
-	{"config-opts", 1, NULL, 'x'},
-
-	{"config-cmd", 1, NULL, 'C'},
-	{"make-cmd", 1, NULL, 'm'},
-
-	{0, 0, 0, 0}
-    };
-
-
-    /* set global variables to defaults */
-    VERBOSE = 0;
-    TMPCLEAN = 0;
-    TMPDBCLEAN = 0;
-    FORCE = 0;
-    UPGRADE = 0;
-    ERROR = 0;
-    WARNINGS = 0;
-    SKIP_CFG = 0;
-
-    strcpy(GISMAN_CMD, "");
-    strcpy(GISMAN2_CMD, "");
-    strcpy(QGIS_CMD, "");
-    strcpy(UNINSTALL_CMD, "");
-    strcpy(HTML_CMD, "");
-
-    strcpy(TMPDIR, "");
-    strcpy(TMPDB, "");
-    strcpy(TMP_GISMAN, "");
-    strcpy(TMP_DESCR, "");
-    strcpy(TMP_INFO, "");
-    strcpy(TMP_DEPS, "");
-    strcpy(TMP_BUGS, "");
-    strcpy(TMP_AUTHORS, "");
-    strcpy(TMP_HTML, "");
-    strcpy(TMP_NULL, "");
-
-    strcpy(CONFIG_OPTS, "");
-
-    strcpy(CONFIG_CMD, "configure");
-    strcpy(MAKE_CMD, "make");
-
-    getcwd(CWD, MAXSTR);
-
-    /* reset terminal colors */
-    fprintf(stdout, "\033[0m");
-
-    tmp = malloc(sizeof(char) * MAXSTR);
-    strcpy(invocation, argv[0]);
-
-    /* all output should be unbuffered */
-    setvbuf(stdout, (char *)NULL, _IONBF, 0);
-
-    /* if run with no arguments: show help */
-    if (argc == 1) {
-	/* show usage info and exit */
-	show_help();
-	exit(0);
-    }
-
-    atexit(&exit_msg);		/* show a message after program termination */
-
-    valid = 0;
-    bins = NULL;
-    gisbase = NULL;
-
-    opterr = 0;
-    option =
-	getopt_long(argc, argv, ":i:u:q:d:c:C:t:l:m:o:x:rhVg:b:fvs",
-		    long_options, &option_index);
-    while (option != -1) {
-
-	if (option == '?') {
-	    print_error(ERR_INVOCATION,
-			"unknown option or action specified.\n");
-	}
-
-
-	/* check for missing arguments */
-	if (option == ':') {
-	    if ((optopt == 'i') || (optopt == 'u') || (optopt == 'd') ||
-		(optopt == 'c') || (optopt == 't') || (optopt == 'l') ||
-		(optopt == 'r')) {
-		print_error(ERR_INVOCATION,
-			    "missing file or directory name.\n");
-	    }
-	    if (optopt == 'g') {
-		print_error(ERR_INVOCATION, "missing path to GRASS 7.\n");
-	    }
-	    if (optopt == 'b') {
-		print_error(ERR_INVOCATION,
-			    "missing name of binary architecture.\n");
-	    }
-	    if (optopt == 'b') {
-		print_error(ERR_INVOCATION, "missing configure options.\n");
-	    }
-	    if (optopt == 'q') {
-		/* '-q' w/o filename is list action */
-		action = LIST;
-		valid++;
-		break;
-	    }
-	}
-
-	if ((option == 'i') || (option == 'u') || (option == 'q') ||
-	    (option == 'd') || (option == 'c') || (option == 't') ||
-	    (option == 'l') || (option == 'r') || (option == 'h') ||
-	    (option == 'V')) {
-	    /* got a valid action specifier */
-	    valid++;
-	    /* set action accordingly */
-	    switch (option) {
-	    case 'i':
-		if (action != BIN_INSTALL) {
-		    action = INSTALL;
-		}
-		break;
-	    case 'u':
-		action = UNINSTALL;
-		break;
-	    case 'q':
-		action = QUERY;
-		break;
-	    case 'd':
-		action = DETAILS;
-		break;
-	    case 'c':
-		action = CLEAN;
-		break;
-	    case 't':
-		action = TEST_INSTALL;
-		break;
-	    case 'l':
-		action = LICENSE;
-		break;
-	    case 'r':
-		action = RESTORE;
-		break;
-	    case 'h':
-		action = HELP;
-		break;
-	    case 'V':
-		action = VERSION;
-		break;
-	    }
-	    if (optarg != NULL) {
-		/* save package name as given on command line */
-		strcpy(package, optarg);
-		/* orgname will always preserve the commandline option */
-		strcpy(orgname, optarg);
-	    }
-	}
-
-	/* set options */
-	if (option == 'g') {
-	    gisbase = malloc(sizeof(char) * (strlen(optarg) + 1));
-	    strcpy(gisbase, optarg);
-	}
-	if (option == 'b') {
-	    bins = malloc(sizeof(char) * (strlen(optarg) + 1));
-	    strcpy(bins, optarg);
-	    action = BIN_INSTALL;
-	}
-	if (option == 'x') {
-	    /* configure script options */
-	    strcpy(&CONFIG_OPTS[0], optarg);
-	}
-
-	if (option == 'f') {
-	    FORCE = 1;
-	}
-	if (option == 'v') {
-	    VERBOSE = 1;
-	}
-
-	if (option == 's') {
-	    SKIP_CFG = 1;
-	}
-	if (option == 'o') {
-	    /* GEM_C_OPTS gets passed to the C compiler via the GRASS/GEM Makefiles:
-	       <EXT>/src/include/Make/Grass.make.in:
-	       CFLAGS      =  $(INC) $(COMPILE_FLAGS) $(USE_TERMIO) $(GEM_C_OPTS)
-	     */
-	    strcat(coptions, optarg);
-	}
-	/* define a custom configure command */
-	if (option == 'C') {
-	    strcpy(CONFIG_CMD, optarg);
-	}
-	/* define a custom make command */
-	if (option == 'm') {
-	    strcpy(MAKE_CMD, optarg);
-	}
-	/* get next option from command line */
-	option =
-	    getopt_long(argc, argv, ":i:u:q:d:c:t:l:o:x:rhVg:b:fvs",
-			long_options, &option_index);
-    }
-
-
-    if (valid < 1) {
-	print_error(ERR_INVOCATION, "please specify a valid action.\n");
-    }
-    if (valid > 1) {
-	print_error(ERR_INVOCATION, "please specify only one action.\n");
-    }
-
-    /* export compiler options for use by Makefiles */
-    sprintf(GEM_C_OPTS, "GEM_C_OPTS=%s", coptions);
-    putenv(GEM_C_OPTS);
-
-    /* these actions can be done without any extension checking */
-    if (action == HELP) {
-	/* show usage info and exit */
-	show_help();
-	exit(0);
-    }
-
-    if (action == VERSION) {
-	/* show version info and exit */
-	show_version();
-	exit(0);
-    }
-
-    if (!VERBOSE) {
-	/* set temp file to pipe output to for silent operation */
-	/* TODO: Do not hardcode temp paths */
-	strcpy(TMP_NULL, "/tmp/grass.extension.log.XXXXXX");	/* TMP_NULL is a global variable */
-	mkstemp(TMP_NULL);
-	fd = open(TMP_NULL, O_CREAT);
-	if (fd == -1) {
-	    print_error(ERR_TMPFILE, "could not create temp file: %s",
-			strerror(errno));
-	    exit(ERR_TMPFILE);
-	}
-    }
-
-
-    /* these actions need a valid GRASS path but no extensions */
-    if (action == RESTORE) {
-	/* figure out path to GRASS installation */
-	/* GIS base not given? */
-	if (gisbase == NULL) {
-	    /* try to read from GRASS environment */
-	    gisbase = getenv("GISBASE");
-	    if (gisbase == NULL) {
-		/* still NULL? Abort! */
-		print_error(ERR_INVOCATION,
-			    "GISBASE environment variable not set and path to GRASS not given.\n");
-	    }
-	}
-
-	if (VERBOSE) {
-	    fprintf(stdout, "Path to GRASS is %s.\n", gisbase);
-	}
-
-	restore(gisbase, grass_version);
-	exit(0);
-    }
-
-    if (action == LIST) {
-	/* figure out path to GRASS installation */
-	/* GIS base not given? */
-	if (gisbase == NULL) {
-	    /* try to read from GRASS environment */
-	    gisbase = getenv("GISBASE");
-	    if (gisbase == NULL) {
-		/* still NULL? Abort! */
-		print_error(ERR_INVOCATION,
-			    "GISBASE environment variable not set and path to GRASS not given.\n");
-	    }
-	}
-
-	if (VERBOSE) {
-	    fprintf(stdout, "Path to GRASS is %s.\n", gisbase);
-	}
-	list_extensions(gisbase);
-	exit(0);
-    }
-
-    /* check if extension is stored in a remote URL */
-    if ((strstr(package, "http://")) || (strstr(package, "ftp://"))) {
-	wget_extension(package);	/* download into current dir using wget */
-	/* cut off the path specification */
-	url = malloc(sizeof(char) * MAXSTR);
-	strcpy(url, package);
-	filepart = strrchr(url, '/');
-	filepart++;
-	strcpy(package, filepart);
-	free(url);
-    }
-
-    if (VERBOSE) {
-	fprintf(stdout, "Extension location is '%s'.\n", package);
-    }
-
-    if (action != UNINSTALL) {
-	error = stat(package, &buf);
-	if (error < 0) {
-	    print_error(ERR_NO_ACCESS_EXT,
-			"extension FILE or DIR '%s' invalid: %s\n", package,
-			strerror(errno));
-	}
-	if (S_ISDIR(buf.st_mode)) {
-	    is_directory = 1;
-	    if (VERBOSE) {
-		fprintf(stdout, "Extension files stored in a directory.\n");
-	    }
-	}
-	else {
-	    if (VERBOSE) {
-		fprintf(stdout,
-			"Extension files stored in a package file.\n");
-	    }
-	    /* DECOMPRESS INTO TEMP DIR, CHANGE NAME OF package TO THAT DIR */
-	    unpack_extension(package);
-	    /* find name of directory containing extension files */
-	    /* very primitive: just picks the first directory */
-	    dir = opendir(TMPDIR);
-	    dir_entry = readdir(dir);
-	    dir_found = 0;
-	    while (dir_entry != NULL) {
-		if ((strcmp(dir_entry->d_name, ".")) &&
-		    (strcmp(dir_entry->d_name, ".."))
-		    ) {
-		    /* check if it is a directory */
-		    sprintf(tmp, "%s/%s", TMPDIR, dir_entry->d_name);
-		    stat(tmp, &buf2);
-		    if (S_ISDIR(buf2.st_mode)) {
-			dir_found = 1;
-			break;
-		    }
-		}
-		dir_entry = readdir(dir);
-	    }
-	    strcpy(package, tmp);
-
-	    if (dir_found == 0) {
-		print_error(ERR_UNPACK_EXT,
-			    "no top-level directory found in extension package.\n");
-	    }
-	}
-    }
-
-    /* copy package name into this maliciously named variable */
-    /* (sorry about the mess ...) */
-    /* This name will be used for all registration actions and */
-    /* for creating files and directories that store extension */
-    /* information for uninstall and restore actions */
-    /* For uninstall, we take the last argument as package, NOT */
-    /* file name */
-    if (action == UNINSTALL) {
-	strcpy(pkg_short_name, package);
-    }
-    else {
-	get_package_name(package, pkg_short_name);
-    }
-
-    /* export relevant VARS for use by post script */
-    if (valid > 0) {
-	/* export all relevant env vars for the post script */
-	if (gisbase == NULL) {
-	    /* try to read from GRASS environment */
-	    gisbase = getenv("GISBASE");
-	}
-	run_post(package, action, bins, gisbase);
-    }
-
-    if (VERBOSE) {
-	fprintf(stdout, "Extension will be installed from '%s'\n", package);
-    }
-
-    /* CHECK PACKAGE FOR VALIDITY */
-    if (action != UNINSTALL) {
-	check_extension(package, pkg_name, &pkg_major, &pkg_minor,
-			&pkg_revision);
-    }
-
-    /* these actions can be done without GRASS checking */
-    if (action == QUERY) {
-	query_extension(package, pkg_name, pkg_major, pkg_minor, pkg_revision,
-			pkg_short_name, invocation, orgname);
-	exit(0);
-    }
-
-    if (action == DETAILS) {
-	show_details(package);
-	exit(0);
-    }
-
-    if (action == LICENSE) {
-	show_license(package);
-	exit(0);
-    }
-
-    if (action == CLEAN) {
-	source_clean(package);
-	exit(0);
-    }
-
-
-    /* The following checks need to be done for all other actions! */
-
-    /* figure out path to GRASS installation */
-    /* GIS base not given? */
-    if (gisbase == NULL) {
-	/* try to read from GRASS environment */
-	gisbase = getenv("GISBASE");
-	if (gisbase == NULL) {
-	    /* still NULL? Abort! */
-	    print_error(ERR_INVOCATION,
-			"GISBASE environment variable not set and path to GRASS not given.\n");
-	}
-    }
-
-    if (VERBOSE) {
-	fprintf(stdout, "Path to GRASS is %s.\n", gisbase);
-    }
-
-    /* figure out GRASS version */
-    grass_version = getenv("GRASS_VERSION");
-    if (grass_version == NULL) {
-	/* GRASS version can be read from gisbase/etc/VERSIONNUMBER */
-	sprintf(version_file, "%s/etc/VERSIONNUMBER", gisbase);
-	f = fopen(version_file, "r");
-	if (f == NULL) {
-	    /* still NULL? Abort! */
-	    print_error(ERR_VERSION,
-			"Could not read GRASS version. Did you specify the right path?\n");
-	}
-	else {
-	    grass_version = malloc(sizeof(char) * 16);
-	    error = fscanf(f, "%s", grass_version);
-	    fclose(f);
-	    if (error < 1) {
-		print_error(ERR_VERSION,
-			    "Could not read GRASS version. Did you specify the right path?\n");
-	    }
-	}
-    }
-
-    if (grass_version != NULL) {
-	/* extract major and minor version numbers */
-	tmp = strdup(grass_version);
-
-	grass_major = strtok(tmp, ".");
-	grass_minor = strtok(NULL, ".");
-	grass_revision = strtok(NULL, ".");
-
-	major = strtol(grass_major, NULL, 10);
-	minor = strtol(grass_minor, NULL, 10);
-	revision = strtol(grass_revision, NULL, 10);
-
-	grass_version = malloc(sizeof(char) * MAXSTR);
-	sprintf(grass_version, "%i.%i.%i", major, minor, revision);
-	if (VERBOSE) {
-	    fprintf(stdout, "GRASS version is %s.\n", grass_version);
-	}
-
-	if (major < 6) {
-	    print_error(ERR_VERSION,
-			"extensions only work with GRASS version 6 and above.\n");
-	}
-    }
-
-    /* for GDAL compatibility and           
-       for the sake of people using Lorenzo Moretti's GRASS for MacOS, we always export the following
-       compiler options */
-    sprintf(coptions, "-L%s/lib -I/usr/local/grasslib/include/ ", gisbase);
-
-    /* these actions can only be done after everything has been checked */
-    if (action == INSTALL) {
-	source_install(package, gisbase, pkg_short_name, pkg_major, pkg_minor,
-		       pkg_revision, grass_version);
-	exit(0);
-    }
-
-    if (action == UNINSTALL) {
-	uninstall(package, pkg_short_name, gisbase, grass_version);
-	exit(0);
-    }
-
-    if (action == TEST_INSTALL) {
-	test_install(package, gisbase, pkg_short_name, pkg_major, pkg_minor,
-		     pkg_revision, grass_version);
-	exit(0);
-    }
-
-    if (action == BIN_INSTALL) {
-	if (binaries_exist(package, bins)) {
-	    bin_install(package, gisbase, bins, pkg_short_name, pkg_major,
-			pkg_minor, pkg_revision, grass_version);
-	    exit(0);
-	}
-	else {
-	    print_error(ERR_MISSING_BINS, "no binaries for system '%s'\n",
-			bins);
-	}
-    }
-
-    exit(0);
-}

+ 0 - 462
gem/reg_deps.c

@@ -1,462 +0,0 @@
-
-/***************************************************************************
- *            reg_deps.c
- *
- *  Mon Apr 18 15:19:04 2005
- *  Copyright  2005  Benjamin Ducke
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "globals.h"
-
-
-/*
-   Reads in the "depends" file and returns a string of comma-separated
-   extensions, on which this one depends.
- */
-char *depstr(char *package, char *gisbase)
-{
-    char file[MAXSTR];
-    char line[MAXSTR];
-    char *str;
-    int first;
-    int error;
-    FILE *f_deps;
-
-    char short_name[MAXSTR];
-
-    /* check if 'depends' exists and is readable */
-    sprintf(file, "../depends");
-    f_deps = fopen(file, "r");
-    if (f_deps == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist, return an empty string */
-	    return ("");
-	}
-	else {
-	    /* sth. strange happened */
-	    print_error(ERR_CHECK_DEPS, "checking for file '%s': %s\n", file,
-			strerror(errno));
-	}
-    }
-
-    first = 1;
-    str = malloc(sizeof(char) * MAXSTR);
-    while (nc_fgets_nb(line, MAXSTR, f_deps) != NULL) {
-	if (strlen(line) > 0) {
-	    error = sscanf(line, "%s", short_name);
-	    if ((error > 0) && (strcmp("GRASS", short_name))) {
-		if (first) {
-		    strcat(str, "\t");
-		    strcat(str, short_name);
-		    first = 0;
-		}
-		else {
-		    strcat(str, ",");
-		    strcat(str, short_name);
-		}
-	    }
-	}
-    }
-
-    fclose(f_deps);
-    return (str);
-}
-
-/* 
-   Reads in GISBASE/etc/extensions.db 
-   Adds a line to the file GISBASE/etc/extensions.db that contains: 
-   extension name and version, 'src' or name of binary files.
-   Adds extension name to the end of every entry mentioned in 'depends' 
- */
-void register_extension(char *gisbase, char *bins, char *pkg_short_name,
-			int pkg_major, int pkg_minor, int pkg_revision)
-{
-    char file[MAXSTR];
-    char str[MAXSTR];
-    int n_lines;
-    int error;
-    int db_exists;
-    int must_register;
-    int copy_thru;
-    int ext_exists;
-    FILE *f_in, *f_out;
-
-    char short_name[MAXSTR];
-    char inst_bins[MAXSTR];
-    char deps[MAXSTR];
-    int major, minor, revision;
-
-
-    /* check, if extensions.db exists and is readable */
-    db_exists = 1;
-    sprintf(file, "%s/etc/extensions.db", gisbase);
-    f_in = fopen(file, "r");
-    if (f_in == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not yet exist */
-	    db_exists = 0;
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_in);
-	    print_error(ERR_REGISTER_EXT, "checking for file '%s': %s\n",
-			file, strerror(errno));
-	}
-    }
-
-    if (db_exists) {
-	/* create a temporary extensions.db file for write access */
-	/* TODO: Do not hardcode temp paths */
-	strcpy(TMPDB, "/tmp/grass.extensions.db.XXXXXX");	/* TMPDB is a global variable */
-	mkstemp(TMPDB);
-
-	f_out = fopen(TMPDB, "w+");
-	if (f_out == NULL) {
-	    print_error(ERR_REGISTER_EXT,
-			"could not create temp file '%s': %s\n \
-							Make sure that directory /tmp exists on your system and you have write permission.\n", TMPDB, strerror(errno));
-	}
-
-	atexit(&exit_db);	/* now need to register an at exit func to remove tmpdb automatically! */
-
-	/* count number of extensions.db registry entries */
-	n_lines = 0;
-	must_register = 1;
-	ext_exists = 0;
-	while (nc_fgets_nb(str, MAXSTR, f_in) != NULL) {
-	    n_lines++;
-	    copy_thru = 1;
-	    /* read in name and version of registered item */
-	    sscanf(str, "%s\t%i.%i.%i\t%s\t%s", short_name, &major, &minor,
-		   &revision, inst_bins, deps);
-	    /* check, if extension with same name already exists */
-	    if (!strcmp(short_name, pkg_short_name)) {
-		/* an extension with this name is already installed */
-		ext_exists = 1;
-		/* check if it's version is lower, same or higher */
-		error =
-		    vercmp(major, minor, revision, pkg_major, pkg_minor,
-			   pkg_revision);
-		if ((!FORCE)) {
-		    /* error, if another version is present! */
-		    if (error < 0) {
-			print_error(ERR_EXISTS_EXT,
-				    "Extension '%s' with lower version (%i.%i.%i) already installed. You can use -f to overwrite this version, if you know what you are doing.\n",
-				    pkg_short_name, major, minor, revision);
-		    }
-		    else {
-			print_error(ERR_EXISTS_EXT,
-				    "Extension '%s' with same or higher version (%i.%i.%i) already installed. You can use -f to overwrite this version, if you know what you are doing.\n",
-				    pkg_short_name, major, minor, revision);
-		    }
-		}
-		if (FORCE) {	/* this overrides/implies UPGRADE! */
-		    if (error == 0) {
-			/* if same version installed: just leave everything untouched */
-			must_register = 0;
-		    }
-		    else {
-			/* otherwise, work needs be done! */
-			must_register = 1;
-			copy_thru = 0;
-		    }
-		}
-	    }
-
-	    /* write line to temporary extension file */
-	    if (copy_thru) {	/* just copy thru */
-		fprintf(f_out, str);
-		fflush(f_out);
-	    }
-	}
-
-	if (must_register) {
-	    if (!ext_exists) {
-		/* register brand new extension */
-		sprintf(deps, "%s", depstr(pkg_short_name, gisbase));
-		fprintf(f_out, "%s\t%i.%i.%i\t%s\t%s\n", pkg_short_name,
-			pkg_major, pkg_minor, pkg_revision, bins, deps);
-	    }
-	    else {
-		/* register only new version number and binary source, if appropriate */
-		sprintf(deps, "%s", depstr(pkg_short_name, gisbase));
-		fprintf(f_out, "%s\t%i.%i.%i\t%s\t%s\n", short_name,
-			pkg_major, pkg_minor, pkg_revision, inst_bins, deps);
-	    }
-	}
-
-	fclose(f_out);
-	fclose(f_in);
-    }
-
-    if ((n_lines == 0) || (!db_exists)) {
-	/* extensions.db file does not yet exist or is empty: just create a new one */
-	/* TODO: Do not hardcode temp paths */
-	strcpy(TMPDB, "/tmp/grass.extensions.db.XXXXXX");	/* tmpdir is a global variable */
-	mkstemp(TMPDB);
-
-	f_out = fopen(TMPDB, "w+");
-	if (f_out == NULL) {
-	    print_error(ERR_REGISTER_EXT,
-			"could not create temp db '%s': %s\n \
-					Make sure that directory /tmp exists on your system and you have write permission.\n", file, strerror(errno));
-	}
-	atexit(&exit_db);	/* now need to register an at exit func to remove tmpdb automatically! */
-
-	/* register brand new extension */
-	sprintf(deps, "%s", depstr(pkg_short_name, gisbase));
-	fprintf(f_out, "%s\t%i.%i.%i\t%s\t%s\n", pkg_short_name, pkg_major,
-		pkg_minor, pkg_revision, bins, deps);
-	fclose(f_out);
-	return;
-    }
-}
-
-
-/*
-   Removes an entry from GISBASE/etc/extensions.db
- */
-void deregister_extension(char *package, char *pkg_short_name, char *gisbase)
-{
-    char file[MAXSTR];
-    char str[MAXSTR];
-    int error;
-    int db_exists;
-    int copy_thru;
-    FILE *f_in, *f_out;
-    int found_ext;
-
-    char short_name[MAXSTR];
-    char inst_bins[MAXSTR];
-    char deps[MAXSTR];
-    int major, minor, revision;
-
-
-    db_exists = 0;
-    /* check, if extensions.db exists and is readable */
-    sprintf(file, "%s/etc/extensions.db", gisbase);
-    f_in = fopen(file, "r");
-    if (f_in == NULL) {
-	if ((errno == ENOENT) && (!FORCE)) {
-	    /* file does not yet exist */
-	    fclose(f_in);
-	    print_error(ERR_DEREGISTER_EXT,
-			"could not deregister: no extensions installed\n");
-	}
-	else {
-	    /* sth. strange happened */
-	    if (!FORCE) {
-		fclose(f_in);
-		print_error(ERR_DEREGISTER_EXT,
-			    "checking for file '%s': %s\n", file,
-			    strerror(errno));
-	    }
-	}
-    }
-    else {
-	db_exists = 1;
-    }
-
-    if (db_exists) {
-	db_exists = 0;
-	/* create a temporary extensions.db file for write access */
-	/* TODO: Do not hardcode temp paths */
-	strcpy(TMPDB, "/tmp/grass.extensions.db.XXXXXX");	/* tmpdir is a global variable */
-	mkstemp(TMPDB);
-
-	f_out = fopen(TMPDB, "w+");
-	if ((f_out == NULL) && (!FORCE)) {
-	    print_error(ERR_DEREGISTER_EXT,
-			"could not create temp db '%s': %s\n \
-							Make sure that directory /tmp exists on your system and you have write permission.\n", file, strerror(errno));
-	}
-	else {
-	    db_exists = 1;
-	    atexit(&exit_db);	/* now need to register an at exit func to remove tmpdb automatically! */
-	}
-    }
-
-    /* if creation of temp db file succeeded: */
-    if (db_exists) {
-	/* read every line in extension.db */
-	found_ext = 0;
-	while (nc_fgets_nb(str, MAXSTR, f_in) != NULL) {
-	    /* copy thru, if extension name different from current extension's */
-	    error =
-		sscanf(str, "%s\t%i.%i.%i\t%s\t%s", short_name, &major,
-		       &minor, &revision, inst_bins, deps);
-	    if (error > 0) {
-		copy_thru = 1;
-		if (!strcmp(pkg_short_name, short_name)) {
-		    copy_thru = 0;
-		    found_ext = 1;
-		}
-		if (copy_thru) {
-		    /* abort, if a dependency on current extension is found */
-		    if ((strstr(deps, pkg_short_name)) && (!FORCE)) {
-			print_error(ERR_DEREGISTER_EXT,
-				    "cannot uninstall extension '%s' it is needed by '%s'.\n",
-				    pkg_short_name, short_name);
-		    }
-		    fprintf(f_out, str);
-		}
-	    }
-	}
-
-	/* was the extension installed at all? */
-	if (found_ext == 0) {
-	    print_error(ERR_DEREGISTER_EXT,
-			"no extension '%s' registered/installed in '%s'.\n",
-			pkg_short_name, gisbase);
-	}
-	/* mind the right sequence for closing these! */
-	fclose(f_in);
-	fclose(f_out);
-    }
-}
-
-
-/*
-   checks GRASS version number and whether all extensions listed in 'depends'
-   are satisfied (by analysing GISBASE/etc/extensions.db).
-   Terminates program, if missing deps; just returns, if "--force" was given.
- */
-void check_dependencies(char *package, char *gisbase, char *grass_version)
-{
-    char file[MAXSTR];
-    char str[MAXSTR];
-    char dbstr[MAXSTR];
-    int error;
-    int db_exists;
-    int satisfied;
-    FILE *f_deps, *f_db;
-
-    char short_name[MAXSTR];
-    int major, minor, revision;
-    char dep_short_name[MAXSTR];
-    int dep_major, dep_minor, dep_revision;
-
-    if (FORCE) {
-	return;
-    }
-
-    /* check if 'depends' exists and is readable */
-    f_deps = fopen("../depends", "r");
-    if (f_deps == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist, no need to check for deps */
-	    fprintf(stderr, "\n%s/depends ENOENT\n", package);
-	    return;
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_deps);
-	    print_error(ERR_CHECK_DEPS, "checking for file '%s': %s\n", file,
-			strerror(errno));
-	}
-    }
-
-    db_exists = 1;
-    /* check if extensions.db exists and is readable */
-    sprintf(file, "%s/etc/extensions.db", gisbase);
-    f_db = fopen(file, "r");
-    if (f_db == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist */
-	    db_exists = 0;
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_db);
-	    print_error(ERR_CHECK_DEPS, "checking for file '%s': %s\n", file,
-			strerror(errno));
-	}
-    }
-
-    satisfied = 0;
-    while (nc_fgets_nb(str, MAXSTR, f_deps) != NULL) {
-	/* get first line with dependencies info */
-	major = 0;
-	minor = 0;
-	revision = 0;
-	dep_major = 0;
-	dep_minor = 0;
-	dep_revision = 0;
-	error =
-	    sscanf(str, "%s\t%i.%i.%i", dep_short_name, &dep_major,
-		   &dep_minor, &dep_revision);
-	if (error > 0) {
-	    if (!strcmp(dep_short_name, "GRASS")) {
-		/* a GRASS version dependency has been specified */
-		sscanf(grass_version, "%i.%i.%i", &major, &minor, &revision);
-		if (vercmp
-		    (major, minor, revision, dep_major, dep_minor,
-		     dep_revision) < 0) {
-		    print_error(ERR_MISSING_DEPS,
-				"installed version (%s) of GRASS is too low. Required version is %i.%i.%i\n",
-				grass_version, dep_major, dep_minor,
-				dep_revision);
-		}
-		satisfied = 1;	/* let's be tolerant */
-	    }
-	    else {
-		/* a dependency on some other extension has been specified ... */
-		if (db_exists) {	/* ... if no extensions installed yet, it must be unsatisfied! */
-		    satisfied = 0;
-		    rewind(f_db);
-		    while (nc_fgets_nb(dbstr, MAXSTR, f_db) != NULL) {
-			major = 0;
-			minor = 0;
-			revision = 0;
-			error =
-			    sscanf(dbstr, "%s\t%i.%i.%i", short_name, &major,
-				   &minor, &revision);
-			if (error > 0) {
-			    if (!strcmp(short_name, dep_short_name)) {
-				/* found an installed extension that satisfies name, now check
-				   for version number */
-				if (vercmp
-				    (major, minor, revision, dep_major,
-				     dep_minor, dep_revision) < 0) {
-				    print_error(ERR_MISSING_DEPS,
-						"installed version %i.%i.%i of required extension '%s' is too low.\n \
-													Required version is %i.%i.%i\n",
-						major, minor, revision, dep_short_name, dep_major, dep_minor,
-						dep_revision);
-				}
-				/* name and version dependencies satisfied */
-				satisfied = 1;
-			    }
-			}
-		    }
-		    if (!satisfied) {
-			print_error(ERR_MISSING_DEPS,
-				    "required extension '%s' not found in '%s'.\n",
-				    dep_short_name, gisbase);
-		    }
-		}
-	    }
-	}
-    }
-    if (db_exists) {
-	fclose(f_db);
-    }
-    fclose(f_deps);
-
-}

+ 0 - 38
gem/reg_deps.h

@@ -1,38 +0,0 @@
-
-/***************************************************************************
- *            reg_deps.h
- *
- *  Mon Apr 18 15:23:06 2005
- *  Copyright  2005  Benjamin Ducke
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _REG_DEPS_H
-#define _REG_DEPS_H
-
-char *depstr(char *package, char *gisbase);
-
-void register_extension(char *gisbase, char *bins, char *pkg_short_name,
-			int pkg_major, int pkg_minor, int pkg_revision);
-
-void deregister_extension(char *package, char *pkg_short_name, char *gisbase);
-
-void check_dependencies(char *package, char *gisbase, char *grass_version);
-
-
-#endif /* _REG_DEPS_H */

+ 0 - 873
gem/reg_entries.c

@@ -1,873 +0,0 @@
-
-/***************************************************************************
- *            reg_entries.c
- *
- *  Fri May 13 11:35:33 2005
- *  Copyright  2005  User
- *  Email
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <dirent.h>
-#include "globals.h"
-
-int menu_created;
-
-
- /*
-    Returns 1, if the string is a submenu item, 0 otherwise.
-    Very primitive
-  */
-int is_submenu(char *item)
-{
-    if (strchr(item, '[') == NULL) {
-	return (0);
-    }
-    if (strrchr(item, ']') == NULL) {
-	return (0);
-    }
-    if (strchr(item, '[') > strrchr(item, ']')) {
-	return (0);
-    }
-    return (1);
-}
-
-
-/*
-   If "Extensions" menu does not yet exist, it will be created immediately
-   to the left of the "Help" menu in GIS Manager's main menu bar.
-   Returns the line nr after which the "Extension" menu entries should be
-   inserted.
- */
-int check_ext_menu(char **tcl_lines)
-{
-    int idx;
-
-    /* check if "Extensions" menu exists */
-    idx = find_pos("\"&Xtns\" all options 1", tcl_lines, 0);
-    if (idx == -1) {		/* does not exist: create a new one */
-	idx = find_pos("\"&Help\" all options", tcl_lines, 0);
-	if (idx == -1) {	/* Help menu does not exist: place at far right */
-	    idx = find_pos("}]", tcl_lines, 0);
-	    if (idx == -1) {
-		print_error(ERR_REGISTER_ENTRIES_GISMAN,
-			    "could not parse 'menu.tcl'.\n");
-	    }
-	    insert_str(" \"&Xtns\" all options 1 {\n", idx, tcl_lines);
-	    idx++;
-	    insert_str(" }\n", idx, tcl_lines);
-	    return (idx);
-	}
-	insert_str(" \"&Xtns\" all options 1 {\n", idx, tcl_lines);
-	idx++;
-	insert_str(" }\n", idx, tcl_lines);
-    }
-    return (idx);
-}
-
-
- /*
-    Creates a new submenu for this extension under "Extensions" in GIS Managers
-    main menu bar.
-    Returns line no. of submenu, after which additional entries should be appended
-    to menu.tcl.
-  */
-int new_submenu(char *pkg_short_name, char *menu, char **tcl_lines)
-{
-    char tmp[MAXSTR];
-    char tmp2[MAXSTR];
-    char searchstr[MAXSTR];
-    int idx, idx2;
-    int insert_here;
-    int last;
-    char *first_quote;
-    char *second_quote;
-    int len;
-    int terminator;
-
-    /* Store the position of the "Extensions" entry and start looking for submenu from there */
-    idx = find_pos("\"&Xtns\" all options", tcl_lines, 0);
-    last = find_pos("\" all options", tcl_lines, idx + 1) - 1;	/* find end of "Extensions" menu */
-    if (last == -1) {
-	last = find_pos("}]", tcl_lines, 0);	/* end of menu.tcl */
-    }
-
-    /* check if the line is a valid submenu specifier */
-    if (!is_submenu(menu)) {
-	print_warning
-	    ("first line not a submenu specifier in 'entries-gisman'.\n");
-	return (-1);
-    }
-    else {
-	/* check if a submenu with this name does already exist */
-	len = (strrchr(menu, ']') - strchr(menu, '[')) / sizeof(char);
-	strncpy(tmp, strchr(menu, '[') + sizeof(char), len);
-	tmp[len - 1] = '\0';	/* get rid of [] */
-	sprintf(searchstr, "{cascad \"%s\"", tmp);	/* this is what we need to look for */
-
-	idx2 = find_pos(searchstr, tcl_lines, idx);
-	if ((idx2 != -1) && (idx2 < last)) {
-	    print_warning("submenu '%s' exists in GIS Manager's Xtns menu.\n",
-			  tmp);
-	    return (-1);
-	}
-
-	/* ELSE: create a new submenu in the right place */
-	insert_here = idx + 1;	/* by default: place submenu in first line after "Extensions" menu */
-	idx2 = find_pos("{cascad ", tcl_lines, idx);	/* go through all submenus in "Extensions" */
-	while ((idx2 != -1) && (idx2 < last)) {
-	    /* check for alphabetical order */
-	    first_quote = strchr(tcl_lines[idx2], '\"');	/* get name of submenu w/o quotation marks */
-	    second_quote = strchr(first_quote + sizeof(char), '\"');
-	    len = (second_quote - first_quote) / sizeof(char);
-	    strncpy(tmp2, first_quote + sizeof(char), len);
-	    tmp2[len - 1] = '\0';	/* get rid of "" */
-	    if (strcmp(tmp, tmp2) < 0) {
-		insert_here = idx2;
-		break;
-	    }
-	    idx++;
-	    idx2 = find_pos("{cascad ", tcl_lines, idx);
-	}
-
-	/* create new submenu and return line no in menu.tcl for insertion of entries */
-	sprintf(tmp, " \t\t\t%s {} \"\" 1 {\n", searchstr);
-	insert_str(tmp, insert_here, tcl_lines);
-	insert_str(" \t\t\t}}\n", insert_here + 1, tcl_lines);
-
-	/* create an uninstall entry in menu.tcl */
-	terminator = find_pos("}]", tcl_lines, 0);
-	/* this is just a comment that tells the uninstall function which submenu to remove */
-	sprintf(tmp, "#(DO_NOT_REMOVE_THIS_COMMENT) <%s> %s {} \"\" 1 {\n",
-		pkg_short_name, searchstr);
-	insert_str(tmp, terminator + 1, tcl_lines);
-
-	/* return next line for insertion of menu entries and commands! */
-	return (insert_here + 1);
-    }
-
-    return (-1);
-}
-
-
-/*
-   Inserts a new menu entry into the extension's own submenu under "Extensions".
-   Returns the line number in menu.tcl after which the next entry should be
-   inserted.
- */
-int new_item(char *item, char *menu, char **tcl_lines, int line_no)
-{
-    char *token;
-    int num_tokens;
-    char entry[MAXSTR];
-    char command[MAXSTR];
-    char tmp[MAXSTR];
-
-
-    /* remove dangling white spaces and EOL chars */
-    chop(item);
-
-    token = strtok(item, ";");
-    if (token == NULL) {
-	print_warning("invalid token in 'entries-gisman'.\n");
-	return (-1);
-    }
-
-    strcpy(entry, token);	/* get menu entry string */
-
-    num_tokens = 0;
-    while (token != NULL) {
-	token = strtok(NULL, ";");
-	if (token != NULL) {
-	    strcpy(command, token);	/* get command string */
-	}
-	num_tokens++;
-    }
-
-    if (num_tokens > 2) {
-	print_warning("invalid number of tokens (%i) in 'entries-gisman'.\n",
-		      num_tokens);
-	return (-1);
-    }
-
-    /* just a separator or a 'real' menu entry? */
-    if ((!strcmp(entry, "-")) && (!strcmp(entry, "-"))) {
-	sprintf(tmp, " \t\t\t {separator}\n");
-    }
-    else {
-	sprintf(tmp, " \t\t\t {command \"%s\" {} \"%s\" {} -command {%s }}\n",
-		entry, command, command);
-    }
-    insert_str(tmp, line_no, tcl_lines);
-
-    /* return line no. for next entry */
-    line_no++;
-    return (line_no);
-}
-
-
- /* 
-    Checks if there are any entries in entries-gisman.
-    Reads GISBASE/etc/dm/menu.tcl into an array of strings.
-    Adds a new item "Extensions" to the menu bar, if it is missing.
-    Adds new submenus and menu items to the GIS manager, as stated in entries-gisman
-    Writes the new menu structure to a temporary file which will then be installed
-    using the 'su' function.
-  */
-void register_entries_gisman(char *pkg_short_name, char *gisbase)
-{
-
-    char file[MAXSTR];
-    char str[MAXSTR];
-    char menu[MAXSTR];
-    int len;
-    char **line;
-    int n_entries, n_lines, i;
-    int n_lines_org, n_lines_new;
-    int line_no;
-    FILE *f_gisman, *f_in, *f_out;
-
-    /* check if entries-gisman exists and is readable */
-    sprintf(file, "../entries-gisman");
-    f_gisman = fopen(file, "r");
-    if (f_gisman == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist */
-	    return;
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_gisman);
-	    print_error(ERR_REGISTER_ENTRIES_GISMAN,
-			"checking for file '%s': %s\n", file,
-			strerror(errno));
-	}
-    }
-
-    /* check if menu.tcl exists and is readable */
-    sprintf(file, "%s/etc/dm/menu.tcl", gisbase);
-    f_in = fopen(file, "r");
-    if (f_in == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist */
-	    return;
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_in);
-	    print_error(ERR_REGISTER_ENTRIES_GISMAN,
-			"checking for file '%s': %s\n", file,
-			strerror(errno));
-	}
-    }
-
-    /* create a temporary menu.tcl file for write access */
-    /* TODO: Do not hardcode temp paths */
-    strcpy(TMP_GISMAN, "/tmp/grass.extensions.db.XXXXXX");	/* TMP_GISMAN is a global variable */
-    mkstemp(TMP_GISMAN);
-
-    f_out = fopen(TMP_GISMAN, "w+");
-    if (f_out == NULL) {
-	print_error(ERR_REGISTER_ENTRIES_GISMAN,
-		    "could not create temp file '%s': %s\n \
-			Make sure that directory /tmp exists on your system and you have write permission.\n", TMP_GISMAN, strerror(errno));
-    }
-    atexit(&exit_db);		/* now need to register an at exit func to remove tmpdb automatically! */
-
-    /* everything fine: create a shell command to install gisman-entries and modified menu.tcl */
-    /* this also creates a backup-copy of menu.tcl */
-    if (VERBOSE) {
-	sprintf(str,
-		"mkdir --verbose %s/etc/dm/gem-entries ; cp -vf ../entries-gisman %s/etc/dm/gem-entries/%s ; \
-					cp -vf %s/etc/dm/menu.tcl %s/etc/dm/menu.tcl.gem.bak ; \
-					cp -vf %s %s/etc/dm/menu.tcl ; chmod -v a+r %s/etc/dm/menu.tcl ;",
-		gisbase, gisbase, pkg_short_name, gisbase, gisbase, TMP_GISMAN, gisbase, gisbase);
-    }
-    else {
-	sprintf(str,
-		"mkdir %s/etc/dm/gem-entries &> %s ; cp -f ../entries-gisman %s/etc/dm/gem-entries/%s &> %s ; \
-					cp -f %s/etc/dm/menu.tcl %s/etc/dm/menu.tcl.gem.bak &> %s ; \
-					cp -f %s %s/etc/dm/menu.tcl &> %s ; chmod a+r %s/etc/dm/menu.tcl &> %s ;",
-		gisbase, TMP_NULL, gisbase, pkg_short_name, TMP_NULL, gisbase, gisbase, TMP_NULL, TMP_GISMAN, gisbase, TMP_NULL, gisbase, TMP_NULL);
-    }
-    strcpy(GISMAN_CMD, str);
-
-    /* count number of lines in entries-gisman */
-    n_entries = 0;
-    while (fgets(str, MAXSTR, f_gisman) != NULL) {
-	n_entries++;
-    }
-    if (n_entries == 0) {
-	return;
-    }
-    rewind(f_gisman);
-
-    /* count number of lines in menu.tcl */
-    n_lines = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	n_lines++;
-    }
-    if (n_lines == 0) {
-	return;
-    }
-    n_lines_org = n_lines;
-    rewind(f_in);
-
-    /* create an array large enough to hold all lines in menu.tcl */
-    /* plus the entries that are to be added from entries-gisman */
-    /* plus one NULL terminator */
-    /* and copy all lines from menu.tcl into this */
-    line = (char **)calloc(n_lines + (n_entries * 2) + 6, sizeof(char *));
-    for (i = 0; i < (n_lines + (n_entries * 2) + 6); i++) {
-	line[i] = NULL;
-    }
-    i = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	line[i] = (char *)malloc((1 + strlen(str)) * sizeof(char));
-	strcpy(line[i], str);
-	i++;
-    }
-
-    check_ext_menu(line);	/* create "Extensions" menu if necessary */
-
-    /* read all lines from entries-gisman and add to menus */
-    i = 1;
-    while (nc_fgets_nb(str, MAXSTR, f_gisman) != NULL) {
-	if (i == 1) {
-	    /* store name of menu item */
-	    len = (strrchr(str, ']') - strchr(str, '[')) / sizeof(char);
-	    strncpy(menu, strchr(str, '[') + sizeof(char), len);
-	    menu[len - 1] = '\0';	/* get rid of [] */
-	    line_no = new_submenu(pkg_short_name, str, line);
-	    if (line_no < 0) {
-		print_warning("no GIS Manager menu entries created.\n");
-		break;
-	    }
-	    i++;
-	}
-	else {
-	    line_no = new_item(str, menu, line, line_no);
-	    if (line_no < 0) {
-		print_warning("error creating GIS Manager menu entries.\n");
-		break;
-	    }
-	    i++;
-	}
-    }
-
-    /* write output to tmpfile */
-    i = 0;
-    while (line[i] != NULL) {
-	fprintf(f_out, line[i]);
-	i++;
-    }
-    fflush(f_out);
-
-    /* check for accidental corruption of menu.tcl: if tmpfile has less lines than installed
-       menu.tcl, we did sth. wrong and should leave the orginal file untouched! */
-    rewind(f_out);
-    n_lines_new = 0;
-    while (fgets(str, MAXSTR, f_out) != NULL) {
-	n_lines_new++;
-    }
-    if ((n_lines_new == 0) || (n_lines_new < n_lines_org)) {
-	print_warning
-	    ("file truncation detected. Retaining orginal file 'menu.tcl'.\n");
-	strcpy(GISMAN_CMD, "");
-    }
-
-    /* close files */
-    fclose(f_in);
-    fclose(f_gisman);
-    fclose(f_out);
-
-    /* free memory */
-    for (i = 0; i < (n_lines + (n_entries * 2) + 6); i++) {
-	free(line[i]);
-    }
-    free(line);
-}
-
-
-/*
-   This version is for Michael Barton's new version of the GIS Manager (gis.m)
-   It is much simpler and more flexible, because gis.m can build menus
-   from files at runtime.
-   All we have to do is make sure there is a folder 'Xtns' in $GISBASE/etc/gm
-   and we copy 'entries-gisman2' (if provided) into that folder using a
-   filename 'extension name'.gem!
- */
-void register_entries_gisman2(char *pkg_short_name, char *gisbase)
-{
-    char file[MAXSTR];
-    FILE *f_gisman2;
-    char str[MAXSTR];
-
-    /* check if entries-gisman2 exists and is readable */
-    sprintf(file, "../entries-gisman2");
-    f_gisman2 = fopen(file, "r");
-    if (f_gisman2 == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist */
-	    return;
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_gisman2);
-	    print_error(ERR_REGISTER_ENTRIES_GISMAN2,
-			"checking for file '%s': %s\n", file,
-			strerror(errno));
-	}
-    }
-
-    /* let's just blindly create an 'Xtns' dir: if it exists already: no problem */
-    /* and then copy file into it! */
-    if (VERBOSE) {
-	sprintf(str,
-		"mkdir --verbose -p %s/etc/gm/Xtns ; cp -fv ../entries-gisman2 %s/etc/gm/Xtns/%s.gem ; ",
-		gisbase, gisbase, pkg_short_name);
-    }
-    else {
-	sprintf(str,
-		"mkdir -p %s/etc/gm/Xtns ; cp -f ../entries-gisman2 %s/etc/gm/Xtns/%s.gem ; ",
-		gisbase, gisbase, pkg_short_name);
-    }
-    strcpy(GISMAN2_CMD, str);
-}
-
-
-/*
-   Checks for a comment left by the new_submenu () function in menu.tcl.        
-   If it exists, the submenu specified in that comment will be removed along
-   with all its entries.
-   Returns -1 on failure, number of removed entries otherwise.
-   If no more submenu entries exist, this will also remove the "Xtns" menu.
- */
-int deregister_entries_gisman(char *pkg_short_name, char *gisbase)
-{
-    char file[MAXSTR];
-    char str[MAXSTR];
-    char tmp[MAXSTR];
-    char **line;
-    int n_lines, i;
-    int n_lines_org, n_lines_new;
-    FILE *f_in, *f_out;
-    int pos;
-    int start, end;
-    int start_sub, end_sub;
-    char *lq, *rq;
-    int num_removed;
-
-    /* check if menu.tcl exists and is readable */
-    sprintf(file, "%s/etc/dm/menu.tcl", gisbase);
-    f_in = fopen(file, "r");
-    if (f_in == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist */
-	    return (0);
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_in);
-	    print_error(ERR_DEREGISTER_ENTRIES_GISMAN,
-			"checking for file '%s': %s\n", file,
-			strerror(errno));
-	}
-    }
-
-    /* create a temporary menu.tcl file for write access */
-    /* TODO: Do not hardcode temp paths */
-    strcpy(TMP_GISMAN, "/tmp/grass.extensions.db.XXXXXX");	/* TMP_GISMAN is a global variable */
-    mkstemp(TMP_GISMAN);
-
-    f_out = fopen(TMP_GISMAN, "w+");
-    if (f_out == NULL) {
-	print_error(ERR_REGISTER_ENTRIES_GISMAN,
-		    "could not create temp file '%s': %s\n \
-			Make sure that directory /tmp exists on your system and you have write permission.\n", TMP_GISMAN, strerror(errno));
-    }
-    atexit(&exit_db);		/* now need to register an at exit func to remove tmpdb automatically! */
-
-    /* everything fine: create a shell command to copy modified menu.tcl on uninstall */
-    if (VERBOSE) {
-	sprintf(str, "cp -vf %s/etc/dm/menu.tcl %s/etc/dm/menu.tcl.gem.bak ; \
-						cp -vf %s %s/etc/dm/menu.tcl ; chmod -v a+r %s/etc/dm/menu.tcl ;", gisbase, gisbase, TMP_GISMAN, gisbase, gisbase);
-    }
-    else {
-	sprintf(str,
-		"cp -f %s/etc/dm/menu.tcl %s/etc/dm/menu.tcl.gem.bak &> %s ; \
-						cp -f %s %s/etc/dm/menu.tcl &> %s ; chmod a+r %s/etc/dm/menu.tcl &> %s ;", gisbase, gisbase, TMP_NULL, TMP_GISMAN, gisbase, TMP_NULL, gisbase, TMP_NULL);
-    }
-    strcpy(GISMAN_CMD, str);
-
-
-    /* count number of lines in menu.tcl */
-    n_lines = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	n_lines++;
-    }
-    if (n_lines == 0) {
-	return (-1);
-    }
-    rewind(f_in);
-    n_lines_org = n_lines;
-
-    /* create an array large enough to hold all lines in menu.tcl */
-    /* plus one NULL terminator */
-    /* and copy all lines from menu.tcl into this */
-    line = (char **)calloc(n_lines + 1, sizeof(char *));
-    for (i = 0; i < n_lines + 1; i++) {
-	line[i] = NULL;
-    }
-    i = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	line[i] = (char *)malloc((1 + strlen(str)) * sizeof(char));
-	strcpy(line[i], str);
-	i++;
-    }
-
-    /* search for uninstall comment */
-    sprintf(str, "#(DO_NOT_REMOVE_THIS_COMMENT) <%s> {cascad",
-	    pkg_short_name);
-    pos = find_pos(str, line, 0);
-    if (pos == -1) {
-	print_warning
-	    ("could not find uninstall information in 'menu.tcl'.\n");
-	return (-1);
-    }
-
-    /* copy name of submenu to search for */
-    lq = strchr(line[pos], '\"');
-    lq++;
-    rq = strchr(lq, '\"');
-    strcpy(tmp, lq);
-    tmp[(rq - lq) / sizeof(char)] = '\0';
-
-    /* now find "Xtns" menu start and end */
-    start = find_pos("\"&Xtns\" all options 1", line, 0);
-    end = find_pos("\" all options", line, start + 1) - 1;
-    if (end == -1) {
-	end = find_pos("}]", line, 0);	/* end of menu.tcl */
-    }
-
-    if (start == -1) {
-	print_warning("menu 'Xtns' does not exist.\n");
-	return (-1);
-    }
-
-    /* now find our submenu and set the search range to it */
-    sprintf(str, "{cascad \"%s\"", tmp);
-    start_sub = find_pos(str, line, start);
-    if ((start_sub == -1) || (start_sub > end)) {
-	print_warning("could not find submenu entry '%s' in 'menu.tcl'.\n",
-		      tmp);
-	return (-1);
-    }
-    end_sub = find_pos(" \t\t\t}}", line, start_sub);
-    if ((end_sub == -1) || (end_sub > end)) {
-	print_warning
-	    ("could not find end of submenu entry '%s' in 'menu.tcl'.\n",
-	     tmp);
-	return (-1);
-    }
-
-    num_removed = 0;
-
-    /* now kill every line in between start and end! */
-    for (i = 0; i < ((end_sub - start_sub) + 1); i++) {
-	delete_str(start_sub, line);
-	num_removed++;
-    }
-
-    /* now kill the uninstall comment */
-    sprintf(str, "#(DO_NOT_REMOVE_THIS_COMMENT) <%s> {cascad",
-	    pkg_short_name);
-    pos = find_pos(str, line, 0);
-    delete_str(pos, line);
-    num_removed++;
-
-    /* check if there are any submenus left in "Xtns" and if not: remove Xtns menu */
-    start = find_pos("\"&Xtns\" all options 1", line, 0);
-    end = find_pos("\" all options", line, start + 1) - 1;
-    if (end - start < 3) {
-	for (i = 0; i < ((end - start) + 1); i++) {
-	    delete_str(start, line);
-	    num_removed++;
-	}
-    }
-
-    /* write output to tmpfile */
-    i = 0;
-    while (line[i] != NULL) {
-	fprintf(f_out, line[i]);
-	i++;
-    }
-    fflush(f_out);
-
-    /* check for accidental corruption of menu.tcl: if tmpfile is empty (=0 lines), 
-       we did sth. wrong and should leave the orginal file untouched! */
-    rewind(f_out);
-    n_lines_new = 0;
-    while (fgets(str, MAXSTR, f_out) != NULL) {
-	n_lines_new++;
-    }
-    if ((n_lines_new == 0)) {
-	print_warning
-	    ("file truncation detected. Retaining orginal file 'menu.tcl'.\n");
-	strcpy(GISMAN_CMD, "");
-    }
-
-    /* close files */
-    fclose(f_in);
-    fclose(f_out);
-
-    /* free memory */
-    for (i = 0; i < n_lines + 1; i++) {
-	free(line[i]);
-    }
-    free(line);
-
-    return (num_removed);
-}
-
-
-/*
-   This version is for Michael Barton's new GIS Manager.
-   In this case, all we have to do is delete the .gem file!
- */
-void deregister_entries_gisman2(char *pkg_short_name, char *gisbase)
-{
-    char file[MAXSTR];
-    FILE *f_gisman2;
-    char str[MAXSTR];
-
-    /* check if entries-gisman2 exists and is readable */
-    sprintf(file, "%s/etc/gm/Xtns/%s.gem", gisbase, pkg_short_name);
-    f_gisman2 = fopen(file, "r");
-    if (f_gisman2 == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist */
-	    return;
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_gisman2);
-	    print_error(ERR_DEREGISTER_ENTRIES_GISMAN2,
-			"checking for file '%s': %s\n", file,
-			strerror(errno));
-	}
-    }
-
-    if (VERBOSE) {
-	sprintf(str, "rm -vf %s/etc/gm/Xtns/%s.gem ; ",
-		gisbase, pkg_short_name);
-    }
-    else {
-	sprintf(str, "rm -f %s/etc/gm/Xtns/%s.gem ; ",
-		gisbase, pkg_short_name);
-
-    }
-    strcpy(GISMAN_CMD, str);
-}
-
-
-/*
-   Returns number of restored entries 
- */
-int restore_entries_gisman(char *gisbase)
-{
-    char str[MAXSTR];
-    char menu[MAXSTR];
-    char file[MAXSTR];
-    char dir[MAXSTR];
-    char pkg_short_name[MAXSTR];
-    int len;
-    char **line;
-    int n_entries, n_lines, i;
-    int line_no;
-    FILE *f_gisman, *f_in, *f_out;
-    DIR *dirp;
-    struct dirent *ep;
-    int num_restored;
-    int n_files;
-
-    /* check if menu.tcl exists and is readable */
-    sprintf(file, "%s/etc/dm/menu.tcl", gisbase);
-    f_in = fopen(file, "r");
-    if (f_in == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist */
-	    return (0);
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_in);
-	    print_error(ERR_REGISTER_ENTRIES_GISMAN,
-			"checking for file '%s': %s\n", file,
-			strerror(errno));
-	}
-    }
-
-    /* create a temporary menu.tcl file for write access */
-    /* TODO: Do not hardcode temp paths */
-    strcpy(TMP_GISMAN, "/tmp/grass.extensions.db.XXXXXX");	/* TMP_GISMAN is a global variable */
-    mkstemp(TMP_GISMAN);
-
-    f_out = fopen(TMP_GISMAN, "w+");
-    if (f_out == NULL) {
-	print_error(ERR_REGISTER_ENTRIES_GISMAN,
-		    "could not create temp file '%s': %s\n \
-			Make sure that directory /tmp exists on your system and you have write permission.\n", TMP_GISMAN, strerror(errno));
-    }
-    atexit(&exit_db);		/* now need to register an at exit func to remove tmpdb automatically! */
-
-    /* everything fine: create a shell command to copy modified menu.tcl on uninstall */
-    if (VERBOSE) {
-	sprintf(str, "cp -vf %s/etc/dm/menu.tcl %s/etc/dm/menu.tcl.gem.bak ; \
-						cp -vf %s %s/etc/dm/menu.tcl ; chmod -v a+r %s/etc/dm/menu.tcl ;", gisbase, gisbase, TMP_GISMAN, gisbase, gisbase);
-    }
-    else {
-	sprintf(str,
-		"cp -f %s/etc/dm/menu.tcl %s/etc/dm/menu.tcl.gem.bak &> %s ; \
-						cp -f %s %s/etc/dm/menu.tcl &> %s ; chmod a+r %s/etc/dm/menu.tcl &> %s ;", gisbase, gisbase, TMP_NULL, TMP_GISMAN, gisbase, TMP_NULL, gisbase, TMP_NULL);
-    }
-    strcpy(GISMAN_CMD, str);
-
-    /* allocate a pointer to the directory structure */
-    sprintf(dir, "%s/etc/dm/gem-entries", gisbase);
-    dirp = opendir(dir);
-    if (dirp == NULL) {
-	/* directory does not exist or is not accessible */
-	return (0);
-    }
-
-    /* PASS 1 */
-    /* open all files in gem-entries and count the number of lines each has */
-    n_entries = 0;
-    n_files = 0;
-    while ((ep = readdir(dirp))) {
-	sprintf(file, "%s/%s", dir, ep->d_name);
-	f_gisman = fopen(file, "r");
-	if ((!strcmp(ep->d_name, ".")) || (!strcmp(ep->d_name, ".."))) {
-	    fclose(f_gisman);
-	    continue;
-	}
-	if (f_gisman == NULL) {
-	    fclose(f_gisman);
-	    continue;
-	}
-	/* count number of lines in file */
-	while (fgets(str, MAXSTR, f_gisman) != NULL) {
-	    n_entries++;
-	}
-	n_files++;
-	fclose(f_gisman);
-    }
-    closedir(dirp);
-
-    /* count number of lines in menu.tcl */
-    n_lines = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	n_lines++;
-    }
-    if (n_lines == 0) {
-	return (0);
-    }
-    rewind(f_in);
-
-    /* create an array large enough to hold all lines in menu.tcl */
-    /* plus the entries that are to be added from the files in gem-entries/ */
-    /* plus space for uninstall comments */
-    /* plus one NULL terminator */
-    /* and copy all lines from menu.tcl into this */
-    line =
-	(char **)calloc(n_lines + (n_entries * 2) + (n_files * 5) + 1,
-			sizeof(char *));
-    for (i = 0; i < (n_lines + (n_entries * 2) + (n_files * 5) + 1); i++) {
-	line[i] = NULL;
-    }
-    i = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	line[i] = (char *)malloc((1 + strlen(str)) * sizeof(char));
-	strcpy(line[i], str);
-	i++;
-    }
-    line[i] = NULL;		/* add NULL terminator */
-
-    check_ext_menu(line);	/* create "Extensions" menu if necessary */
-
-    /* PASS 2: re-create submenus and all menu items if necessary */
-    dirp = opendir(dir);
-    num_restored = 0;
-    while ((ep = readdir(dirp))) {
-	sprintf(file, "%s/%s", dir, ep->d_name);
-	if ((!strcmp(ep->d_name, ".")) || (!strcmp(ep->d_name, ".."))) {
-	    continue;
-	}
-	f_gisman = fopen(file, "r");
-	if (f_gisman == NULL) {
-	    continue;
-	}
-	/* read all lines from entries-gisman and add to menus */
-	i = 1;
-	while (nc_fgets_nb(str, MAXSTR, f_gisman) != NULL) {
-	    if (i == 1) {
-		/* store name of menu item */
-		len = (strrchr(str, ']') - strchr(str, '[')) / sizeof(char);
-		strncpy(menu, strchr(str, '[') + sizeof(char), len);
-		menu[len - 1] = '\0';	/* get rid of [] */
-		line_no = new_submenu(pkg_short_name, str, line);
-		if (line_no < 0) {
-		    break;
-		}
-		i++;
-		num_restored++;
-	    }
-	    else {
-		line_no = new_item(str, menu, line, line_no);
-		if (line_no < 0) {
-		    break;
-		}
-		i++;
-		num_restored++;
-	    }
-	}
-	fclose(f_gisman);
-    }
-    closedir(dirp);
-
-    /* write output to tmpfile */
-    i = 0;
-    while (line[i] != NULL) {
-	fprintf(f_out, line[i]);
-	i++;
-    }
-    fflush(f_out);
-
-    /* close remaining files */
-    fclose(f_in);
-    fclose(f_out);
-
-    /* free memory */
-    for (i = 0; i < (n_lines + (n_entries * 2) + (n_files * 5) + 1); i++) {
-	free(line[i]);
-    }
-    free(line);
-
-    return (num_restored);
-}

+ 0 - 39
gem/reg_entries.h

@@ -1,39 +0,0 @@
-
-/***************************************************************************
- *            reg_entries.h
- *
- *  Fri May 13 11:35:46 2005
- *  Copyright  2005  User
- *  Email
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _REG_ENTRIES_H
-#define _REG_ENTRIES_H
-
-void register_entries_gisman(char *pkg_short_name, char *gisbase);
-
-void register_entries_gisman2(char *pkg_short_name, char *gisbase);
-
-int deregister_entries_gisman(char *pkg_short_name, char *gisbase);
-
-void deregister_entries_gisman2(char *pkg_short_name, char *gisbase);
-
-int restore_entries_gisman(char *gisbase);
-
-#endif /* _REG_ENTRIES_H */

+ 0 - 549
gem/reg_html.c

@@ -1,549 +0,0 @@
-
-/***************************************************************************
- *            reg_html.c
- *
- *  Fri May 20 18:14:32 2005
- *  Copyright  2005  User
- *  Email
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-
-#include "globals.h"
-
-void new_ext_html(char *ext, char *gisbase, char **html, int major, int minor,
-		  int revision)
-{
-    int pos1, pos2, pos3;
-    int start, end;
-    int insert_here;
-    char *first_char;
-    char *last_char;
-    char item[MAXSTR];
-    int len;
-
-    pos1 = find_pos("<b>Drivers sections:</b>", html, 0);	/* first go to section on "Drivers" */
-    if (pos1 < 0) {
-	/* we have a new version of the HTML docs that does not have a "Drivers" section anymore */
-	/* let's check for the special GEM comment */
-	pos1 =
-	    find_pos
-	    ("<!-- GEM Extensions StartHTML. Do not delete or change this comment! -->",
-	     html, 0);
-	if (pos1 < 0) {
-	    /* sorry, I can't handle these HTML docs */
-	    print_warning
-		("Unknown format of index.html. Unable to register HTML man pages.\n");
-	    return;
-	}
-    }
-    pos2 = find_pos("<hr>", html, pos1);	/* the horizontal ruler marks the end of the HTML text */
-    if (find_pos("<h3>Installed extensions:</h3>", html, pos1) == -1) {
-	/* Extensions section does not yet exist: create it now */
-	insert_str("<h3>Installed extensions:</h3>\n", pos2, html);
-	insert_str("<ul>\n", pos2 + 1, html);
-	insert_str("</ul>\n", pos2 + 2, html);
-	insert_str("<p>\n", pos2 + 3, html);
-    }
-
-    start = find_pos("<h3>Installed extensions:</h3>", html, pos1);
-    end = find_pos("</ul>", html, start);
-    insert_here = start + 2;
-    /* check if this entry already exists and if so: bail out or overwrite, if force mode */
-    sprintf(item, "\">%s", ext);
-    pos3 = find_pos(item, html, insert_here);
-    if (pos3 != -1) {
-	/* exists:  */
-	print_warning("list item '%s' exists in index.html.\n", ext);
-	if ((FORCE) && (UPGRADE)) {
-	    sprintf(item,
-		    "<li><a href=\"../extensions/%s/index.html\">%s (%i.%i.%i)</a>\n",
-		    ext, ext, major, minor, revision);
-	    strcpy(html[pos3], item);
-	}
-	return;
-    }
-
-    /* now go through all links in the Extensions section and insert this one in the right
-       alphabetical position */
-    pos3 = find_pos("<li><a href=", html, start);
-    while ((pos3 != -1) && (pos3 < end)) {
-	/* extract name of extension at this position */
-	first_char = strrchr(html[pos3], '"');
-	last_char = strrchr(html[pos3], '<');
-	len = (last_char - first_char) / sizeof(char);
-	strncpy(item, first_char + 2 * sizeof(char), len);
-	item[len - 1] = '\0';	/* get rid of '<' */
-	if (strcmp(ext, item) < 0) {
-	    insert_here = pos3;
-	    break;		/* found our position: let's quit this! */
-	}
-	/* look for next item */
-	start++;
-	pos3 = find_pos("<li><a href=", html, start);
-    }
-
-    /* now insert new entry for this extension */
-    sprintf(item,
-	    "<li><a href=\"../extensions/%s/index.html\">%s (%i.%i.%i)</a>\n",
-	    ext, ext, major, minor, revision);
-    insert_str(item, insert_here, html);
-
-}
-
-
-void delete_ext_html(char *ext, char *gisbase, char **html)
-{
-    int pos1, pos2, pos3;
-    int start, end;
-    char item[MAXSTR];
-    int found;
-    int i;
-
-    pos1 = find_pos("<b>Drivers sections:</b>", html, 0);	/* first go to section on "Drivers" */
-    if (pos1 < 0) {
-	/* we have a new version of the HTML docs that does not have a "Drivers" section anymore */
-	/* let's check for the special GEM comment */
-	pos1 =
-	    find_pos
-	    ("<!-- GEM Extensions StartHTML. Do not delete or change this comment! -->",
-	     html, 0);
-	if (pos1 < 0) {
-	    /* sorry, I can't handle these HTML docs */
-	    print_warning
-		("Unknown format of index.html. Unable to de-register HTML man pages.\n");
-	    return;
-	}
-    }
-
-    pos2 = find_pos("<hr>", html, pos1);	/* the horizontal ruler marks the end of the HTML text */
-    if (find_pos("<h3>Installed extensions:</h3>", html, pos1) == -1) {
-	/* Extensions section does not exist: bail out! */
-	print_warning("no extensions section found in index.html.\n");
-	return;
-    }
-
-    start = find_pos("<h3>Installed extensions:</h3>", html, pos1);
-    end = find_pos("</ul>", html, start);
-    /* check if the entry exists and if so delete */
-    found = 0;
-    sprintf(item, "\">%s", ext);
-    pos3 = find_pos(item, html, start);
-    if (pos3 == -1) {
-	/* does not exist: */
-	print_warning("extension '%s' not listed in index.html.\n", ext);
-	return;
-    }
-
-    /* delete item, if it was found in the extensions section */
-    if (pos3 < end) {
-	delete_str(pos3, html);
-    }
-    end--;			/* end of extensions section is no one up! */
-
-    /* if no more entries left in the extensions list: delete the entire section */
-    pos3 = find_pos("<ul>", html, start);
-    if ((pos3 != -1) && (end > pos3) && (end - pos3 < 2)) {
-	for (i = 0; i < 4; i++) {
-	    delete_str(pos3 - 1, html);
-	}
-    }
-}
-
-
-void register_html(char *pkg_short_name, char *gisbase, int major, int minor,
-		   int revision)
-{
-
-    char file[MAXSTR];
-    char str[MAXSTR];
-    char **line;
-    int n_lines, i;
-    FILE *f_in, *f_out;
-
-    /* check if index.html exists and is readable */
-    sprintf(file, "%s/docs/html/index.html", gisbase);
-    f_in = fopen(file, "r");
-    if (f_in == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist */
-	    return;
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_in);
-	    print_error(ERR_REGISTER_HTML, "checking for file '%s': %s\n",
-			file, strerror(errno));
-	}
-    }
-
-    /* create a temporary index.html copy for write access */
-    /* TODO: Do not hardcode temp paths */
-    strcpy(TMP_HTML, "/tmp/grass.extensions.db.XXXXXX");	/* TMP_HTML is a global variable */
-    mkstemp(TMP_HTML);
-
-    f_out = fopen(TMP_HTML, "w+");
-    if (f_out == NULL) {
-	print_error(ERR_REGISTER_HTML,
-		    "could not create temp file '%s': %s\n \
-		Make sure that directory /tmp exists on your system and you have write permission.\n", TMP_HTML, strerror(errno));
-    }
-
-    atexit(&exit_db);		/* now need to register an at exit func to remove tmpdb automatically! */
-
-    /* everything fine: create a shell command to install HTML stuff */
-    if (VERBOSE) {
-	sprintf(str,
-		"cp -vf %s %s/docs/html/index.html ; chmod -v a+r %s/docs/html/index.html ;",
-		TMP_HTML, gisbase, gisbase);
-    }
-    else {
-	sprintf(str,
-		"cp -f %s %s/docs/html/index.html &>%s ; chmod a+r %s/docs/html/index.html &>%s ;",
-		TMP_HTML, gisbase, TMP_NULL, gisbase, TMP_NULL);
-    }
-    strcpy(HTML_CMD, str);
-
-    /* count number of lines in index.html */
-    n_lines = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	n_lines++;
-    }
-    if (n_lines == 0) {
-	return;
-    }
-    rewind(f_in);
-
-    /* create an array large enough to hold all lines in index.html */
-    /* plus the entries that are to be added for the extension */
-    /* plus one NULL terminator */
-    /* and copy all lines from index.html into this */
-    line = (char **)calloc(n_lines + 10, sizeof(char *));
-    for (i = 0; i < (n_lines + 10); i++) {
-	line[i] = NULL;
-    }
-    i = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	line[i] = (char *)malloc((1 + strlen(str)) * sizeof(char));
-	strcpy(line[i], str);
-	i++;
-    }
-
-    /* create "Extensions" entry in html document if necessary and add a link to */
-    /* this extension's HTML man index */
-    new_ext_html(pkg_short_name, gisbase, line, major, minor, revision);
-
-    /* write output to tmpfile */
-    i = 0;
-    while (line[i] != NULL) {
-	fprintf(f_out, line[i]);
-	i++;
-    }
-    fflush(f_out);
-
-    /* close files */
-    fclose(f_in);
-    fclose(f_out);
-
-    /* free memory */
-    for (i = 0; i < (n_lines + 10); i++) {
-	free(line[i]);
-    }
-    free(line);
-}
-
-
-void deregister_html(char *pkg_short_name, char *gisbase)
-{
-
-    char file[MAXSTR];
-    char str[MAXSTR];
-    char **line;
-    int n_lines, i;
-    FILE *f_in, *f_out;
-
-    /* check if index.html exists and is readable */
-    sprintf(file, "%s/docs/html/index.html", gisbase);
-    f_in = fopen(file, "r");
-    if (f_in == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist */
-	    return;
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_in);
-	    print_error(ERR_REGISTER_HTML, "checking for file '%s': %s\n",
-			file, strerror(errno));
-	}
-    }
-
-    /* create a temporary index.html copy for write access */
-    /* TODO: Do not hardcode temp paths */
-    strcpy(TMP_HTML, "/tmp/grass.extensions.db.XXXXXX");	/* TMP_HTML is a global variable */
-    mkstemp(TMP_HTML);
-
-    f_out = fopen(TMP_HTML, "w+");
-    if (f_out == NULL) {
-	print_error(ERR_REGISTER_HTML,
-		    "could not create temp file '%s': %s\n \
-		Make sure that directory /tmp exists on your system and you have write permission.\n", TMP_HTML, strerror(errno));
-    }
-
-    atexit(&exit_db);		/* now need to register an at exit func to remove tmpdb automatically! */
-
-    /* everything fine: create a shell command to copy modified HTML stuff on uninstall */
-    if (VERBOSE) {
-	sprintf(str,
-		"cp -vf %s %s/docs/html/index.html ; chmod -v a+r %s/docs/html/index.html ;",
-		TMP_HTML, gisbase, gisbase);
-    }
-    else {
-	sprintf(str,
-		"cp -f %s %s/docs/html/index.html &>%s ; chmod a+r %s/docs/html/index.html &>%s ;",
-		TMP_HTML, gisbase, TMP_NULL, gisbase, TMP_NULL);
-    }
-    strcpy(HTML_CMD, str);
-
-
-    /* count number of lines in index.html */
-    n_lines = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	n_lines++;
-    }
-    if (n_lines == 0) {
-	return;
-    }
-    rewind(f_in);
-
-    /* create an array large enough to hold all lines in index.html */
-    /* plus one NULL terminator */
-    /* and copy all lines from index.html into this */
-    line = (char **)calloc(n_lines + 1, sizeof(char *));
-    for (i = 0; i < (n_lines + 1); i++) {
-	line[i] = NULL;
-    }
-    i = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	line[i] = (char *)malloc((1 + strlen(str)) * sizeof(char));
-	strcpy(line[i], str);
-	i++;
-    }
-
-    /* delete link to this extension's HTML manual from index.html */
-    delete_ext_html(pkg_short_name, gisbase, line);
-
-    /* write output to tmpfile */
-    i = 0;
-    while (line[i] != NULL) {
-	fprintf(f_out, line[i]);
-	i++;
-    }
-    fflush(f_out);
-
-    /* close files */
-    fclose(f_in);
-    fclose(f_out);
-
-    /* free memory */
-    for (i = 0; i < (n_lines + 1); i++) {
-	free(line[i]);
-    }
-    free(line);
-}
-
-
-/*
-   Returns number of restored entries 
- */
-int restore_html(char *gisbase)
-{
-    char str[MAXSTR];
-    char idx[MAXSTR];
-    char ext_idx[MAXSTR];
-    char dir[MAXSTR];
-    char subdir[MAXSTR];
-    char **line;
-    int n_entries, n_lines, i;
-    FILE *f_in, *f_out, *f_ext;
-    DIR *dirp;
-    DIR *subdirp;
-    struct dirent *ep;
-    int num_restored;
-    int n_subdirs;
-    int major, minor, revision;
-
-
-    /* check if index.html exists and is readable */
-    sprintf(idx, "%s/docs/html/index.html", gisbase);
-    f_in = fopen(idx, "r");
-    if (f_in == NULL) {
-	if (errno == ENOENT) {
-	    /* file does not exist */
-	    return (0);
-	}
-	else {
-	    /* sth. strange happened */
-	    fclose(f_in);
-	    print_error(ERR_REGISTER_HTML, "checking for file '%s': %s\n",
-			idx, strerror(errno));
-	}
-    }
-
-    /* create a temporary index.html copy for write access */
-    /* TODO: Do not hardcode temp paths */
-    strcpy(TMP_HTML, "/tmp/grass.extensions.db.XXXXXX");	/* TMP_HTML is a global variable */
-    mkstemp(TMP_HTML);
-
-    f_out = fopen(TMP_HTML, "w+");
-    if (f_out == NULL) {
-	print_error(ERR_REGISTER_HTML,
-		    "could not create temp file '%s': %s\n \
-		Make sure that directory /tmp exists on your system and you have write permission.\n", TMP_HTML, strerror(errno));
-    }
-
-    /* everything fine: create a shell command to install HTML stuff */
-    if (VERBOSE) {
-	sprintf(str,
-		"cp -vf %s %s/docs/html/index.html ; chmod -v a+r %s/docs/html/index.html ;",
-		TMP_HTML, gisbase, gisbase);
-    }
-    else {
-	sprintf(str,
-		"cp -f %s %s/docs/html/index.html &>%s ; chmod a+r %s/docs/html/index.html &>%s ;",
-		TMP_HTML, gisbase, TMP_NULL, gisbase, TMP_NULL);
-    }
-    strcpy(HTML_CMD, str);
-
-    atexit(&exit_db);		/* now need to register an at exit func to remove tmpdb automatically! */
-
-    /* allocate a pointer to the directory structure */
-    sprintf(dir, "%s/docs/extensions", gisbase);
-    dirp = opendir(dir);
-    if (dirp == NULL) {
-	/* directory does not exist or is not accessible */
-	return (0);
-    }
-
-    /* PASS 1 */
-    /* count number of subdirs in docs/extensions/ each new link will require one entry in index.html */
-    n_entries = 0;
-    n_subdirs = 0;
-    while ((ep = readdir(dirp))) {
-	sprintf(subdir, "%s/%s", dir, ep->d_name);
-	if ((!strcmp(ep->d_name, ".")) || (!strcmp(ep->d_name, ".."))) {
-	    continue;
-	}
-	subdirp = opendir(subdir);
-	if (subdirp == NULL) {
-	    continue;
-	}
-	n_subdirs++;
-	closedir(subdirp);
-    }
-    closedir(dirp);
-
-    /* count number of lines in menu.tcl */
-    n_lines = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	n_lines++;
-    }
-    if (n_lines == 0) {
-	return (0);
-    }
-    rewind(f_in);
-
-    /* create an array large enough to hold all lines in index.html */
-    /* plus one new entry to make a link for each extension */
-    /* plus space for the new Extensions section */
-    /* plus one NULL terminator */
-    /* and copy all lines from menu.tcl into this */
-    line = (char **)calloc(n_lines + n_subdirs + 10, sizeof(char *));
-    for (i = 0; i < (n_lines + n_subdirs + 10); i++) {
-	line[i] = NULL;
-    }
-    i = 0;
-    while (fgets(str, MAXSTR, f_in) != NULL) {
-	line[i] = (char *)malloc((1 + strlen(str)) * sizeof(char));
-	strcpy(line[i], str);
-	i++;
-    }
-    line[i] = NULL;		/* add NULL terminator */
-
-    /* PASS 2: re-create links if necessary */
-    dirp = opendir(dir);
-    num_restored = 0;
-    while ((ep = readdir(dirp))) {
-	sprintf(subdir, "%s/%s", dir, ep->d_name);
-	if ((!strcmp(ep->d_name, ".")) || (!strcmp(ep->d_name, ".."))) {
-	    continue;
-	}
-	subdirp = opendir(subdir);
-	if (subdirp == NULL) {
-	    continue;
-	}
-	closedir(subdirp);
-
-	/* try to open extension's index.html file */
-	sprintf(ext_idx, "%s/index.html", subdir);
-	f_ext = fopen(ext_idx, "r");
-	if (f_ext == NULL) {
-	    continue;		/* cannot access index.html: skip to next extension */
-	}
-	major = 0;
-	minor = 0;
-	revision = 0;
-	/* retrieve version information from extension's index.html */
-	i = 0;
-	while (fgets(str, MAXSTR, f_ext) != NULL) {
-	    if (strstr(str, "<title>") != NULL) {
-		i = 1;
-		break;		/* this is the title line: that's all we need */
-	    }
-	}
-	if (i == 0) {
-	    continue;		/* not a valid index.html: skip to next extension */
-	}
-	sscanf(strchr(str, '(') + sizeof(char), "%i.%i.%i", &major, &minor,
-	       &revision);
-	new_ext_html(ep->d_name, gisbase, line, major, minor, revision);
-	num_restored++;
-	fclose(f_ext);
-    }
-    closedir(dirp);
-
-    /* write output to tmpfile */
-    i = 0;
-    while (line[i] != NULL) {
-	fprintf(f_out, line[i]);
-	i++;
-    }
-    fflush(f_out);
-
-    /* close remaining files */
-    fclose(f_in);
-    fclose(f_out);
-
-    /* free memory */
-    for (i = 0; i < (n_lines + n_subdirs + 10); i++) {
-	free(line[i]);
-    }
-    free(line);
-
-    return (num_restored);
-}

+ 0 - 36
gem/reg_html.h

@@ -1,36 +0,0 @@
-
-/***************************************************************************
- *            reg_html.h
- *
- *  Fri May 20 18:14:46 2005
- *  Copyright  2005  User
- *  Email
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _REG_HTML_H
-#define _REG_HTML_H
-
-void register_html(char *pkg_short_name, char *gisbase, int major, int minor,
-		   int revision);
-
-void deregister_html(char *pkg_short_name, char *gisbase);
-
-int restore_html(char *gisbase);
-
-#endif /* _REG_HTML_H */

+ 0 - 29
gem/skeleton/README

@@ -1,29 +0,0 @@
-<NameOfExtension>
-Version <0.0.0>
-<Date>
-
-Author: <Author's name>
-	<Affiliation>
-	<Email>
-
-License: <GNU General Public License (GPL) or other>
-
-
-Installation:
-
-This is an extension for the open source Geographic Information System
-GRASS GIS version 6.0.0 and above (see http://grass.itc.it).
-It can be installed using the GRASS Extension Manager (GEM) tool, downloadable from:
-
-	http://www.uni-kiel.de/ufg/ufg_BerDucke.htm
-	
-See the README file for GEM for instructions on how to install and use the
-software.
-
-
-Description:
-
-<Short introductory text>
-
-	<r.foo>		- <short info on what r.foo does>
-	<..>		- <..>

+ 0 - 6
gem/skeleton/authors

@@ -1,6 +0,0 @@
-# Please put the names of the people who wrote or contributed
-# to this extension here
-# You can use HTML tags in this file. All HTML tags will be ignored if this
-# file is output to the text console. The only exceptions are <br> and <p>
-# which produce one or two newlines where appropriate.
-

+ 0 - 5
gem/skeleton/bugs

@@ -1,5 +0,0 @@
-# Please describe all known bugs and shortcomings of the current implementation
-# of your extension.
-# You can use HTML tags in this file. All HTML tags will be ignored if this
-# file is output to the text console. The only exceptions are <br> and <p>
-# which produce one or two newlines where appropriate.

+ 0 - 3
gem/skeleton/commands

@@ -1,3 +0,0 @@
-# For the user's convenience: please provide a short list of all
-# GRASS modules which this extension provides, e.g.:
-# r.cva (perform viewshed analysis)

+ 0 - 22
gem/skeleton/depends

@@ -1,22 +0,0 @@
-# List all extensions here on which your own extension depends.
-# The install routine will check if these are installed before
-# installing yours.
-# Each line should have <extension name> and <major.minor.revision>
-# tokens, separated by tabs.
-# E.g.:
-#
-# myExtension	1.0.2
-#
-# If extension name is "GRASS", the install routine will check that
-# the correct GRASS version is present:
-#
-# GRASS	6.0.1
-#
-# You can put in commented and empty lines if you wish, as well as
-# end-of-line comments, e.g.:
-#
-# GRASS	6.0.1	# due to some bugs in 6.0.0
-#
-# If you leave out the version number, or parts of it, every missing
-# part will be interpreted as "0" by the install routine.
-#

+ 0 - 7
gem/skeleton/description

@@ -1,7 +0,0 @@
-# This file should contain a very brief description of what your extension does.
-# Commented lines and parts of lines after a comment mark ('#') will be skipped.
-# This file will also be included in the HTML documentation page for your
-# extension.
-# You can use HTML tags in this file. All HTML tags will be ignored if this
-# file is output to the text console. The only exceptions are <br> and <p>
-# which produce one or two newlines where appropriate.

+ 0 - 20
gem/skeleton/entries-gisman

@@ -1,20 +0,0 @@
-# This will register modules in GIS manager's pull-down menu
-# under the "Extensions" menu by modifying (GISBASE)/etc/dm/menu.tcl
-#
-# The first line MUST start with a submenu name in [brackets]. This
-# will create the extension's submenu under "Extensions".
-# Extensions cannot create entries directly in the "Extensions" menu
-#
-# Each other line consists of two tokens that MUST be separated with ';'
-# The last token specifies the command to be called
-#
-# Use a simple '-' to get a separator line
-#
-# For command specifiers, prefix either "execute" or "term"
-#
-# E.g.:
-#
-#[Viewshed Analysis]
-#Calculate cumulative viewsheds;execute r.cva	
-
-

+ 0 - 29
gem/skeleton/entries-gisman2

@@ -1,29 +0,0 @@
-# This file is a definition for a tk menu list.
-# It will be parsed and inserted in the "Xtns" menu by gis.m
-# It is really a tcl list object.
-# This shows you how to create a cascading menu structure for your extension
-# under the "Xtns" menu.
-# There are some variables in here that gis.m will interpret:
-#
-#	$tmenu sets tear-off menus (True/False)
-#	$execom (?)
-#
-# Please take a look at $GISBASE/etc/gm/gmmenu.tcl for more possibilities
-cascad "Top menu" {} "" $tmenu {			
-	{cascad "First submenu" {} "" $tmenu { # this starts a new submenu			
-		{command "First item in first submenu" {} "r.in.gdal" {} -command { execute r.in.gdal }} # this is a menu entry
-		{separator} # a menu separator is just a horizontal line
-		{command "Second item in first submenu" {} "r.out.gdal" {} -command { execute r.out.gdal }}
-		{command "A command to start in a Terminal" {} "g.mlist" {} -command {$execom g.mlist }}}
-	}
-	{cascad "Second submenu" {} "" $tmenu {			
-		{command "Binary file (includes GTOPO30 format)" {} "r.in.bin" {} -command { execute r.in.bin }}
-		{command "ESRI Arc/Info ASCII grid" {} "r.in.arc" {} -command { execute r.in.arc }}
-		{command "GRIDATB.FOR map file (TOPMODEL)" {} "r.in.gridatb" {} -command { execute r.in.gridatb }}
-		{command "MAT-File (v.4) array (Matlab or Octave)" {} "r.in.mat" {} -command { execute r.in.mat }}
-		{command "SRTM hgt files" {} "r.in.srtm" {} -command { execute r.in.srtm }}
-		{command "Terra ASTER HDF files" {} "r.in.aster" {} -command { execute r.in.aster }}}
-	}
-}
-
-

+ 0 - 7
gem/skeleton/headers

@@ -1,7 +0,0 @@
-# Applicable if your extension provides function libraries: 
-# Please provide a list of headers files (*.h) installed
-# You can use HTML tags in this file. All HTML tags will be ignored if this
-# file is output to the text console. The only exceptions are <br> and <p>
-# which produce one or two newlines where appropriate.
-# 
-# $GISBASE/include/grass/myheader.h

+ 0 - 2
gem/skeleton/id

@@ -1,2 +0,0 @@
-<GRASS extension package>
-<package version 1.0>

+ 0 - 6
gem/skeleton/info

@@ -1,6 +0,0 @@
-# Please put some more detailed information about your extension in here.
-# Commented lines and parts of lines after a comment mark ('#') will be skipped.
-# This file will also be included in the HTML documentation page for your
-# extension. Use an empty line to signal the start of a new paragraph (will be
-# converted to <p> in the HTML output).
-

+ 0 - 7
gem/skeleton/libs

@@ -1,7 +0,0 @@
-# Applicable if your extension provides function libraries: 
-# Please provide a list of library (*.so, *.a) files installed
-# You can use HTML tags in this file. All HTML tags will be ignored if this
-# file is output to the text console. The only exceptions are <br> and <p>
-# which produce one or two newlines where appropriate.
-#
-# $GISBASE/lib/libMyLib.so

+ 0 - 340
gem/skeleton/license

@@ -1,340 +0,0 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.

+ 0 - 6
gem/skeleton/name

@@ -1,6 +0,0 @@
-# The name of your extension. This must not contain whitespace or strange
-# characters! Avoid everything that a sensible Unix user would avoid in
-# a filename. This is used to determine names of files and directories
-# by GEM.
-
-

+ 0 - 66
gem/skeleton/post

@@ -1,66 +0,0 @@
-#!/bin/sh
-
-# post script. This will be called after any action has been completed
-# SUCCESSFULLY (i.e. w/o an error, warnings are ok).
-# This script will not be run if the user has
-# chosen to do only a test install (no actual installation).
-
-# ATTENTION!
-# This script is run with UID set to the owner of the GRASS system
-# installation. In many cases, this will be root.
-# So be careful, as the actions in this script might be carried out
-# with superuser privileges !!!
-
-# Several variables will be made available by the GRASS extension manager,
-# so that this script can take any action depending on what the user has
-# done.
-
-# GEM_ACTION can be "INSTALL", "QUERY", "DETAILS", "LICENSE", "CLEAN"
-
-# INSTALL_BASE is the path to the GRASS binary files installed on the
-# user's system (e.g. /usr/local/grass-7.x.y).
-# For some actions, INSTALL_BASE is not required and will be set to
-# "UNDEFINED".
-
-# INSTALL_TYPE will be either "src" or the name of the binary set the
-# user has chosen to install. 
-
-# GEM_FORCE will be "1" if the user has passed the --force option, "0" otherwise
-
-# GEM_VERBOSE will be "1" if the user has passed --verbose, "0" otherwise
-
-# GEM_GUI will be "1" if the user has started GEM in GUI mode, "0" otherwise
-
-if [ -z "$INSTALL_BASE" ] && [ -z "$GEM_ACTION" ] ; then \
-	echo "Please do not run this script manually!" ; \
-	exit ; \
-fi
-
-# Add anything that needs to be done after specific actions here
-if [ $GEM_ACTION = "INSTALL" ] ; then \
-	exit ; \
-fi
-
-if [ $GEM_ACTION = "QUERY" ] ; then \
-	exit ; \
-fi
-
-if [ $GEM_ACTION = "DETAILS" ] ; then \
-	exit ; \
-fi
-
-if [ $GEM_ACTION = "LICENSE" ] ; then \
-	exit ; \
-fi
-
-if [ $GEM_ACTION = "DETAILS" ] ; then \
-	exit ; \
-fi
-
-if [ $GEM_ACTION = "LICENSE" ] ; then \
-	exit ; \
-fi
-
-if [ $GEM_ACTION = "CLEAN" ] ; then \
-	exit ; \
-fi

+ 0 - 56
gem/skeleton/uninstall

@@ -1,56 +0,0 @@
-#!/bin/sh
-
-# ATTENTION!
-# This script is run with UID set to the owner of the GRASS system
-# installations. In many cases, this will be root.
-# So be careful, as the actions in this script might be carried out
-# with superuser privileges !!!
-
-# UNINSTALL_BASE will be exported by the GRASS extension managing tool
-# it contains the path to the GRASS binary files installed on the
-# user's system (e.g. /usr/local/grass-7.x.y).
-# By prefixing every file name with $UNINSTALL_BASE, we make sure
-# that deletions do not occur outside the GRASS installation dir.
-
-if [ -z "$UNINSTALL_BASE" ] ; then \
-	echo "Please do not run this script manually!" ; \
-	exit ; \
-fi
-
-# add names of all modules to this list
-# e.g. EXT_MODULES="r.cva v.isovist"
-EXT_MODULES=""
-
-# add names of include files (*.h) to this list
-EXT_INCLUDES=""
-
-# add names of library files (*.so) to this list
-EXT_LIBS=""
-
-# add names of subdirectories that have to be deleted recursively (be careful!)
-EXT_SUBDIRS="" 
-
-# This takes care of the actual deletion
-for i in $EXT_MODULES; do
-	# remove modules
-	rm -f $UNINSTALL_BASE/bin/$i
-	# remove HTML pages and images from docs/html
-	rm -f $UNINSTALL_BASE/docs/html/$i.*
-	# remove man pages
-	rm -f $UNINSTALL_BASE/man/man1/$i.1
-done
-
-for i in $EXT_INCLUDES; do
-	rm -f $UNINSTALL_BASE/include/grass/$i
-done
-
-for i in $EXT_LIBS; do
-	rm -f $UNINSTALL_BASE/lib/$i
-done
-
-for i in $EXT_SUBDIRS; do
-	rm -rf $UNINSTALL_BASE/$i
-done
-
-# You can add delete commands for additional files or any other commands that
-# need to be run in order to clean up here

+ 0 - 13
gem/skeleton/version

@@ -1,13 +0,0 @@
-# Write down the version of your extension here.
-# Extension version consists of three parts (major, minor, revison),e.g.:
-#
-# 1.2.0
-#
-# If you leave out the version number, or parts of it, every missing
-# part will be interpreted as "0" by the install routine, thus
-#
-# 1
-#
-# will become
-#
-# 1.0.0

+ 0 - 858
gem/tools.c

@@ -1,858 +0,0 @@
-
-/***************************************************************************
- *            tools.c
- *
- *  Mon Apr 18 15:00:13 2005
- *  Copyright  2005  Benjamin Ducke
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "globals.h"
-
-
-/* the following are for cross-platform compatibility. They may already exist
-   on a Linux or BSD system, but maybe absent e.g. in Win32, so we will define
-   them here. */
-
-
-char *basename(char *path)
-{
-    char *copy;
-    char *element;
-    char *backup;
-
-    copy = strdup(path);
-
-    backup = NULL;
-    element = strtok(copy, "/");
-    if (element == NULL) {
-	if (copy != NULL) {
-	    free(copy);
-	}
-	return (NULL);
-    }
-
-    backup = strdup(element);
-    while (element != NULL) {
-	element = strtok(NULL, "/");
-	if ((backup != NULL) && (element != NULL)) {
-	    free(backup);
-	}
-	if ((element != NULL) && (*element != '\0')) {
-	    backup = strdup(element);
-	}
-    }
-
-    if (copy != NULL) {
-	free(copy);
-    }
-
-    return (backup);
-}
-
-
-/*      A shell version of mkdir () 
-   needed because the MINGW one does no accept unix style MOD specifications.
-   THIS DOES NOT CHECK FOR ERRORS !
- */
-void mkdir_s(char *pathname, char *mode)
-{
-    char tmp[5000];
-
-    sprintf(tmp, "mkdir %s --mode=%s -p", pathname, mode);
-    system(tmp);
-
-}
-
-/* 
-   Removes all dangling white-spaces and EOL chars from the end of a string.
-   Returns total number of chopped-off characters.
- */
-int chop(char *string)
-{
-    int i;
-    int chopped;
-    int stop = 0;
-
-    chopped = 0;
-    i = strlen(string) - 1;
-    while (i >= 0) {
-	stop = 1;
-	if ((string[i] == '\n') || (string[i] == '\t') ||
-	    (string[i] == ' ') || (string[i] == '\f') ||
-	    (string[i] == '\r')) {
-	    chopped++;
-	    stop = 0;
-	}
-	if (stop == 1) {
-	    /* got a non white-space char: stop chopping! */
-	    break;
-	}
-	i--;
-    }
-
-    /* chop string */
-    string[strlen(string) - chopped] = '\0';
-
-    return (chopped);
-}
-
-
-/* 
-   Inserts a string into an array of n strings; positions start at 0
-   The size of the array will be increased by one char*. 
-   Returns new size of array.
-   String array must be NULL-terminated.
-   There must be at least one slots left after the NULL-terminator to
-   hold the new string! This function will not resize the string
-   array to accomodate the new string!
- */
-int insert_str(char *str, int pos, char **strarr)
-{
-    char save[MAXSTR];
-    char insert[MAXSTR];
-    char last[MAXSTR];
-    int n, j;
-    int len;
-
-    /* check for valid pos */
-    n = 0;
-    while (strarr[n] != NULL) {
-	n++;
-    }
-
-    if ((pos < 0) || (pos > (n))) {
-	print_error(ERR_REGISTER_ENTRIES_GISMAN,
-		    "insert: invalid line number %i.\n", pos);
-    }
-
-    /* if a new string is to be added to the end of the array: */
-    if (pos == n) {
-	len = (1 + strlen(str)) * sizeof(char);
-	strarr[n] = malloc(len);
-	strcpy(strarr[n], str);
-	n = n + 2;
-	strarr[n - 1] = NULL;
-	return (n);
-    }
-
-    strcpy(last, strarr[n - 1]);
-    strcpy(insert, strarr[pos]);
-    free(strarr[pos]);
-    strarr[pos] = malloc((1 + strlen(str)) * sizeof(char));
-    strcpy(strarr[pos], str);
-    /* now move all strings > pos up one */
-    for (j = pos; j < n - 1; j++) {
-	strcpy(save, strarr[j + 1]);	/* save string to be overwritten */
-	free(strarr[j + 1]);	/* overwrite string */
-	len = (1 + strlen(insert)) * sizeof(char);	/* make room for string to be inserted */
-	strarr[j + 1] = malloc(len);
-	strcpy(strarr[j + 1], insert);	/* insert string */
-
-	strcpy(insert, save);	/* set saved string to next to be inserted */
-
-    }
-
-    /* overwrite NULL terminator with last item */
-    strarr[n] = malloc((1 + strlen(last)) * sizeof(char));
-    strcpy(strarr[n], last);
-
-    /* increase size of array by one */
-    n = n + 2;
-    strarr[n - 1] = NULL;	/* set last element of array to NULL */
-
-    return (n);
-}
-
-
-/* 
-   Delete a string at position pos (o to n) from an array of n strings; 
-   positions start at 0
-   The size of the array will be decreased by one char*.
-   Returns new size of array.
-   String array must be NULL-terminated.
- */
-int delete_str(int pos, char **strarr)
-{
-    int i;
-
-    /* check for valid pos */
-    i = 0;
-    while (strarr[i] != NULL) {
-	i++;
-    }
-
-    if ((pos < 0) || (pos > (i))) {
-	print_error(ERR_REGISTER_ENTRIES_GISMAN,
-		    "delete: invalid line number %i.\n", pos);
-    }
-
-    /* now move all strings > pos down one */
-    i = pos;
-    while (strarr[i] != NULL) {
-	free(strarr[i]);
-	if (strarr[i + 1] != NULL) {
-	    strarr[i] = malloc((1 + (strlen(strarr[i + 1]))) * sizeof(char));
-	    strcpy(strarr[i], strarr[i + 1]);
-	}
-	i++;
-    }
-
-    /* decrease size of array by one */
-    i = i - 1;
-    strarr[i] = NULL;		/* set last element of array to NULL */
-
-    return (i);
-}
-
-
- /*
-    Returns the first line number in which *str is found.
-    Search starts after line number 'start'.
-    Returns -1 if string not found.
-    String array must be NULL-terminated.
-  */
-int find_pos(char *str, char **strarr, int start)
-{
-    int i, j;
-
-    /* check for valid pos */
-    i = 0;
-    while (strarr[i] != NULL) {
-	i++;
-    }
-
-    if ((start < 0) || (start > (i))) {
-	exit(ERR_REGISTER_ENTRIES_GISMAN);
-    }
-
-    for (j = start; j < (i); j++) {
-	if (strstr(strarr[j], str) != NULL) {
-	    return (j);
-	}
-    }
-
-    return (-1);
-}
-
-
- /*
-    Dumps an array of strings to a file.
-    String array must be NULL-terminated.
-  */
-void dump_str(FILE * f, char **strarr)
-{
-    int i;
-
-    i = 0;
-    while (strarr[i] != NULL) {
-	fprintf(f, "%i: %s", i, strarr[i]);
-	i++;
-    }
-}
-
-/*
-   Get package name. Copies the package name as found in
-   the 'name' info file into the char array *name.
- */
-void get_package_name(char *path, char *name)
-{
-    FILE *f;
-    char file[MAXSTR];
-    char tmp[MAXSTR];
-
-    sprintf(file, "%s/%s", path, "name");
-
-    /* get extension name */
-    f = fopen(file, "r");
-    if (f == NULL) {
-	print_error(ERR_INVALID_EXT, "'name' file not readable.\n");
-    }
-    else {
-	if (nc_fgets_nb(tmp, MAXSTR, f) == NULL) {
-	    fclose(f);
-	    print_error(ERR_INVALID_EXT,
-			"invalid or missing extension name.\n");
-	}
-	else {
-	    chop(tmp);
-	    strcpy(name, tmp);
-	}
-    }
-    fclose(f);
-}
-
-/*
-   A replacement function for fgets to filter out comments and blank lines.
-   Useful for parsing settings files.
-   Returns a line from a file only if it does not start with '#'.
-   Returns only the part of the line left of '#'.
-   Otherwise, tries to read the next line from the file or returns NULL on EOF.
- */
-char *nc_fgets(char *s, int size, FILE * stream)
-{
-    char *hashmark;
-    char *tmp;
-
-    if (fgets(s, size, stream) == NULL) {
-	return (NULL);
-    }
-
-    hashmark = strchr(s, '#');
-
-    if (hashmark != NULL) {
-	if (s - hashmark == 0) {
-	    /* line starts with a hashmark: recursively call nc_fgets() */
-	    return (nc_fgets(s, size, stream));
-	}
-	else {
-	    /* return only the part before '#' */
-	    tmp = malloc(sizeof(char) * MAXSTR);
-	    strcpy(tmp, s);
-	    tmp = strtok(tmp, "#");
-	    sprintf(s, "%s\n", tmp);
-	    free(tmp);
-	}
-    }
-    return (s);
-}
-
-
-/*
-   Same as nc_fgets (). Additionally, this filters for HTML tags.
- */
-char *nc_fgets_html(char *s, int size, FILE * stream)
-{
-    char *hashmark;
-    char *tmp;
-    char *tag;
-    char *tag_2;
-    char *tag_insert;
-    char *tag_content;
-    char *pos;
-    char *insert;
-    int space;
-
-    if (fgets(s, size, stream) == NULL) {
-	return (NULL);
-    }
-
-    /* look for HTML tags: this discards all text inside the tags except for:
-       <br> becomes \n
-       <p> becomes \n\n
-     */
-    tmp = malloc(sizeof(char) * (strlen(s) + 1));
-    tag_content = malloc(sizeof(char) * (strlen(s) + 1));
-
-    insert = tmp;
-    pos = s;
-
-    while (*pos != '\0') {
-	if (*pos == '<') {	/* possibly an html open tag */
-	    tag = pos;
-	    tag_insert = tag_content;
-	    pos--;
-	    if (pos >= s) {
-		if (*pos == 32) {
-		    space = 1;
-		}
-		else {
-		    space = 0;
-		}
-	    }
-	    while (*tag != '\0') {
-		*tag_insert = *tag;
-		(*tag_insert)++;
-		if (*tag == '>') {	/* OK, we got a tag */
-		    *tag_insert = '\0';
-
-		    /* only add additional newlines, if this is not the end of the line already! */
-		    tag_2 = tag;
-		    tag_2++;
-		    if (*tag_2 != '\n') {
-			if (strstr(tag_content, "<br>") != NULL) {
-			    /* a <br> at the start of a line produce no additional linefeed! */
-			    if (insert > tmp) {
-				*insert = '\n';
-				(*insert)++;
-			    }
-			}
-			if (strstr(tag_content, "<BR>") != NULL) {
-			    if (insert > tmp) {
-				*insert = '\n';
-				(*insert)++;
-			    }
-			}
-			if (strstr(tag_content, "<p>") != NULL) {
-			    if (insert > tmp) {
-				*insert = '\n';
-				(*insert)++;
-			    }
-			    *insert = '\n';
-			    (*insert)++;
-			}
-			if (strstr(tag_content, "<P>") != NULL) {
-			    if (insert > tmp) {
-				*insert = '\n';
-				(*insert)++;
-			    }
-			    *insert = '\n';
-			    (*insert)++;
-			}
-		    }
-
-		    pos = tag;	/* skip this */
-
-		    /* if the next character is a space and there was none
-		       before the tag: skip that, too 
-		     */
-		    if (*pos == 32) {
-			if (space == 1) {
-			    pos++;
-			    space = 0;
-			}
-		    }
-		    break;
-		}
-		tag++;
-	    }
-	}
-	if (*pos != '>') {
-	    *insert = *pos;
-	    insert++;
-	}
-	pos++;
-    }
-
-    *insert = '\0';
-
-    strcpy(s, tmp);
-
-    free(tmp);
-    free(tag_content);
-
-    hashmark = strchr(s, '#');
-
-    if (hashmark != NULL) {
-	if (s - hashmark == 0) {
-	    /* line starts with a hashmark: recursively call nc_fgets_html() */
-	    return (nc_fgets_html(s, size, stream));
-	}
-	else {
-	    /* return only the part before '#' */
-	    tmp = malloc(sizeof(char) * MAXSTR);
-	    strcpy(tmp, s);
-	    tmp = strtok(tmp, "#");
-	    sprintf(s, "%s\n", tmp);
-	    free(tmp);
-	}
-    }
-
-    return (s);
-}
-
-
-/*
-   Checks whether a string actually contains text or is a blank line/whitespace only.
-   Returns 1 if text , 0 if only blank/whitespace.
- */
-int is_text(char *s)
-{
-    int i;
-    int nonws;
-
-    /* check for a blank or white-space only line */
-    nonws = 0;
-    for (i = strlen(s) - 1; i >= 0; i--) {
-	if ((s[i] == ' ') || (s[i] == '\t') || (s[i] == '\n') ||
-	    (s[i] == '\f') || (s[i] == '\r')) {
-	    nonws = 0;
-	}
-	else {
-	    nonws = 1;
-	    break;		/* break at first non-ws char! */
-	}
-    }
-
-    return (nonws);
-}
-
-
-/*
-   Same as nc_fgets() but also skips over blank lines and those that contain only 
-   whitespace chars.
- */
-char *nc_fgets_nb(char *s, int size, FILE * stream)
-{
-    char *hashmark;
-    char *tmp;
-
-    if (fgets(s, size, stream) == NULL) {
-	return (NULL);
-    }
-
-
-    if (is_text(s) == 0) {
-	/* line is ws only: recursively call nc_fgets() to get next line */
-	return (nc_fgets_nb(s, size, stream));
-    }
-
-    hashmark = strchr(s, '#');
-
-    if (hashmark != NULL) {
-	if (s - hashmark == 0) {
-	    /* line starts with a hashmark: recursively call nc_fgets() */
-	    return (nc_fgets_nb(s, size, stream));
-	}
-	else {
-	    /* return only the part before '#' */
-	    tmp = malloc(sizeof(char) * MAXSTR);
-	    strcpy(tmp, s);
-	    tmp = strtok(tmp, "#");
-	    sprintf(s, "%s\n", tmp);
-	    free(tmp);
-	}
-    }
-    return (s);
-}
-
-
-/*
-   This just dumps an ASCII file to stdout, line by line, but
-   skips over comments.
- */
-void dump_ascii(char *file, char *heading)
-{
-    char tmp[MAXSTR];
-    FILE *f;
-
-    fprintf(stdout, "%s\n", heading);
-    f = fopen(file, "r");
-    if (f == NULL) {
-	fprintf(stdout, "  No information available.\n");
-    }
-    else {
-	while (nc_fgets_html(tmp, MAXSTR, f) != NULL) {
-	    fprintf(stdout, "  %s", tmp);
-	}
-	fprintf(stdout, "\n");
-	fclose(f);
-    }
-}
-
-
-/* 
-   Dumps the contents of an ASCII file without comment lines but with blank lines
-   to a temporary file.
- */
-void dump_plain(char *file, char *tmpfile)
-{
-    char tmp[MAXSTR];
-    FILE *f_in;
-    FILE *f_out;
-
-    /* create a temporary menu.tcl file for write access */
-    /* TODO: Do not hardcode temp path */
-    strcpy(tmpfile, "/tmp/grass.extensions.db.XXXXXX");	/* TMP_GISMAN is a global variable */
-    mkstemp(tmpfile);
-
-    f_out = fopen(tmpfile, "w+");
-    if (f_out == NULL) {
-	print_error(ERR_DUMP_PLAIN_TXT,
-		    "could not create temp file '%s': %s\n \
-		Make sure that directory /tmp exists on your system and you have write permission.\n", tmpfile, strerror(errno));
-    }
-
-    atexit(&exit_db);		/* now need to register an at exit func to remove tmpfile automatically! */
-
-    f_in = fopen(file, "r");
-    while (nc_fgets(tmp, MAXSTR, f_in) != NULL) {
-	fprintf(f_out, tmp);
-    }
-
-    fclose(f_in);
-    fclose(f_out);
-}
-
-
-/* 
-   Same as dump_plain() but adds a <br> after each newline in the stream.
-   Also replaces blank lines with a <p>.
- */
-void dump_html(char *file, char *tmpfile)
-{
-    char tmp[MAXSTR];
-    char line[MAXSTR];
-    FILE *f_in;
-    FILE *f_out;
-    int fd;
-
-    /* create a temporary menu.tcl file for write access */
-    /* TODO: Do not hardcode temp path */
-    strcpy(tmpfile, "/tmp/grass.extensions.db.XXXXXX");	/* TMP_GISMAN is a global variable */
-    mkstemp(tmpfile);
-
-    f_out = fopen(tmpfile, "w+");
-    if (f_out == NULL) {
-	print_error(ERR_DUMP_PLAIN_TXT,
-		    "could not create temp file '%s': %s\n \
-		Make sure that directory /tmp exists on your system and you have write permission.\n", tmpfile, strerror(errno));
-    }
-
-    atexit(&exit_db);		/* now need to register an at exit func to remove tmpfile automatically! */
-
-    f_in = fopen(file, "r");
-    while (nc_fgets(line, MAXSTR, f_in) != NULL) {
-	chop(line);
-	if (!is_text(line)) {	/* replace blank lines with a <p> */
-	    fprintf(f_out, "<p>\n");
-	}
-	else {
-	    sprintf(tmp, "%s <br>\n", line);
-	    fprintf(f_out, tmp);
-	}
-    }
-
-    fclose(f_in);
-    fclose(f_out);
-    close(fd);
-}
-
-
-/* 
-   A pretty dumb function: this just lists all directories which are directly below
-   top level and not called "src". It is assumed that these contain binary distributions
-   which can be installed by just doing a "make install" in the respective directory.
- */
-void list_binaries(char *package)
-{
-    char tmp[MAXSTR];
-    struct stat buf;
-    DIR *dir;
-    struct dirent *dir_entry;
-    int n_dirs = 0;
-
-    fprintf(stdout, "Binary installation files\n");
-
-    dir = opendir(package);
-    if (dir == NULL) {
-	fprintf(stdout, "  None.\n\n");
-	return;
-    }
-
-    dir_entry = readdir(dir);
-    while (dir_entry != NULL) {
-	if ((strcmp(dir_entry->d_name, ".")) &&
-	    (strcmp(dir_entry->d_name, "..")) &&
-	    (strcmp(dir_entry->d_name, "src"))
-	    ) {
-	    /* check if it is a directory */
-	    sprintf(tmp, "%s/%s", package, dir_entry->d_name);
-	    stat(tmp, &buf);
-	    if (S_ISDIR(buf.st_mode)) {
-		if (n_dirs == 0) {
-		    fprintf(stdout, "  %s", dir_entry->d_name);
-		}
-		else {
-		    fprintf(stdout, ", %s", dir_entry->d_name);
-		}
-		n_dirs++;
-	    }
-	}
-	dir_entry = readdir(dir);
-    }
-    if (n_dirs == 0) {
-	fprintf(stdout, "  None.");
-    }
-    fprintf(stdout, "\n\n");
-}
-
-
-/* 
-   Just as dumb: checks, if a specified directory 'binaries' exists in addition to 'src'
-   Returns 1 if so, 0 otherwise 
- */
-int binaries_exist(char *package, char *binaries)
-{
-    char tmp[MAXSTR];
-    struct stat buf;
-    DIR *dir;
-    struct dirent *dir_entry;
-
-    dir = opendir(package);
-    if (dir == NULL) {
-	return (0);
-    }
-
-    dir_entry = readdir(dir);
-    while (dir_entry != NULL) {
-	if ((strcmp(dir_entry->d_name, ".")) &&
-	    (strcmp(dir_entry->d_name, "..")) &&
-	    (strcmp(dir_entry->d_name, "src"))
-	    ) {
-	    /* check if it is a directory */
-	    sprintf(tmp, "%s/%s", package, dir_entry->d_name);
-	    stat(tmp, &buf);
-	    if (S_ISDIR(buf.st_mode)) {
-		if (!strcmp(dir_entry->d_name, binaries)) {
-		    return (1);	/* found it */
-		}
-	    }
-	}
-	dir_entry = readdir(dir);
-    }
-    return (0);
-}
-
-
-/* 
-   Tests for a known file-extension:
-   .tar.gz, .tgz
-   .tar.bz2, .tbz
-   .zip
-   Returns:
-   0 = unknown (TYPE_UNKNOWN)
-   1 = tar file with gzip compression (TAR_GZIP)
-   2 = tar file with bzip2 compression (TAR_BZIP2)
-   3 = zip archive (ZIP)
-   4 = plain tar archive, uncompressed (TAR)
-
-   VERY primitive!
- */
-int check_filetype(char *myfile)
-{
-
-    if (strstr(myfile, ".tar.gz") != NULL) {
-	return (1);
-    }
-    if (strstr(myfile, ".tgz") != NULL) {
-	return (1);
-    }
-    if (strstr(myfile, ".tar.bz2") != NULL) {
-	return (2);
-    }
-    if (strstr(myfile, ".tbz") != NULL) {
-	return (2);
-    }
-    if (strstr(myfile, ".zip") != NULL) {
-	return (3);
-    }
-    if (strstr(myfile, ".tar") != NULL) {
-	return (4);
-    }
-
-    return (0);
-}
-
-/*
-   Retrieves an extension from the WWW using wget and
-   stores the file in the current directory.
- */
-void wget_extension(char *url)
-{
-    char str[MAXSTR];
-    int error;
-
-    fprintf(stdout, "Downloading...");
-
-    if (VERBOSE) {
-	sprintf(str, "wget -N %s", url);
-    }
-    else {
-	sprintf(str, "wget -N -q %s", url);
-    }
-    error = system(str);
-    if (error == -1) {
-	print_error(ERR_DOWNLOAD,
-		    "could not run 'wget' to download extension. Is it installed?\n");
-    }
-    if (error > 0) {
-	print_error(ERR_DOWNLOAD, "running command '%s'.\n", str);
-    }
-
-    print_done();
-}
-
-/*
-   This function checks if there is write access to the GRASS directory.
-   If not, it aborts with an error message.
-   Otherwise, 'cmd' is simply executed as currently running user.
- */
-void su(char *gisbase, char *cmd)
-{
-    char tmpfile[MAXSTR];
-    int error;
-    static unsigned long next;
-    FILE *f;
-
-    /* check for permission  */
-    next = next * 1103515245 + 54321;	/* generate a random file name */
-    next = (next / 65536) % 32768;
-    srand(next);
-    sprintf(tmpfile, "%s/gem.test.%i", gisbase, rand());
-
-    f = fopen(tmpfile, "w+");
-
-    if (errno == EACCES) {	/* permission denied */
-	print_error(ERR_INSTALL_EXT,
-		    "You don't have write access to your local GRASS installation.\nPlease consult your system administrator.\n");
-    }
-    else {
-	remove(tmpfile);
-	fclose(f);
-	error = system(cmd);
-	if (error != 0) {
-	    print_error(ERR_MISSING_CMD, "could not run '%s'.\n", cmd);
-	}
-    }
-}
-
-
-/*
-   Compares two version descriptions consisting of three ints each
-   returns: -1, if major.minor.revision < major2.minor2.revision2,
-   0, if equal
-   1, if major.minor.revision > major2.minor2.revision2,
- */
-int vercmp(int major, int minor, int revision, int major2, int minor2,
-	   int revision2)
-{
-    if ((major == major2) && (minor == minor2) && (revision == revision2)) {
-	return (0);
-    }
-    if (major2 > major) {
-	return (-1);
-    }
-    if (major2 < major) {
-	return (1);
-    }
-    if (minor2 > minor) {
-	return (-1);
-    }
-    if (minor2 < minor) {
-	return (1);
-    }
-    if (revision2 > revision) {
-	return (-1);
-    }
-    if (revision2 < revision) {
-	return (1);
-    }
-
-    return (0);
-}

+ 0 - 69
gem/tools.h

@@ -1,69 +0,0 @@
-
-/***************************************************************************
- *            tools.h
- *
- *  Mon Apr 18 15:04:11 2005
- *  Copyright  2005  Benjamin Ducke
- ****************************************************************************/
-
-/*
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Library General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _TOOLS_H
-#define _TOOLS_H
-
-char *basename(char *path);
-
-void mkdir_s(char *pathname, char *mode);
-
-int chop(char *string);
-
-int insert_str(char *str, int pos, char **strarr);
-
-int delete_str(int pos, char **strarr);
-
-int find_pos(char *str, char **strarr, int start);
-
-void dump_str(FILE * f, char **strarr);
-
-void get_package_name(char *path, char *name);
-
-char *nc_fgets(char *s, int size, FILE * stream);
-
-char *nc_fgets_nb(char *s, int size, FILE * stream);
-
-char *nc_fgets_html(char *s, int size, FILE * stream);
-
-void dump_ascii(char *file, char *heading);
-
-void dump_plain(char *file, char *tmpfile);
-
-void dump_html(char *file, char *tmpfile);
-
-void list_binaries(char *package);
-
-int binaries_exist(char *package, char *binaries);
-
-int check_filetype(char *file);
-
-void wget_extension(char *url);
-
-void su(char *gisbase, char *cmd);
-
-int vercmp(int major, int minor, int revision, int major2, int minor2,
-	   int revision2);
-
-#endif /* _TOOLS_H */