- Make sure a "source" source is defined in /etc/apt/sources.list. Something like this
deb-src http://http.us.debian.org/debian lenny main contrib non-free
- Install some prerequisites
apt-get install build-essential debhelper fakeroot devscripts
- Install the source
apt-get source package-name
- Install the build dependencies
apt-get build-dep less
- Make any required changes to the source tree, or build rules in package-name/debian/rules
- Update the package version
cd package-name
dch -i
- Compile and repackage
dpkg-buildpackage -rfakeroot