You could write a custom fact, that would get you version number.
One problem with that is the first puppet run, before the package is
installed, that fact would have to return something like '0', or 'nil',
so you would have to run puppet twice to get a node to a desired state.
I haven't found more intelligent approach to this problem so far :-/