2003-10-08 22:18:15 +02:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
$version = $ARGV[0];
|
|
|
|
|
|
|
|
if($version eq "") {
|
|
|
|
print "Enter version number!\n";
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!-f "ares.h") {
|
|
|
|
print "run this script in the ares source root dir\n";
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2004-10-24 15:02:09 +02:00
|
|
|
my ($major, $minor, $patch)=split(/\./, $version);
|
|
|
|
|
|
|
|
$major += 0;
|
|
|
|
$minor += 0;
|
|
|
|
$patch += 0;
|
|
|
|
|
|
|
|
open(VER, "<ares_version.h") ||
|
|
|
|
die "can't open ares_version.h";
|
|
|
|
open(NEWV, ">ares_version.h.dist");
|
|
|
|
while(<VER>) {
|
|
|
|
$_ =~ s/^\#define ARES_VERSION_MAJOR .*/\#define ARES_VERSION_MAJOR $major/;
|
|
|
|
$_ =~ s/^\#define ARES_VERSION_MINOR .*/\#define ARES_VERSION_MINOR $minor/;
|
|
|
|
$_ =~ s/^\#define ARES_VERSION_PATCH .*/\#define ARES_VERSION_PATCH $patch/;
|
|
|
|
$_ =~ s/^\#define ARES_VERSION_STR .*/\#define ARES_VERSION_STR \"$version\"/;
|
|
|
|
|
|
|
|
print NEWV $_;
|
|
|
|
}
|
|
|
|
close(VER);
|
|
|
|
close(NEWV);
|
|
|
|
print "ares_version.h.dist created\n";
|
|
|
|
|
2003-10-08 22:25:37 +02:00
|
|
|
if(!-f "configure") {
|
2004-07-23 00:18:45 +02:00
|
|
|
print "running buildconf\n";
|
|
|
|
`./buildconf`;
|
2003-10-08 22:18:15 +02:00
|
|
|
}
|
2004-07-23 00:18:45 +02:00
|
|
|
print "adding $version in the configure.ac file\n";
|
|
|
|
`sed -e 's/AM_INIT_AUTOMAKE(c-ares, CVS)/AM_INIT_AUTOMAKE(c-ares, $version)/' < configure.ac > configure.ac-rel`;
|
2003-10-08 22:18:15 +02:00
|
|
|
|
2004-07-23 00:18:45 +02:00
|
|
|
# now make a new configure script with this
|
|
|
|
print "makes a new configure script\n";
|
2004-07-24 08:29:38 +02:00
|
|
|
`autoconf configure.ac-rel >configure`;
|
2003-10-08 22:18:15 +02:00
|
|
|
|
2004-07-23 00:18:45 +02:00
|
|
|
# now run this new configure to get a fine makefile
|
|
|
|
print "running configure\n";
|
|
|
|
`./configure`;
|
2003-10-08 22:18:15 +02:00
|
|
|
|
2004-07-23 00:18:45 +02:00
|
|
|
# now make the actual tarball
|
|
|
|
print "running make dist\n";
|
|
|
|
`make dist`;
|
2003-10-08 22:18:15 +02:00
|
|
|
|
2004-07-23 00:18:45 +02:00
|
|
|
print "removing temporary configure.ac file\n";
|
|
|
|
`rm configure.ac-rel`;
|
2004-04-01 10:23:26 +02:00
|
|
|
|
|
|
|
print "NOTE: now cvs tag this release!\n";
|