dpatch - just superb! (a short How to)

As I had mentioned in this post about the top gear packaging activity that is going on for a few Science tools (more specifically Electronics), one review point that the packager comes across instantly is that “Do not change upstream code”. This is a Golden rule for packagers. Making these changes as patches in debian/ (for debian based distros ofcourse ;-) ) is highly recommended. One such tool for achieving this is DPATCH. kart linked me to this nice page which has a few details on dpatch. Still the page did not have a step by step how to, instead has tidbits. So here goes my how-to or just a documentation of what I learnt.

1. Install dpatch. sudo apt-get install dpatch

2. Go to “your_packages_top_directory”/debian and create a directory “patches”. (mkdir patches)

3. Inside this debian/patches directory create a file “00list”. The reason for this file is explained in the coming points.

4. Open up debian/rules in your favourite editor (I expect it to be emacs ofcourse ;-) ) and do the changes mentioned below.

* Add this line “include /usr/share/dpatch/dpatch.make” without the quotes at the top.

* Append to the config.status section “patch-stamp” before “configure”. This shall let the package know that there is a patch stamp that needs to be checked.

* In the “clean” section add “unpatch”. This ensures the patch is reverted when a make clean is performed.

5. Now save the debian/rules and execute the following command. “dpatch-edit-patch {patchname}”. Say for example the patch name is fixing_foo then the command is “dpatch-edit-patch fixing_foo”

6. This opens up a temporary shell where a copy of the source package is ready. Make the changes that you would want to do and exit the shell. Patch is created. Wow! (Check debian/patches directory)

7. Update this patch name in the 00list file that we created in point 3. This file will have the list of patches that needs to be applied in the specified order. Repeat this process until all the necessary changes to upstream is done and patches are ready.

Now give the package for a build. Sit back, relax and enjoy the pbuilder experience!

2 Responses to “dpatch - just superb! (a short How to)”

  1. Daniel Holbach Says:

    https://wiki.ubuntu.com/PackagingGuide/PatchSystems is a great resource for dealing with patch systems too.

  2. It's all in a day's work Says:

    Broken Wordpress: debian unstable is called unstable for a reason…

    Update 2009-09-07: The maintainer of the wordpress package released “my” bugfix. It’s available now for those using unstable (sid). I guess it will be available in testing (lenny) soon, since the bug is listed in the release critical …

Leave a Reply

You must be logged in to post a comment.


order generic viagra accutane online find cheap viagra buy generic soma price of clomid cialis online cheap viagra drug drug cialis buying generic viagra pharmacy cialis buy cheapest viagra purchase soma viagra cost order cialis viagra for sale buy cialis purchase synthroid online generic zithromax viagra overnight shipping cheapest viagra online cheapest zithromax cheap cialis tablet buy viagra from india acomplia prescription buy viagra no prescription required levitra pharmacy buying generic cialis buy zithromax without prescription lasix online viagra buy online zithromax without a prescription buy cialis from canada purchase viagra overnight delivery cialis for sale levitra online stores buy acomplia without prescription cheap generic levitra cheap propecia online cheap price viagra buy cheap viagra internet synthroid pharmacy viagra online cheap cialis uk cheap viagra from uk cheapest generic cialis online buy cialis in canada accutane pharmacy find cialis no prescription required order acomplia cheapest propecia price of acomplia buy generic cialis viagra in bangkok buy cheap propecia online buy lasix purchase levitra online find cheap viagra online buy discount viagra online clomid pharmacy clomid without a prescription buy generic acomplia soma prices cheapest soma buy zithromax lasix prescription viagra discount levitra without a prescription buy zithromax cheap acomplia pills cheap accutane cheap viagra overnight delivery soma buy viagra us