Home | History | Annotate | Download | only in c-ares
      1 #!/usr/bin/env perl
      2 
      3 $version = $ARGV[0];
      4 
      5 if($version eq "") {
      6     print "Enter version number!\n";
      7     exit;
      8 }
      9 
     10 if(!-f "ares.h") {
     11     print "run this script in the ares source root dir\n";
     12     exit;
     13 }
     14 
     15 my ($major, $minor, $patch)=split(/\./, $version);
     16 
     17 $major += 0;
     18 $minor += 0;
     19 $patch += 0;
     20 
     21 open(VER, "<ares_version.h") ||
     22     die "can't open ares_version.h";
     23 open(NEWV, ">ares_version.h.dist");
     24 while(<VER>) {
     25     $_ =~ s/^\#define ARES_VERSION_MAJOR .*/\#define ARES_VERSION_MAJOR $major/;
     26     $_ =~ s/^\#define ARES_VERSION_MINOR .*/\#define ARES_VERSION_MINOR $minor/;
     27     $_ =~ s/^\#define ARES_VERSION_PATCH .*/\#define ARES_VERSION_PATCH $patch/;
     28     $_ =~ s/^\#define ARES_VERSION_STR .*/\#define ARES_VERSION_STR \"$version\"/;
     29 
     30     print NEWV $_;
     31 }
     32 close(VER);
     33 close(NEWV);
     34 print "ares_version.h.dist created\n";
     35 
     36 if(!-f "configure") {
     37     print "running buildconf\n";
     38     `./buildconf`;
     39 }
     40 print "adding $version in the configure.ac file\n";
     41 `sed -e 's/AC_INIT.*/AC_INIT([c-ares], [$version],/' < configure.ac > configure.ac.dist`;
     42 
     43 # now make a new configure script with this
     44 print "makes a new configure script\n";
     45 `autoconf configure.ac.dist >configure`;
     46 
     47 # now run this new configure to get a fine makefile
     48 print "running configure\n";
     49 `./configure`;
     50 
     51 # generate HTML versions of man pages
     52 # Deactivated for now. It seems that man pages need some adjustments
     53 # relative to paragraph and/or line breaks for proper html formatting.
     54 # EXTRA_DIST will need $(HTMLPAGES) when this is fully activated.
     55 # print "running make html\n";
     56 # `make -s html`;
     57 
     58 # generate PDF versions of man pages
     59 print "running make pdf\n";
     60 `make -s pdf`;
     61 
     62 # now make the actual tarball
     63 print "running make dist\n";
     64 `make dist VERSION=$version`;
     65 
     66 # remove temporay sourced man pages
     67 `make -s clean-sourced-manpages`;
     68 
     69 print "removing temporary configure.ac file\n";
     70 `rm configure.ac.dist`;
     71 print "removing temporary ares_version.h file\n";
     72 `rm ares_version.h.dist`;
     73 
     74 print "NOTE: now tag this release!\n";
     75