db: set proper mode to installed bins.
perl: avoid groff bdep and explicitly set man{1,3}dir.
perl: unset global vars after use; fix shlib perms.
tcl: set proper perms to shlibs.