]> sipb.mit.edu Git - wiki.git/blob - doc/debian-hacking.mdwn
Add dev info
[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, within the framework of the packaging
3 system. These instructions assume that you have an understanding of how
4 Debian packaging works, although all you really need to know is that
5 each file in the distribution comes from a <i>package</i>, which
6 contains the compiled form of a <i>source 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 and
22 increments the version. Add something like "~edited1" to the end of the
23 version, because a version with a tilde in it is considered older than a
24 version without. This means Debian will let you install your edited
25 version over the current version, but also permit the next offical
26 release to supersede your hacked version.
27
28 5. Run the command `debuild` to compile the software and build a
29 package.
30
31 6. `cd ..` and then find the package that was just built. As root, run
32 `dpkg -i` followed by this package name.
33
34 You can find more information about writing Debian or Ubuntu packages in
35 [Ubuntu's packaging guide](https://wiki.ubuntu.com/PackagingGuide) or
36 SIPB's [packaging tutorial](http://debathena.mit.edu/packaging/) on the
37 Debathena website.