The correct path since we do use autotools to compile everything is to use the version in configure.ac. It's very easy to substitute a variable in a file with configure (its how it works).
For erlang since it already has some make rules to substitute a variable into the app.src file I just added the following to the Makefile.am
PACKAGE_VERSION is the name of the version variable set in configure.ac.
So if you already have code being compiled by make you can put it into the appropriate Makefile.am.
However, there's another pattern you could use for something like java. I'll describe how it did it with maven, ivy/ant may be different.
I had a maven.xml which had the version in it like
So I rename maven.xml to maven.xml.in, then change the line above to
Then I add to configure.ac
Now what happens is when you run './configure' it will substitute any variables denoted by @VAR@ with the value detected/set by configure.
As far as appending
dev or something, that should be okay. Some package managers don't like '' in version numbers since they use '-' to separate different components, also sometimes they end up sorting wrong. Ideally you would want a way for a dev version to sort before the release version, so that different package managers can deal. It's hard to have a bulletproof version, but something like when you release 0.5.0 you start using 0.5.0.9999.dev as the dev version would probably work, then eventually you release 0.6.0,
and your versions sort through the transition.