$Id: TODO,v 1.91 2007-07-29 09:20:55 joostvb Exp $

--- typesetting stuff ---

- get toc printed in html mode. even while using nochunks mode.

- license should be printed, see rh vs deb doc.

- add zoem.mk, for zoem ( http://micans.org/zoem ) typesetting.

--- install stuff ---

- Should happen Real Soon Now (early 2008?): Get rid of csp_SUHDIRS and other
  obsolete variables.  Get rid of SCP and CP RULEs in caspar.mk.

- "install" should depend upon "load".  (should it?) ("make" currently does
  both "install" and "load"; it does not do "build".  (really!?)).  and/or:
  caspar should support "make build-recursive".

- csp_BUILD is buggy.  On a fresh checkout, when builded files are not yet
  there, "make install" skips the yet-to-build files.  csp_EXTRAFILES won't help:
  "target `sshd_config-install' given more than once in the same rule." shows
  up once the file _is_ present.  To be fixed by having "install" depend upon
  "build"?

- caspar chokes on spaces in filenames:

 Makefile:

 csp_CPDIR = /var/php/public/jccpmanu/https
 include caspar/mk/caspar.mk

 joostvb@scriptix:~/sv...k/sources/jccpmanu/https% ls
 JCCP logo.jpg  Makefile    index.html      logo.html
 JCCPlogo.jpg   empty.html  loginform.html  php3
 joostvb@scriptix:~/sv...k/sources/jccpmanu/https% make -n
 /bin/sh: line 1: test: JCCP: binary operator expected
 /bin/sh: line 1: test: JCCP: binary operator expected
 cp  "JCCPlogo.jpg" /var/php/public/jccpmanu/https;
 cp  "empty.html" /var/php/public/jccpmanu/https;
 cp  "index.html" /var/php/public/jccpmanu/https;
 cp  "loginform.html" /var/php/public/jccpmanu/https;
 cp  "logo.html" /var/php/public/jccpmanu/https;

- Suggest (or offer) a more generic interface than my_EXEC for the load
  target.  Users are invited to extend the interface.
  They can add extra variables to their push mechanisms.  So we might be
  able to abstract LOAD one day.  Perhaps something like

    $(foreach uh,$(csp_UHOSTS),$(call csp_EXEC,$(uh),$(csp_DIR),$(csp_XARG));)

  could work.  If a user's exec wrapper needs more arguments, these can get
  introduced as implicit variables, outside $1, $2, ...

- Should happen _before_ the release of Debian lenny (late 2008?): Drop support for
  csp_SUHS, csp_SUH, csp_SCPDIR, csp_CPDIRS:

   for csp_SUHS   now use csp_UHOSTS
   for csp_SUH    now use csp_UHOST
   for csp_SCPDIR now use csp_DIR
       csp_CPDIRS

   suggest to run

   % svnfind -name Makefile | while read f; do sed -i 's/csp_SUHS/csp_UHOSTS/g; s/csp_SUH/csp_UHOST/g; s/csp_SCPDIR/csp_DIR/g' $f; done
  % svnfind -name install.mk | while read f; do sed -i 's/csp_SUHS/csp_UHOSTS/g; s/csp_SUH/csp_UHOST/g; s/csp_SCPDIR/csp_DIR/g' $f; done

- Explain why it's good practice to do
    include ../../include/install.mk
  in manpage example.

- Supply a preset loop over hosts, for load target.

- Don't do
   csp_scp_FUNC  = $(csp_SCP) $(csp_CPFLAGS) $(1) $(2):$(3)
  but do
   csp_scp_FUNC  = $(csp_SCP) $(4) $(1) $(2):$(3)
  and use $(csp_CPFLAGS) for csp_XARGS.
  _Do_ test this!

- this whole thing could probably better use rsync, or, alternatively, perhaps
  caspar is redundant: there is cfengine.  Perhaps people would be better of
  with a get-started-quick cfengine document. See caspar(7).

- add support for install(1).

- The function $(subst -install,,$@) in caspar.mk breaks when filename itself
  has the substring -install.  We might have to use sed here, and strip only
  a _trailing_ '-install' from the maketarget.

- load stuff:
  - Create a ``load-recursive'' target.
  - supply daemons.mk: csp_SSHDEBIANLOAD csp_URUKREDHATLOAD , etc, to use
    in load targets

- install-recursive should call mkdir if appropriate.  install should, too.

 Thu 31 15:16 < Fruit> kan ik 'm ook vertellen dat-ie voordat gaat kopiëren ff
                       mkdir -p op de smurfer doet?
 Thu 31 15:19 < joostvb> een eigen csp_PUSH schrijven
 Thu 31 15:20 < joostvb> csp_PUSH krijgt zowel filenaam als directory mee als
                         argument
 Thu 31 15:20 < joostvb> dus das kei makkelijk
 Thu 31 15:20 < Fruit> csp_OLD_PUSH := $(csp_PUSH)
 Thu 31 15:20 < Fruit> csp_PUSH := ssh $iets mkdir $dir; $(csp_OLD_PUSH)

alternatively:

~/bin/csp_mkdircp

----
#!/bin/sh
mkdir -p $2
exec cp $1 $2
----

and:

  csp_mkdircp_FUNC = csp_mkdir $(1) $(2)
  csp_PUSH = $(csp_mkdircp_FUNC)

- The scp invocation is inefficient:

   % make -n README.txt-install net.txt-install
   scp "README.txt" pong:/data/www/doc/doc/;
   scp "net.txt" pong:/data/www/doc/doc/;

  Should be:

   scp "README.txt" "net.txt" pong:/data/www/doc/doc/;

  $@ vs $? might be helpful.

- test wether file is up to date before scp-ing it.  use rsync?  use
  ControlMaster ssh_config(5) to reuse one ssh conection?  Perhaps this:

   ControlMaster auto
   ControlPath ~/.ssh/control/%r@%h:%p

  in your ~/.ssh/config (and having an ssh connection open to all relevant
  hosts) fixes all "troubles". (This option is not available on Debian sarge.)

- document this: including an included Makefile:

    here := $(dir $(lastword $(MAKEFILE_LIST)))
    include $(here)../../foo/bar/install.mk

  Thanks Wessel.

  Alternative: /usr/local/foo, as used in svn/its-unix

- if one really wants, one can overrule caspar's default target:

 ---------

 csp_SCPDIR = /etc/ssl/chains/
 csp_TABOOFILES_ADD = %.asc

 all: install
 install: check makedir

 include ../../../include/install.mk

 check:
        for cert in *.pem; do \
                echo "$$cert:"; \
                gpg --verify $$cert.asc $$cert; \
        done

 makedir:
        for suh in $(csp_SUHS); do \
          ssh $$suh mkdir -p /etc/ssl/chains; \
        done

 .PHONY: check makedir

 ---------

 very likely, one could better use the "build" target for this.

- it's not necessary to have Makefile in all directories of a tree, provided
caspar is fixed:

replace

 DIRS := $(shell for d in *; do test -d $$d && echo $$d; done)

by

 DIRS :=  $(patsubst %/Makefile,%,$(shell find * -mindepth 1 -name Makefile))

thanks Wessel. (This might break for trees combining GNUmakefile with
Makefile.) Once this fix is implemented, get rid of the example toplevel
Makefile in caspar(7).

-  Document this:
user joe pushed file bar to host murphy, in directory /foo/. on murphy,
/foo/bar is owned by joe:joe.  Now, ann wants to change murphy:/foo/bar.  She
however lacks permissions.  Using a new group "hackers", and performing chmod
g+s on murphy:/foo/ fixes this partially: the files now belong to the right
group "hackers".  However, a mode g+w on a file is generally _not_ preserved
when scp-ing a new version of the file.

Zorg dat op alle desktops het scriptje "csp_install_origal_mode" ergens
in het $PATH van de gebruikers staat, met inhoud:

 #!/bin/sh
 ssh $2 't=`mktemp $3/$1` && cat >$t && mv $t $3/$1' < $1

Voorzie de include/install.mk verder van:

 csp_install_origal_mode_FUNC = csp_install_origal_mode $(1) $(2) $(3)
 csp_PUSH = $(csp_install_origal_mode_FUNC)

.

Even better: use rsync as csp_PUSH.




