1st attempt at a git-compatible make_release script

This commit is contained in:
Richard P. Curnow 2006-01-22 23:54:19 +00:00
parent fa83311903
commit 383a36371f
2 changed files with 52 additions and 45 deletions

View file

@ -1,45 +0,0 @@
#!/usr/bin/env perl
# $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
open (IN, "<chrony.spec.sample");
open (OUT, ">chrony.spec");
while (<IN>) {
s/\@\@VERSION\@\@/$version/;
print OUT;
}
close (IN);
close (OUT);
# Requires the makeinfo from texinfo v4
system("makeinfo --no-headers --number-sections -o chrony.txt chrony.texi");
system ("rm -rf ./{arch}");
system ("rm -rf ./.arch-ids");
unlink "chrony.spec.sample";
unlink("build_kit");
chdir ("..");
system ("tar cvf - chrony-$version | gzip -9 > chrony-$version.tar.gz");
system ("gpg -b -a -o chrony-$version-tar-gz-asc.txt chrony-$version.tar.gz");

52
make_release Executable file
View file

@ -0,0 +1,52 @@
#!/usr/bin/env perl
$tool = "chrony";
$version = shift || die "Usage : $0 <version>\n";
$subdir = "${tool}-${version}";
unless (-d ".git") {
die "No .git subdirectory?"
}
unless (-d "RELEASES") {
mkdir "RELEASES", 0755;
}
system ("git-tag -s $version");
die "git-tag failed" if ($? != 0);
if (-d "RELEASES/$subdir") {
system ("rm -rf RELEASES/$subdir");
}
system ("git-tar-tree $version RELEASES/${subdir} | tar xf -");
die "git-tar-tree failed" if ($? != 0);
chdir "RELEASES";
$here = qx/pwd/;
chomp $here;
chdir $subdir;
open (OUT, ">version.txt");
print OUT $version."\n";
close OUT;
open (IN, "<${tool}.spec.sample");
open (OUT, ">${tool}.spec");
while (<IN>) {
s/\@\@VERSION\@\@/$version/;
print OUT;
}
close (IN);
close (OUT);
system("makeinfo --no-headers --number-sections -o chrony.txt chrony.texi");
unlink "make_release";
unlink "${tool}.spec.sample";
unlink ".gitignore";
chdir $here;
system ("tar cvf - $subdir | gzip -9 > ${subdir}.tar.gz");
system ("gpg -b -a -o ${subdir}-tar-gz-asc.txt ${subdir}.tar.gz");