I am trying to configure a debian package to perform some actions on install (more specifically, I want to set up some application preferences using gconftool-2) that only need to be performed once. I have never worked with debian packages before, and I am not sure if there is an 'on install do this' property. Any help is appreciated.
- As a side note, I don't think I'd like a package breaks my Gnome configuration on its own... I understand your app. is probably not going to work right or as well without those changes, but that's something I'd offer to do in my app with a clear explanation of why it's necessary.Alexis Wilke– Alexis Wilke2018-08-14 20:00:10 +00:00Commented Aug 14, 2018 at 20:00
Add a comment |
2 Answers
In the Debian folder, you create a postinst shell script and perform your modification from that script. If you have a different tool to make the modification to preferences, then call that tool from your script.
#!/bin/sh -e #DEBHELPER# # Source debconf library. . /usr/share/debconf/confmodule if [ "$1" = "configure" ] then # Do your work here # (the following gconftool-2 example is not valid, but it gives an idea) gconftool-2 mouse swap-buttons fi VERY IMPORTANT: the #DEBHELPER# pattern will be replaced by debian scripts as required. It is very important to have it in your script. It is generally expected to appear first although you could have some code before, it's rare to see such.