Set soversion automatically instead of manually.

Here's what I came up with. There's probably a more elegant way of doing ti but it seems to work well.