$Id: TODO,v 1.108 2009-04-06 20:25:17 joostvb Exp $

--- release critical ----

- convert to git (or svn?)

- Supply a preset loop over hosts, for load target.
  za 14 20:43 < Fruit> door explosie op cartesisch produkt van file en target,
                     dat wil je ook voor -install

- test & document rsync support.

- Ideas insprired by a discussion with Fred Vos:
  (Lots of users have asked for such a feature.)
  a "make check" could be usefull: test wether previous svn version is on server
  before scp-ing.
za 14 21:29 < hoppie> en als je dan helemaal over the top wilt, kun je 
                      eventueel dat linken aan install, zodat alleen waar dat 
                      nodig is geïnstalleerd wordt. Maar da's echt optioneel.
  Preliminary support added; Document this!  Nice trick:

   make diff || make install
   make foobar-diff || make foobar-install

  Make this work out of the box for all push mechanisms: add generic csp_REXEC
  next to csp_PUSH.


--- 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 ---

- add standard target: "make print-hosts"

- 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;

- caspar chokes on : in filenames:

 Makefile:

 csp_SCPDIR = /etc/sysconfig/network-scripts/
 csp_SUH = root@cauchy
 include caspar/mk/caspar.mk

 joostvb@kovalevskaya:~/sv...ysconfig/network-scripts% ls
 Makefile  ifcfg-eth0  ifcfg-eth0:1
 joostvb@kovalevskaya:~/sv...ysconfig/network-scripts% make
 caspar/mk/caspar.mk:87: *** multiple target patterns.  Stop.

 Bug found by Johan Hoeke.

- 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, ...

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

- 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!

- add support for install(1).

- 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)

Or could "mkdir ; cp" be implemented directly as a make function? Use $(shell ...)?

- 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, in order to prevent us from
  doing useless (and expensive) installs.   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.)

- Ideas insprired by a discussion with Fred Vos:
  Perhaps a note on how to use commit-hooks could be added to
  documentation.  Perhaps a note on ssh forced commands could be added.  Perhaps
  a note on a "make commit" could be added.

- 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
[za 14 22:29 <Fruit> dat breekt niet voor dat soort directories, ga maar na!
;)] .) 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)

.

(Or use rsync as csp_PUSH?)


