I'm actually using debconf to prompt the user some informations that I'll need after he deployed the .deb.
Following the documentation, here is what I understood from the process:
1) declare depends: debconf (>= 0.2.17) in the debian/control file (I just need debconf for my postinst script so I won't need to declare it in the build-depends)
2) create the debian/*.template file and insert in it your questions/message, respecting the syntax (found on the debian-policy)
3) Create the debian/config file. This file will handle the code (in bash, python or Perl) that will use the questions/messages declared in debian/template to prompt the user or answer him. The datas grabed by this script will be stored in a special db (I suppose that it is a file database).
4) those datas are transmitted (I should say invoked in) to the postinst script that will use them for whatever he wants (in my case it will be setup a login/password for a mysql database)
My questions are:
- How the config file is called? shall I call it in my install rule in debian/rules? Is it mandatory to create it in a subdirectory of debian/ (debian/tmp/DEBIAN/)?
- Is it possible to check the questions/answer without using them in the postinst script? I mean for example I'd like to just declare the questions and answers in debian/packagename.template, use them in debian/config script, build the package and then check if they are well prompted while deploying the package (basic dpkg -i mypackage.deb)
At the moment I simply followed the tutorial provided by Mr.Hess (http://www.fifi.org/doc/debconf-doc/tutorial.html
). I copied and paste the bash code for the template and config files (replacing the packages names with mines), and didnt set up a postinst file, but it obviously did nothing. I also didnt touch to my base debian/rules file.
The package is well build by dpkg-buildpackage -us -uc, and my program is well deployed, but I'm never prompted for the question declared in debian/packagename.templates and used in debian/config.
Result is the same if I place my files in the tmp/DEBIAN subdirectory.
Thanks in advance for any help provided
edit: self solved a few days ago.
To explain a bit, I was not understanding well debconf. for a simple questions prompts, do as following:
1) write a template file, containing the questions
2) write a config file, that will input the question during the installation
3) get the answers (stored in the debconf database) in the postinst script and do whatever you want with them.
I need to explore a bit more to implement verification and validation for the questions during the prompt.Debconf can do a lot more and be used in others scripts like prerm, postrm, etc...
Hope this helps.