[556] | 1 | #!/usr/bin/perl -w
|
---|
| 2 | #
|
---|
| 3 | # Init script for mondo with Project-Builder
|
---|
| 4 | #
|
---|
| 5 |
|
---|
| 6 | # Export documentation to generate what is needed
|
---|
| 7 | use ProjectBuilder::Base;
|
---|
| 8 | use ProjectBuilder::Filter;
|
---|
| 9 | use ProjectBuilder::CMS;
|
---|
| 10 | use ProjectBuilder::Env;
|
---|
| 11 | use File::Basename;
|
---|
| 12 |
|
---|
| 13 | pb_mkdir_p("docs");
|
---|
| 14 | my %pb;
|
---|
| 15 | $pb{'pkg'} = "PBPKG";
|
---|
| 16 | $pb{'ver'} = "PBVER";
|
---|
| 17 | $pb{'tag'} = "PBTAG";
|
---|
| 18 | $pb{'rev'} = "PBREV";
|
---|
| 19 | $pb{'proj'} = "PBPROJ";
|
---|
| 20 | $pb{'date'} = "PBDATE";
|
---|
| 21 | $pb{'repo'} = "PBREPO";
|
---|
| 22 |
|
---|
| 23 | # Action needs to be pbinit
|
---|
| 24 | my ($filteredfiles, $supfiles, $defpkgdir, $extpkgdir) = pb_env_init($pb{'proj'},undef,"pbinit");
|
---|
| 25 | my ($scheme,$uri) = pb_cms_init(undef);
|
---|
| 26 |
|
---|
| 27 | pb_cms_export($uri,"$ENV{'PBDIR'}/mondo-doc/mondoarchive.8","docs");
|
---|
| 28 | pb_cms_export($uri,"$ENV{'PBDIR'}/mondo-doc/mondorestore.8","docs");
|
---|
| 29 | pb_cms_export($uri,"$ENV{'PBDIR'}/mondo-doc/images","docs/images");
|
---|
| 30 | pb_cms_export($uri,"$ENV{'PBDIR'}/mondo-doc/fdl.sgml","docs");
|
---|
| 31 | pb_cms_export($uri,"$ENV{'PBDIR'}/mondo-doc/mondorescue-howto.sgml","docs");
|
---|
| 32 | pb_cms_export($uri,"$ENV{'PBDIR'}/mondo-doc/mondorescue-howto.dsl","docs");
|
---|
| 33 | pb_cms_export($uri,"$ENV{'PBDIR'}/mondo-doc/Makefile.howto","docs");
|
---|
[558] | 34 | pb_cms_export($uri,"$ENV{'PBDIR'}/mondo-doc/Makefile.man","docs");
|
---|
[556] | 35 | pb_cms_export($uri,"$ENV{'PBDIR'}/mondo-doc/mindi.8","docs");
|
---|
| 36 |
|
---|
| 37 | # call filter_file here
|
---|
| 38 | my $ptr = pb_get_filters($pb{'pkg'});
|
---|
| 39 | foreach my $f ((<docs/*.8>),(<docs/*.sgml>)) {
|
---|
| 40 | pb_filter_file_inplace($ptr,$f,\%pb);
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | system("cd docs ; make -f Makefile.howto ; make -f Makefile.man");
|
---|
| 44 |
|
---|
| 45 | # Fix man pages for Web usage
|
---|
| 46 | foreach my $f (<docs/*.8.html>) {
|
---|
| 47 | my $content = pb_get_content($f);
|
---|
| 48 | $content =~ s~/man8/~/docs/~g;
|
---|
| 49 | $content =~ s~<A HREF[=./A-z0-9"]*/man1/[^<]*>([A-z0-9]*)</A>~$1~g;
|
---|
[558] | 50 | $content =~ s~/index.html~/index.shtml~g;
|
---|
[556] | 51 | pb_set_content($f,$content);
|
---|
| 52 | }
|
---|