Handle package version when a rebuild is triggered

Fixes #96
TODO: tests