octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave Packaging


From: Paul Kienzle
Subject: Re: Octave Packaging
Date: Tue, 12 Jun 2007 07:39:44 -0400


On Jun 12, 2007, at 4:23 AM, David Bateman wrote:

Paul Kienzle wrote:

On Jun 11, 2007, at 11:51 AM, David Bateman wrote:

Here's a suggestion: you could write a generic configure script (not generated by autoconf) and Makefile which call the octave package manager to do the work. These could be inserted automatically by the pkg dist command. This would also work for bundles of packages.

Having these files means that the sysadmin who doesn't know the details of Octave but still needs to support her users can write:

    ./configure; make; make install

as usual and have everything just work (after resolving dependencies).



Paul,

The configure and make steps of this would be simple and could look something like

if [ -e src/configure ]; then
  cat << EOF > configure
cd src
./configure $*
EOF
fi

cat << EOF > Makefile
all:
    make -C src
EOF

in the top directory of the package.. However, the question is then how to install such a prebuilt package, which might get a little messy. Not impossible though. It might look something like

install:
    @if [ -d src ]; then \
      if [ -e src/FILES ]; then \
        files=`cat FILES`; \
      else \
        files=`ls *.mex *.oct`; \
      fi; \
      if [ ! -d ../inst ]; then \
        mkdir ../inst; \
      fi; \
      for file in $$files; do \
        cp $$file ../inst; \
      done; \
      cd ../; \
      rm -fr src; \
    fi; \
    package=`pwd | sed -e 's|^.*/||'`; \
    tar czCf ../ /tmp/$$package.tar.gz $$package; \
    octave -H -q --no-site-file --eval
"warning('off','all');pkg('install','-global','/tmp/ $$package.tar.gz')"; \
    rm /tmp/$$package.tar.gz

Thomas if the octave-forge packages, contained such a configure and makefile, so that you could do "./configure; make; make install" on them, that would keep you happy? This would be relatively trivial to add to the packages..

I don't think we should make this a requirement for all Octave packages however, as it means that the arbitrary user needs to do additional work.

David,

This is more complicated than I expected. I've never used the Octave packaging system and don't know how its commands work.

Most packaging systems I've dealt with allow you to do the steps independently --- unbundle, configure, build, test and install. I was assuming the configure would be able to call the octave pkg configure command on the unbundled package, make would call octave pkg build and make install would call octave pkg install. Package bundles would just do this for each directory in the bundle. Assuming there is an octave pkg bundle command to build the bundle, I wouldn't expect there to be any extra work on the part of the package author. The bundle command could insert configure and Makefile automatically.

Regardless, I would recommend against repeating the logic of the pkg command in configure and Makefile since keeping them in sync will be a maintenance problem.

        - Paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]