[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;
|
---|
[1633] | 9 | use ProjectBuilder::VCS;
|
---|
[556] | 10 | use ProjectBuilder::CMS;
|
---|
| 11 | use ProjectBuilder::Env;
|
---|
| 12 | use File::Basename;
|
---|
| 13 |
|
---|
| 14 | pb_mkdir_p("docs");
|
---|
| 15 | my %pb;
|
---|
| 16 | $pb{'pkg'} = "PBPKG";
|
---|
| 17 | $pb{'ver'} = "PBVER";
|
---|
| 18 | $pb{'tag'} = "PBTAG";
|
---|
| 19 | $pb{'rev'} = "PBREV";
|
---|
| 20 | $pb{'proj'} = "PBPROJ";
|
---|
| 21 | $pb{'date'} = "PBDATE";
|
---|
| 22 | $pb{'repo'} = "PBREPO";
|
---|
[1442] | 23 | $pb{'extdir'} = "PBEXTDIR";
|
---|
[556] | 24 |
|
---|
| 25 | # Action needs to be pbinit
|
---|
| 26 | my ($filteredfiles, $supfiles, $defpkgdir, $extpkgdir) = pb_env_init($pb{'proj'},undef,"pbinit");
|
---|
| 27 | my ($scheme,$uri) = pb_cms_init(undef);
|
---|
| 28 |
|
---|
[1062] | 29 | foreach my $f ("mondoarchive.8", "mondorestore.8", "fdl.sgml", "mondorescue-howto.sgml", "mondorescue-howto.dsl", "Makefile.howto", "Makefile.man", "mindi.8", "HOWTO-_Deploy_Linux_from_SCSI_to_SATA.pdf", "hwmigration.pdf", "mondo-presentation-v1.pdf", "mondo-presentation-v2.pdf", "p2v.odt", "p2v.pdf", "LabMondoRescue.odt", "LabMondoRescue.pdf", "mondo-ref-card.pdf") {
|
---|
[1633] | 30 | pb_vcs_export($uri,"$ENV{'PBDIR'}/mondo-doc/$f","docs");
|
---|
[576] | 31 | }
|
---|
[1633] | 32 | pb_vcs_export($uri,"$ENV{'PBDIR'}/mondo-doc/images","docs/images");
|
---|
[556] | 33 |
|
---|
| 34 | # call filter_file here
|
---|
| 35 | my $ptr = pb_get_filters($pb{'pkg'});
|
---|
| 36 | foreach my $f ((<docs/*.8>),(<docs/*.sgml>)) {
|
---|
| 37 | pb_filter_file_inplace($ptr,$f,\%pb);
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | system("cd docs ; make -f Makefile.howto ; make -f Makefile.man");
|
---|
| 41 |
|
---|
| 42 | # Fix man pages for Web usage
|
---|
| 43 | foreach my $f (<docs/*.8.html>) {
|
---|
| 44 | my $content = pb_get_content($f);
|
---|
| 45 | $content =~ s~/man8/~/docs/~g;
|
---|
| 46 | $content =~ s~<A HREF[=./A-z0-9"]*/man1/[^<]*>([A-z0-9]*)</A>~$1~g;
|
---|
[558] | 47 | $content =~ s~/index.html~/index.shtml~g;
|
---|
[556] | 48 | pb_set_content($f,$content);
|
---|
| 49 | }
|
---|