]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
First stab at moving build_kit to release versioning based on tla
authorRichard Curnow <rc@rc0.org.uk>
Tue, 19 Jul 2005 22:04:01 +0000 (22:04 +0000)
committerRichard P. Curnow <rc@rc0.org.uk>
Thu, 19 Jan 2006 21:37:14 +0000 (21:37 +0000)
Makefile.in
build_kit
mkversion [new file with mode: 0755]

index 23cf65bf09b6b0eb83f652c4c2820606b0dd11aa..6550543533ae640487115326bfa65674880afbc5 100644 (file)
@@ -86,7 +86,7 @@ clean :
        -rm -f *.o *.s chronyc chronyd core *~
 
 version.h : version.txt
-       sed -e 's/[$$]Name: \(.*\) [$$]/\1/;' < version.txt > version.h
+       ./mkversion
 
 
 # For install, don't use the install command, because its switches
index 30673186153b1cab6986a94312bf05460b502459..ec7ecb8a1c672494a4269fd8169386813fd7df64 100755 (executable)
--- a/build_kit
+++ b/build_kit
@@ -2,10 +2,25 @@
 # $Header: /cvs/src/chrony/build_kit,v 1.13 2003/01/12 23:50:54 richard Exp $
 # Perl script for building a release
 
+# Have to run it in the current directory
+if (($0 ne "build_kit") && ($0 ne "./build_kit")) {
+  die "Have to be in the checked-out directory to run build_kit";
+}
+
+$here=`pwd`;
+chomp $here;
+$version=$here;
+$version =~ s,^.*/chrony-([^/]+)$,$1, || die "Didn't recognize directory name";
+print "Building kit for version $version\n";
+
 chmod 0755, "configure";
 
+# Overwrite normal version.h file with version-specific one
+open (OUT, ">version.txt");
+print OUT $version."\n";
+close OUT;
+
 # Construct chrony.spec file
-$version = $ARGV[0] || die "No version on command line";
 open (IN, "<chrony.spec.sample");
 open (OUT, ">chrony.spec");
 while (<IN>) {
diff --git a/mkversion b/mkversion
new file mode 100755 (executable)
index 0000000..e76d48f
--- /dev/null
+++ b/mkversion
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+rm -f version.h
+echo "#ifndef VERSION_H" > version.h
+echo "#define VERSION_H 1" >> version.h
+
+if [ -f version.txt ]; then
+       ver=`cat version.txt`
+       echo "#define PROGRAM_VERSION_STRING \"$ver\"" >> version.h
+else
+       echo "#define PROGRAM_VERSION_STRING \"DEVELOPMENT\"" >> version.h
+fi
+
+echo "#endif /* VERSION_H */" >> version.h
+