Debian Codegraph @

bin/generate_rel_manpages

raw
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
4
5 use strict;
6 require Cwd;
7
8
9 ###########
10 ###### Sanity Checks
11 ##########
12
13 my $perl_path = '/usr/bin/perl';
14
15 my $status= 0;
16
17 &can_run($perl_path.' -V') ||
18 die "$0: perl path is incorrect, please fix the script\n";
19
20 my $doxy_path = '/usr/local/bin';
21
22 $ENV{'PATH'} = $ENV{'PATH'}.':'.$doxy_path;
23
24 print "Starting doxygen document generation \n";
25
26 my $chgrp = 'chgrp';
27 my $cpio = 'cpio';
28 my $date = 'date';
29 my $egrep = 'egrep';
30 my $find = 'find';
31 my $gzip = 'gzip';
32 my $bzip = 'bzip2';
33 my $tar = 'tar';
34 my $mv = 'mv -f';
35 my $scp = 'scp ';
36 my $rm = 'rm -f';
37 my $cp = 'cp -f';
38 my $md5sum = 'md5sum';
39 my $shell_cd = 'cd';
40 my $cksum_ext = 'md5';
41 my $redirect = '>';
42 my $checksum = '$md5sum';
43
44 $SIG{'HUP'} = $SIG{'INT'} = $SIG{'QUIT'} = $SIG{'TERM'} = 'cleanup';
45
46 my $release_filter = '\\( -name .svn -o -name build \\) -prune -o ' .
47 '! -name \'.\#*\' ! -name \'\#*\' ! -name \'*~\' ' .
48 '! -name \'*.MAK\' -print';
49
50 my $bin_files =
51 "\"\\.mak|\\.mdp|\\.ide|\\.exe\|\\.ico\|\\.gz\|\\.zip\|" .
52 "\\.gif|\\.vcp|\\.vcproj|\\.vcw|\\.sln\"";
53
54 ########
55 ######## Main execution thread.
56 ########
57 &ex ("bin/generate_doxygen.pl -is_release -perl_path $perl_path")
58 && die "$0: failed to generate ACE man pages\n";
59
60 my $build_command =
61 "$find ./html $release_filter | $cpio -o -H tar | " .
62 "$gzip -9 > ACE-html.tar.gz && ".
63 "$find ./html $release_filter | $cpio -o -H tar | " .
64 "$bzip -9 > ACE-html.tar.bz2 && ".
65 "$find ./html $release_filter | $egrep -v $bin_files | " .
66 "zip ACE-html.zip -q9@ &&" .
67 "md5sum ACE-html.tar.gz > ACE-html.tar.gz.md5 &&" .
68 "md5sum ACE-html.tar.bz2 > ACE-html.tar.bz2.md5 &&" .
69 "md5sum ACE-html.zip > ACE-html.zip.md5;";
70
71 &ex ($build_command)
72 && die "$0: failed to package ACE man pages\n";
73
74 print "Finished doxygen document generation \n";
75
76 exit $status;
77
78
79 ########
80 ######## Verify that a command can be executed, return 1 on sucess
81 ########
82 sub can_run {
83 my $command = shift;
84
85 open (RUN, "$command 2>&1 |")
86 || return 0;
87 while (<RUN>) {}
88 close(RUN)
89 || return 0;
90 return 1;
91 }
92
93 ########
94 ######## Execute a command, unless -n had been specified. Return value
95 ######## of 0 indicates success.
96 ########
97 sub ex ()
98 {
99 my ($command) = @_;
100
101 print "Command is $command \n";
102 system ("$command");
103 }