I'm trying to a make a simple .deb package, which would basically edit a config of another package I listed as a dependency.
I added the required manipulations to the postinstall file.
The problem is I can't find a way to package an example config, which should be copied and edited from the postinstall script.
At the moment I just have a folder with the sample config, of which I'm creating a tar.gz and orig.tar.gz, then dh_make
in that folder, edit the generated files and run debuild
. However if I open the resulting .deb file with an archive manager, I can see that the sample file was not included at all.
For your use case you would not use a new package to modify your configuration. Rather, you should rebuild the package that you are modifying with a modified default config (via a patch). Then, you would upload that package to a PPA or similar repository system for easy installation.
Packaging a single file into a .deb just to change a different .deb's config file is not advised given that if that other .deb is modified and you ahve an explicit version in your debian/control, and the new version is too new, your system will reject the config-changing .deb.
Please comment on this answer with why you specifically want a .deb to do the conf changes, and I can elaborate on how you'd go about doing this, if at all.
Making a .deb is not a no-brainer, you actually need substantial understanding of how packaging works among other things. You will have to update your package once an update arrives from the original one, but that can be partially decided based upon changelogs, including but not limited to what package currently exists in Ubuntu, and what is fixed in the differing version. But once you have the patch, you can apply it just as easily in the new version as it is to apply it to the old version, hence why I mentioned that.
This question is unanswerable in its current form, so let me elaborate on other questions i've seen:
A source package is a package in which the binary installer packages (.debs) are built from. They contain the entire source code of a program, but with all applicable patches and Debian package information in them.
Not necessarily. The source code of the program is indeed what the package is built from, but unless you're changing that code, you could modify a package without even touching the code. Depending of course, on what you are trying to do.
So to explain simply, regardless of whichever you do here you'll need to edit either the source code of the program downloaded upstream, or the source code contained within the package. So the "Original Source Code" is going to be worked with regardless. The postinst scripts and other installation-related scripts though are stored in
debian/*
within the package, and are not part of the source code.Patches to packages are touched upon in the packaging guide: http://developer.ubuntu.com/packaging/html/patches-to-packages.html
The complete Ubuntu Packaging Guide is here: http://developer.ubuntu.com/packaging/html/
After recieving additional information via email, the configuration is being updated for a specific package in order to include some type of restricted API that has a single-use key.
My method statement of using a PPA would not be recommended in this case given that API keys are usually specific to individual configurations, and such modified configurations should not be publicized, so that others don't try to hijack those configs.
If you are packaging this for Ubuntu, the the best place for finding out information on how to do get it done, of course Ubuntu. See Ubuntu wiki