automatically update the internal versioning of MSVA.pm from the
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 20 Dec 2010 17:34:03 +0000 (12:34 -0500)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 20 Dec 2010 17:43:20 +0000 (12:43 -0500)
Changelog.

This is a little crufty (it might trip up people the first time they
bump versions directly from within a git repo, and cause a spurious
commit or two), but it has a few advantages:

 0) it is a simple, small change to make right now, and

 1) it means we can leave all the files in place, so the test harness
    can work in-place.

 2) our "upstream tarball" can continue to be cleanly built.

Probably the better long-term way to fix this is an "install" target
in the Makefile that does this substitution as it transfers the file
into place.  That target would need to know where to place perl
modules, among other things.  (see MS # 2684)

Makefile

index 351c0498ee6dbbdb24e9ef44dd643a4f5c9a5505..d3927d74da85def2cdef38462e0e472457b77627 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -5,16 +5,19 @@
 # © 2010 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
 # Licensed under GPL v3 or later
 
 # © 2010 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
 # Licensed under GPL v3 or later
 
-VERSION=`dpkg-parsechangelog -lChangelog | grep ^Version: | cut -f2 -d\ `
+VERSION := $(shell dpkg-parsechangelog -lChangelog | grep ^Version: | cut -f2 -d\ )
 DEBIAN_VERSION=`dpkg-parsechangelog | grep ^Version: | cut -f2 -d\ `
 
 MANPAGES=msva-perl.1 msva-query-agent.1
 
 DEBIAN_VERSION=`dpkg-parsechangelog | grep ^Version: | cut -f2 -d\ `
 
 MANPAGES=msva-perl.1 msva-query-agent.1
 
-all: $(MANPAGES)
+all: $(MANPAGES) Crypt/Monkeysphere/MSVA.pm
 
 %.1: %
        pod2man $< $@
 
 
 %.1: %
        pod2man $< $@
 
+Crypt/Monkeysphere/MSVA.pm: Changelog
+       sed -i "s/^  \\\$$VERSION = '[a-z0-9.~A-Z]*';$$/  \$$VERSION = '$(VERSION)';/" $@
+
 clean: 
        rm -f $(MANPAGES)
 
 clean: 
        rm -f $(MANPAGES)