Forum OpenACS Development: Newbie problem with creating a new package

Hello All,

This is a newbie problem:

I am trying to learn how to create a new package. While following instructions on https://openacs.org/doc/openacs-4-6-2/tutorial-newpackage.html I have problem with section where I should compile xml document into html as instructed:
“Process the xml file to create html documentation. The html documentation, including supporting files such as pictures, is stored in the www/docs/  directory. A Makefile is provided to generate html from the xml, and copy all of the supporting files. If Docbook is set up correctly, all you need to do is:

[service0@anthrax xml]$ make

All what I get is:

[service0@oddjob xml]$ make
make: *** No targets specified and no makefile found.  Stop.
[service0@oddjob xml]$

And the content of the xml folder is:

[service0@oddjob xml]$ ls
CVS            data-model.png  index.xml~    page-map.png  user-interface.dia
data-model.dia  index.xml      page-map.dia  sample.png    user-interface.png
[service0@oddjob xml]$

In addition I have no idea whether or not the DocBook is installed on that remote machine where I am trying to compile this xml page.

Any suggestions are more than welcome.

Thank you for your time.

DanielD

Collapse
Posted by Joel Aufrecht on
make requires a file called Makefile in the same directory. That file is missing from the 4.6.2 release, or at least in the wrong place. I am reproducing a version of it here, which you can save as "Makefile".
# A very simple Makefile to generate the HTML docs

# Paths
XSLTPROC=/usr/bin/xsltproc
XSL=../../../acs-core-docs/www/xml/openacs.xsl

all: html

prelim:
        cp -u *.png ..

html: prelim
        cd .. ; $(XSLTPROC) $(XSL) xml/index.xml

To find out if you have DocBook and all the correct supporting libraries, look for xsltproc. DocBook, and this makefile in particular, have many dependencies, so if it's a remote machine you don't control, you should set your give-up threshold very low or you will waste a lot of time. In particular, xsltproc should be installed, openacs.xsl should point to a valid location for chunk.xsl (a template, part of an xsl stylesheet package, which we use as the foundation of our stylesheet), and the Makefile needs the right addresses for everything.

Collapse
Posted by Daniel D on
Hello,

That is me again :)

I have replaced spaces with tabs in this Makefile. Now it partly works. However there are still problems:

[service0@oddjob xml]$ make
cp -u *.png ..
cd .. ; /usr/bin/xsltproc ../../../acs-core-docs/www/xml/openacs.xsl xml/index.xml
xml/index.xml:22: error: Opening and ending tag mismatch: bookinfo and revhistory
    </revhistory>
                ^
xml/index.xml:40: error: Opening and ending tag mismatch: book and bookinfo
  </bookinfo>
            ^
xml/index.xml:41: error: Extra content at the end of the document
  <chapter id="requirements" xreflabel="Requirements">
  ^
unable to parse xml/index.xml
make: *** [html] Error 6
[3]+  Done                    emacs Makefile
[service0@oddjob xml]$

Do you have any ideas what to fix, or shoud I just give up?

Thank you for your time.

DanielD

Collapse
Posted by Joel Aufrecht on
You have a mismatched xml tag in your index.xml.  I just checked the current index.xml in cvs and it looks good, so it's probably a result of your editing.  This is one of the drawbacks of DocBook, and something we'll have to make easier.  You can try to manually balance the tags, or you can use the emacs command M-x sgml-normalize.  Or you can revert to the original index.xml.
Collapse
Posted by Daniel D on
Hello Joel,

I have used the original index.xml an edited it again. Now it works. Thank you for your time.

Daniel

Collapse
3: Very simple Makefile (response to 1)
Posted by Daniel D on
Hello Joel,

Thank you for the prompt reply. I have created a file "Makefile" and I did copy&paste your sample into it. Now I do have this error:

[service0@oddjob xml]$ make
Makefile:10: *** missing separator (did you mean TAB instead of 8 spaces?).  Stop.
[1]+  Done                    emacs Makefile
[service0@oddjob xml]$

Thank you for your time.

DanielD

Collapse
4: Re: Very simple Makefile (response to 3)
Posted by Joel Aufrecht on
Make is very picky.  Search for tabs and replace them with eight spaces.  Or the other way around.