[interchange] Teach Makefile.PL about where to get VERSION from
David Christensen <[email protected]> Thu, 02 Nov 2017 19:24:31 +0000
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit e4105da0491ba5924518eef97cd0f86744d470b5 Author: David Christensen <[email protected]> Date: Thu Nov 2 14:22:46 2017 -0500 Teach Makefile.PL about where to get VERSION from Makefile.PL | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) --- diff --git a/Makefile.PL b/Makefile.PL index 7852705..54973cd 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -705,6 +705,17 @@ EOF # Check for extra needed libraries extra_libs($realdir); + # if we are building from a git checkout, then set the VERSION based on the + # closest git tag, otherwise use the last hard-coded version + + if (-d "./.git") { + $X{VERSION} = qx(git describe --tags --dirty); + chomp $X{VERSION}; + } + else { + $X{VERSION} = $VERSION; + } + mk_initp(\%X); delete $X{RPMBUILDDIR}; return \%X;