You can do that in pbuilder (https://wiki.debian.org/PbuilderTricks ; also allows testing locally-built packages in a pbuilder --login session), but be aware that this method leaves the locally-built packages available until explicitly removed, so if you decide not to upload the new version of the library, don't forget to remove it before building anything that uses it.sbuild also has lots of nifty extra features. One I use a lot is the ability to locally build a stack of related packages against each other[1].