[GRASS-user] Compiling addons - description.html

Hi,

When compiling addons, how do I make the description.html file that comes with the addon be installed as the help page that loads with g.manual? Currently, I am getting a short page with just the commands as generated by g.parser.

e.g. in grass-addons/raster/r.denoise, or r.surf.volcano
sudo make MODULE_TOPDIR=/usr/local/grass-6.5.svn
sudo make MODULE_TOPDIR=/usr/local/grass-6.5.svn install

Cheers

John

--
Dr John Stevenson
Postdoctoral Research Associate
School of Earth, Atmospheric and Environmental Sciences
Williamson Building
University of Manchester
Manchester M13 9PL
UK
tel. +44(0)161 306 9360; fax. +44(0)161 306 9361;
john.stevenson@manchester.ac.uk

On Wed, Aug 12, 2009 at 6:51 PM, John
Stevenson<John.Stevenson@manchester.ac.uk> wrote:

Hi,

When compiling addons,

If you use a recent GRASS 6.5 or 7, you just need to enter:

g.extension r.denoise
g.extension r.surf.volcano

and everything should be installed.

how do I make the description.html file that comes
with the addon be installed as the help page that loads with g.manual?
Currently, I am getting a short page with just the commands as generated by
g.parser.

e.g. in grass-addons/raster/r.denoise, or r.surf.volcano
sudo make MODULE_TOPDIR=/usr/local/grass-6.5.svn
sudo make MODULE_TOPDIR=/usr/local/grass-6.5.svn install

If also g.extension fails, there might be a bug in the "install" part.
I tried here and I didn't have problems (but I am no Makefile expert).

Markus

Markus Neteler wrote:

g.extension r.denoise
g.extension r.surf.volcano

and everything should be installed.
  If also g.extension fails, there might be a bug in the "install" part.
  

Hi Markus,

I tried with g.extension. I had to change the permissions so that I owned the directory (previously I'd done all my installation via sudo, but sudo doesn't work with GRASS commands). It says that it was successful, but I don't think that it has changed the files for r.denoise or r.surf.volcano. The HTML pages are dated from when I was testing yesterday. I tried with v.krige, received a success message, but neither module or manual page were installed. I've attached sample output below.

Cheers

John

