Packaging Notes

I've done easy fixes (debdiffs) in Ubuntu and find I need to look up exactly how I want to do a debdiff every time.   Last time I had to look at 5 different docs to get all the commands I needed.   The bug I based this on was a debian only change (Init script), I plan to update it next time I have an actual source change.

  1. Start a new VM/ Cloud instance
  2. sudo apt-get install packaging-dev
  3.  apt-get source <package_name>  ;  apt-get build-dep <package_name>
  4. cd into-directory-created
  5. Make the change (if it's only a debian/ change)
  6. dch -i   (document it)
  7. debuild -S -us -uc  (build it)
  8. debdiff rrdtool_1.4.7-1.dsc rrdtool_1.4.7-1ubuntu1.dsc > rrdtool_1.4.7-1ubuntu1.debdiff   (make the debdiff - note to me, change the name later)
  9. cd into-directory; DEB_BUILD_OPTIONS='nostrip noopt debug' fakeroot debian/rules binary  (build it)
  10.  Test it
Docs used:
  1. http://packaging.ubuntu.com/html/traditional-packaging.html
  2. http://packaging.ubuntu.com/html/fixing-a-bug-example.html
  3. http://cheesehead-techblog.blogspot.com/2008/10/creating-patch-to-fix-ubuntu-bug.html
  4. https://wiki.debian.org/IntroDebianPackaging
  5. https://wiki.debian.org/BuildingTutorial
Comments:toobuntu My understanding is the current best practice is to use mk-build-deps, provided by the devscripts package, to install build dependencies. See https://wiki.debian.org/BuildingAPackage#Get_the_build_dependencies With apt-get build-dep, the installed packages are marked as manually installed and so won't be offered for autoremoval. mk-build-deps creates a dummy metapackage with the build deps as dependencies. When that generated package is later removed, so are the build deps. Or, add "APT::Get::Build-Dep-Automatic true;" to your apt.conf to mark the build deps as automatically installed so they will be removed with the next "apt-get autoremove"