howto create debian package with conf files

2008-10-25 Thread lucas kenter
Hello,

I would like to create a debian package for a simple project that I've
created. The project contains only scripts, so there is no makefile or
anything like that. For the script to work I would like to prompt for some
simple questions like "what url should be used", "what organisation does
this computer belong to".

I've created a postinst script that asks these questions and writes them in
a configuration file. (and this configuration file is listed in conffiles)

Now the problem that I have is that when I reinstall this package, or
upgrade it, all the questions are asked again.

After some research I'm still not able to find a simple example or howto to
do this right.

- Is it necessary to use debconf to accomplish this?
- I thought that the postinst script was called with an argument
install/upgrade/configure and so I could ask my question only when it was
and install or configure, but this doesnt work. apperantly upgrading a
package also uses argument configure...

I've tried to look at packages like postfix, to see how they do it, but
those are to difficult for my simple scripting skills :-(

Regards,
Luke


Re: howto create debian package with conf files

2008-10-25 Thread lucas kenter
Wow,

Thanks for the quick and helpfull response Matthew and ehm... I suppose this
is what they mean by "Debians helpfull community"! I'm possitively amazed!
:-D

one more question though,

>
>
>  So you could do something like this in your postinst:
>
> if [ "$1" = "configure" -a "$2" = "" ]; then
># Ask your questions
> fi
>
> Because the only time that the second argument will be empty is on the
> initial install -- after that, $2 will always contain the previously
> configured version.
>
>
Would this still allow users to issue a dpkg-reconfigure?

And never heard of the hello package, but I will install it right away :-)

Regards,
Luke