]> sipb.mit.edu Git - wiki.git/blob - doc/debian-hacking.mdwn
projects/www: document superrepo; also check off some todos
[wiki.git] / doc / debian-hacking.mdwn
1 Debian and Ubuntu packages make it easy to hack on software that's
2 packaged and try out your changes. These instructions assume that you
3 have an understanding of how Debian packaging works, although all you
4 really need to know is that each file in the distribution comes from a
5 <i>package</i>, which contains the compiled form of a <i>source
6 package</i>.
7
8 1. Figure out what package the software is from. Usually it's named
9 approximately the same as the software itself, e.g., `barnowl` or `gdb`
10 or `libwww-mechanize-ruby`. You can use the command `dpkg -S` to figure
11 out where a file comes from, or search on
12 [packages.debian.org](http://packages.debian.org/) or
13 [packages.ubuntu.com](http://packages.ubuntu.com/).
14
15 2. Type `apt-get source` followed by the package name. This will
16 download the source package.
17
18 3. cd into the directory that was just created and make whatever changes
19 you want.
20
21 4. Run the command `dch -i`, which edits the debian/changelog file. Add
22 something like "~edited1" to the end of the verson; a version with a
23 tilde in it comes before a version without. This means Debian will let
24 you install your edited version over the current version, but also
25 permit the next offical release to supersede your hacked version.
26
27 5. Run the command `debuild` to compile the software and build a
28 package.
29
30 6. `cd ..` and then find the package that was just built. As root, run
31 `dpkg -i` followed by this package name.
32
33 You can find more information about writing Debian or Ubuntu packages in
34 [Ubuntu's packaging guide](https://wiki.ubuntu.com/PackagingGuide) or
35 SIPB's [packaging tutorial](http://debathena.mit.edu/packaging/) on the
36 Debathena website.