summaryrefslogtreecommitdiff
path: root/ACE/bin/generate_rel_manpages
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/bin/generate_rel_manpages')
-rwxr-xr-xACE/bin/generate_rel_manpages110
1 files changed, 110 insertions, 0 deletions
diff --git a/ACE/bin/generate_rel_manpages b/ACE/bin/generate_rel_manpages
new file mode 100755
index 00000000000..16faa4ce41c
--- /dev/null
+++ b/ACE/bin/generate_rel_manpages
@@ -0,0 +1,110 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+
+use strict;
+require Cwd;
+
+
+###########
+###### Sanity Checks
+##########
+
+my $perl_path = '/usr/bin/perl';
+
+my $status= 0;
+
+&can_run($perl_path.' -V') ||
+ die "$0: perl path is incorrect, please fix the script\n";
+
+my $doxy_path = '/usr/local/bin';
+
+$ENV{'PATH'} = $ENV{'PATH'}.':'.$doxy_path;
+
+print "Starting doxygen document generation \n";
+
+my $chgrp = 'chgrp';
+my $cpio = 'cpio';
+my $date = 'date';
+my $egrep = 'egrep';
+my $find = 'find';
+my $gzip = 'gzip';
+my $bzip = 'bzip2';
+my $tar = 'tar';
+my $make = 'make -f Release -s';
+my $mv = 'mv -f';
+my $scp = 'scp ';
+my $rm = 'rm -f';
+my $cp = 'cp -f';
+my $md5sum = 'md5sum';
+my $shell_cd = 'cd';
+my $cksum_ext = 'md5';
+my $redirect = '>';
+my $checksum = '$md5sum';
+
+$SIG{'HUP'} = $SIG{'INT'} = $SIG{'QUIT'} = $SIG{'TERM'} = 'cleanup';
+
+my $release_filter = '\\( -name .svn -o -name build \\) -prune -o ' .
+ '! -name \'.\#*\' ! -name \'\#*\' ! -name \'*~\' ' .
+ '! -name \'*.MAK\' -print';
+
+my $bin_files =
+ "\"\\.mak|\\.mdp|\\.ide|\\.exe\|\\.ico\|\\.gz\|\\.zip\|" .
+ "\\.gif|\\.vcp|\\.vcproj|\\.vcw|\\.sln\"";
+
+my $release_files = '';
+
+chomp ($release_files = `$make show_release_files`);
+
+########
+######## Main execution thread.
+########
+&ex ("bin/generate_doxygen.pl -is_release -perl_path $perl_path")
+ && die "$0: failed to generate ACE man pages\n";
+
+my $build_command =
+ "$find ./html $release_filter | $cpio -o -H tar | " .
+ "$gzip -9 > ACE-html.tar.gz && ".
+ "$find ./html $release_filter | $cpio -o -H tar | " .
+ "$bzip -9 > ACE-html.tar.bz2 && ".
+ "$find ./html $release_filter | $egrep -v $bin_files | " .
+ "zip ACE-html.zip -q9@ &&" .
+ "md5sum ACE-html.tar.gz > ACE-html.tar.gz.md5 &&" .
+ "md5sum ACE-html.tar.bz2 > ACE-html.tar.bz2.md5 &&" .
+ "md5sum ACE-html.zip > ACE-html.zip.md5;";
+
+&ex ($build_command)
+ && die "$0: failed to package ACE man pages\n";
+
+print "Finished doxygen document generation \n";
+
+exit $status;
+
+
+########
+######## Verify that a command can be executed, return 1 on sucess
+########
+sub can_run {
+ my $command = shift;
+
+ open (RUN, "$command 2>&1 |")
+ || return 0;
+ while (<RUN>) {}
+ close(RUN)
+ || return 0;
+ return 1;
+}
+
+########
+######## Execute a command, unless -n had been specified. Return value
+######## of 0 indicates success.
+########
+sub ex ()
+{
+ my ($command) = @_;
+
+ print "Command is $command \n";
+ system ("$command");
+}