GRASS 6.5.svn (thingy):~/laptop/grassdata/thingy > g.extension r.surf.volcano
Fetching r.surf.volcano from GRASS-Addons SVN (be patient)...
A r.surf.volcano/r.surf.volcano
A r.surf.volcano/description.html
A r.surf.volcano/Makefile
Checked out revision 38709.
Compiling r.surf.volcano...
/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
if [ ! -d /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts ]; then mkdir -p /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts; fi
/usr/bin/install -c r.surf.volcano /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts/r.surf.volcano
make htmlscript scriptstrings
make[1]: Entering directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/18662.0/r.surf.volcano'
/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
make /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html/r.surf.volcano.html HTMLSRC=/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts/r.surf.volcano
make[2]: Entering directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/18662.0/r.surf.volcano'
/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
if [ "/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts/r.surf.volcano" != "" ] ; then GISRC=/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/demolocation/.grassrc65 GISBASE=/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu PATH="/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/bin:$PATH" LD_LIBRARY_PATH="/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/bin:/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/lib:/usr/local/grass-6.5.svn/lib" LC_ALL=C /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts/r.surf.volcano --html-description < /dev/null | grep -v '</body>\|</html>' > r.surf.volcano.tmp.html ; true ; fi
/usr/local/grass-6.5.svn/tools/mkhtml.sh r.surf.volcano ; mkdir -p /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html ; /usr/bin/install -c -m 644 r.surf.volcano.tmp.html /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html/r.surf.volcano.html ; for file in *.png *.jpg ; do head -n 1 $file | grep '^#!' > /dev/null ; if [ $? -ne 0 ] ; then /usr/bin/install -c -m 644 $file /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html ; fi done 2> /dev/null ; true
/bin/sh: /usr/local/grass-6.5.svn/tools/mkhtml.sh: not found
make[2]: Leaving directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/18662.0/r.surf.volcano'
GISRC=/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/demolocation/.grassrc65 GISBASE=/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu PATH=/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/bin:$PATH LD_LIBRARY_PATH="/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/lib:/usr/local/grass-6.5.svn/lib" g.parser -t r.surf.volcano | sed s/\"/\\\\\"/g | sed 's/.*/_("&")/' > /usr/local/grass-6.5.svn/locale/scriptstrings/r.surf.volcano_to_translate.c ; true
/bin/sh: cannot create /usr/local/grass-6.5.svn/locale/scriptstrings/r.surf.volcano_to_translate.c: Directory nonexistent
make[1]: Leaving directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/18662.0/r.surf.volcano'
make mancmd
make[1]: Entering directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/18662.0/r.surf.volcano'
/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
make /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/man/man1/r.surf.volcano.1 MANSRC=/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html/r.surf.volcano.html
make[2]: Entering directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/18662.0/r.surf.volcano'
/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
mkdir -p /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/man/man1
GRASS_PERL=/usr/bin/perl VERSION_NUMBER=6.5.svn sh /usr/local/src/grass/develbranch_6/tools/g.html2man/g.html2man /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html/r.surf.volcano.html /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/man/man1/r.surf.volcano.1 1
Converting: /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html/r.surf.volcano.html to /usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/man/man1/r.surf.volcano.1
make[2]: Leaving directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/18662.0/r.surf.volcano'
make[1]: Leaving directory `/media/OS/Users/mbessjs3/Documents/grassdata/thingy/PERMANENT/.tmp/mbessjs3-pc/18662.0/r.surf.volcano'
Installing r.surf.volcano...
/usr/local/grass-6.5.svn/include/Make/Script.make:47: warning: overriding commands for target `install'
/usr/local/grass-6.5.svn/include/Make/Rules.make:82: warning: ignoring old commands for target `install'
Installation of <r.surf.volcano> in </usr/local/grass-6.5.svn> successfully
finished.
GRASS 6.5.svn (thingy):~/laptop/grassdata/thingy > g.manual r.surf.volcano
Starting browser <firefox> for module r.surf.volcano...
GRASS 6.5.svn (thingy):~/laptop/grassdata/thingy > ls -l /usr/local/grass-6.5.svn/docs/html/r.surf.volcano.html
-rw-r--r-- 1 mbessjs3 grass 2730 2009-07-03 17:50 /usr/local/grass-6.5.svn/docs/html/r.surf.volcano.html

--

Dr John Stevenson
Postdoctoral Research Associate
School of Earth, Atmospheric and Environmental Sciences
Williamson Building (Room 2.42)
University of Manchester
Manchester M13 9PL, UK
tel. +44(0)161 306 6585; fax. +44(0)161 306 9361;
john.stevenson@manchester.ac.uk

Hi John,

On Thu, Aug 13, 2009 at 1:12 PM, John A
Stevenson<john.stevenson@manchester.ac.uk> wrote:

Markus Neteler wrote:

g.extension r.denoise
g.extension r.surf.volcano

and everything should be installed.
If also g.extension fails, there might be a bug in the "install" part.

Hi Markus,

I tried with g.extension. I had to change the permissions so that I owned
the directory (previously I'd done all my installation via sudo,

(I personally never install but just use GRASS from the
compile directory, for convenience I added a link to
/usrlocal/bin/)

but sudo doesn't work with GRASS commands).

I darkly remember some discussion on this but don't recall
the tricks (see mailing list archive).

It says that it was successful, but I
don't think that it has changed the files for r.denoise or r.surf.volcano.

While you have 2730 bytes for r.surf.volcano.html, I have 5244.
It's strange that you don't see an error but also no complete file.
Apparently the install part fails when using a real installation
like you. Frankly, my take at getting "make install" working may
be flawed since I am no (good) Makefile programmer but so
far noone else picked it up. In GRASS 7 things are organized
differently, so we cannot easily borrow from there.

The HTML pages are dated from when I was testing yesterday. I tried with
v.krige, received a success message, but neither module or manual page were
installed. I've attached sample output below.

...

/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/scripts/r.surf.volcano
--html-description < /dev/null | grep -v '</body>\|</html>' >
r.surf.volcano.tmp.html ; true ; fi

... above should create the complete manual page.

then it is installed:
...

/usr/bin/install -c -m 644 r.surf.volcano.tmp.html
/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html/r.surf.volcano.html
; for file in *.png *.jpg ; do head -n 1 $file | grep '^#!' > /dev/null ;
if [ $? -ne 0 ] ; then /usr/bin/install -c -m 644 $file
/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html ; fi
done 2> /dev/null ; true
/bin/sh: /usr/local/grass-6.5.svn/tools/mkhtml.sh: not found
make[2]: Leaving directory

...

Doh! "mkhtml.sh: not found!" That's no good.

So I see that I have a local copy in my dist directory but that the
Makefile doesn't reflect this (so apparently I copied it over manually
and then forgot about this).

@devs: how is tools/mkhtml.sh best copied into the binary tree?

Markus

Markus Neteler wrote:

> but sudo doesn't work with GRASS commands).

I darkly remember some discussion on this but don't recall
the tricks (see mailing list archive).

sudo will reset the environment unless -E is used (and the "setenv"
option is enabled in the sudoers file).

Also, the loader will typically clear any variables related to dynamic
loading (LD_LIBRARY_PATH etc) when running a setuid/setgid binary such
as sudo. That's why $GISBASE/etc/grass-run.sh exists: to run a command
with LD_LIBRARY_PATH restored from $GRASS_LD_LIBRARY_PATH (this is
necessary when running a GRASS command in an xterm, as the xterm
binary may be setuid/setgid).

--
Glynn Clements <glynn@gclements.plus.com>

On Fri, Aug 14, 2009 at 10:55 PM, Markus Neteler<neteler@osgeo.org> wrote:
...

if [ $? -ne 0 ] ; then /usr/bin/install -c -m 644 $file
/usr/local/src/grass/develbranch_6/dist.i686-pc-linux-gnu/docs/html ; fi
done 2> /dev/null ; true
/bin/sh: /usr/local/grass-6.5.svn/tools/mkhtml.sh: not found
make[2]: Leaving directory

...

Doh! "mkhtml.sh: not found!" That's no good.

Fixed in 6.4 and 6.5.

John: you can simply copy the file
tools/mkhtml.sh
manually to
/usr/local/grass-6.5.svn/tools/
and don't have to wait for a new release. Please tell me if it
solves the problem.

Markus

On Mon, Aug 17, 2009 at 4:50 PM, John A
Stevenson<john.stevenson@manchester.ac.uk> wrote:

Markus Neteler wrote:

John: you can simply copy the file
tools/mkhtml.sh
manually to
/usr/local/grass-6.5.svn/tools/
and don't have to wait for a new release. Please tell me if it
solves the problem.

Hi Markus,

It works now. Magic!

Great!

I cleared my old installation directory, ran svn up on develbranch_6,
compiled and reinstalled.

So that's finally done - perhaps not in an exciting way but that's what
we have GRASS 7 for :slight_smile:

cheers,
Markus