The process needs internet connection and configured source.list.
1, Download the source package
#apt-get source packname_packversion-debianversion
2, Patch the source
#cd packname_packversion
Modify the source as you want.
You'd better inscrase the debianversion of the package by modifying debian/changelog, to avoid conflict.
3, Rebuild source package
#dpkg-buildpackage -S -rfakeroot
4, Build binary package
#cd .. && sudo pbuilder packname_packversion-newdebianversion.dsc
You will find your packages in /var/cache/pbuilder/result
note: If you use pbuilder for first time, you must use "pbuilder create" to create your base.tgz before the above command.