1: Unpack, edit and repack tarball
Simple, just tar xzf tarball.tgz
Use an editor to change source
repack with tar czf tarball.tgz folder
2: Copy modified tarball to portage
cp tarball.tgz /usr/portage/distfiles
3: Rebuild digest
ebuild /usr/portage/[category]/[app]/application.ebuild digest