Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debian packaging: deploying files to the user home directory

I use Debhelper to create Debian packages. To deploy files and directories, I use the debian/install and debian/dirs files.

Now I would like my package to deploy the default user configuration file to $HOME/.mypackagerc (just like .bashrc and friends).

Does Debhelper provide a way to do this, or should I just:

  • Do it in postinst script
  • Or even do this in my program, at first execution
like image 636
nicoulaj Avatar asked Jun 29 '10 13:06

nicoulaj


1 Answers

You should do it in your own program.

You can't get debhelper to do this. A postinst script may be able to install in all current user accounts, but you lose control of what happens after the user has performed the installation. So new users won't get the ~/.mypackagerc files, unless you put it in /etc/skel also which is overdoing it, in my opinion.

I also say this because the package is installed by root. Root shouldn't have to mess around with other user's files. I don't know whether Debian Policy has anything on this, but you'll save yourself writing a lot of ugly code if you program made these files itself.

HTH

like image 72
Umang Avatar answered Sep 29 '22 00:09

Umang