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

Re: ITP vexim



On Mon, Jan 23, 2006 at 12:16:25AM +0100, Daniel Knabl wrote:
> Am Sun, 22 Jan 2006 14:44:59 -0500 schrieb Justin Pryzby
> <justinpryzby@users.sourceforge.net>:
> 
> > > if there is anyone willing and/or able to help me with the next
> > > steps i would be very happy. right now i have some questions on how
> > > to get debconf and templates working,
> > Read debconf-devel(7), and google about the config, templates and
> > postinst files WRT debconf.
> 
> Now I think I have got it. Thank you for the first steps.
> My templates file looks now something like
> 
>   Template: vexim/myip
>   Type: string
>   Description: Please enter the IP adress exim is listening to
>    bla bla ....
Do you really have to ask a question about this?  Why can't it Just
Work?

> > > so that the user can interact whilest
> > > installing. this would be very important - however i do not really
> > > know, how to get the user's input and how to process it further. i
> > > think about cryptic postinst script using many lines containing sed
> > > s/@bla@/$user_in/ > $tempfile ...
> > Are you planning on providing fully generalized "maintainer script"
> > handling of the config files, or are conffiles sufficient?
> 
> I am trying this right now in ./debian/postinst:
> 
>   source /usr/share/debconf/confmodule
>   db_version 2.0
> 
> case "$1" in
>   configure)
>   db_get vexim/dc_vexim_pass || true
>   dc_vexim_pass=$RET
>   db_get vexim/dc_vexim_myip || true
>   dc_vexim_myip=$RET
>   db_get vexim/dc_vexim_fdqn || true
>   dc_vexim_fdqn=$RET
>   cat /usr/share/doc/vexim/setup/mysql.sql |\
>       sed s/@@PASS@@/$dc_vexim_pass/g |\
>       sed s/@@MYIP@@/$dc_vexim_myip/g |\
>       sed s/@@FDQN@@/$dc_vexim_fdqn/g \
>       > /tmp/vexim_mysql.tmp
>   mysql -u debian-sys-maint \
>       < /tmp/vexim_mysql.tmp
>   rm /tmp/vexim_mysql.tmp
>   ;;
> 
>   and so on.
> 
> But now there're the questions:
>   can this work? (hope it can)
>   is there a more elegant way for substitution of @@PASS@@...?
Well, you don't need to call sed multiple times, you can use just sed
-e s/foo/bar/ -e s/baz/boo/ or even sed -e s/foo/bar/; s/baz/boo/;.
Or you can use a loop around a perl hash, as is done by one of the
web/db packages.  I forget which.

> > > but first of all i would need some help on the control-file, the
> > > rules-file and on "how to resolve dependencies" of my package.
> > Ok what about?
> 
> With kind help of Marc Haber I was able to find a solution that goes
> hand in hand with the Debian-exim maintainers idea:
> 
>   Provides: exim4-config-2
>   Conflicts: exim4-config-2, exim4-config
Right, you need to conflict, because there are common conffiles.  You
have to provide, because exim doesn't want to have to know anything
about your package :)

What is exim4-config-2 anyway?

I think you will also have to provide a preinst script which removes
any exim4 conffiles which are also included in your package, iff their
md5sum matches the value in the dpkg status database.  And you might
have to do something special on removal, too; you must avoid
unnecessary dpkg conffile questions.

> > > http://knabl.com/~daniel/vexim
> > Please make the .diff.gz available, and preferrably in such a way that
> > lynx will view it instead of asking how to save it..
> 
> Should be done right now.
Why is your .diff.gz so humongous?  Most of them are like 4k, and some
are even readable.

> > How do you deal with the exim4 "conf.d" model vs the exim4.conf model?
> 
> Please look at the previous paragraphs. ;-)
I don't get it, still.  You seem to have a template exim4.conf, so I
guess you are just planning on running sed on that.

Please note that most packages won't let you do this.  Only because
exim has a separate "conf" package is this possible.  In particular,
note that no package can muck with a conffiles, even its own.  No
package may muck with a configuration file, except by interfacing with
a program provided by the package "owning" that file, and of course
you must depend on that program if you depend on it.

See, for example, #311188: debian-edu-config: Messes programmatically
with conffiles.

-- 
Clear skies,
Justin



Reply to: