source: ProjectBuilder/projects/mondorescue/pbconf/branches/3.3/website/pbinit@ 2343

Last change on this file since 2343 was 2343, checked in by Bruno Cornec, 6 years ago

Adapt MondoRescue to pb 0.15 with yml conf files

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/usr/bin/perl -w
2#
3# Init script for mondo with Project-Builder
4#
5
6# Export documentation to generate what is needed
7use ProjectBuilder::Base;
8use ProjectBuilder::Filter;
9use ProjectBuilder::VCS;
10use ProjectBuilder::Env;
11use File::Basename;
12
13pb_mkdir_p("docs");
14my %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$pb{'extdir'} = "PBEXTDIR";
23$pb{'realpkg'} = "PBREALPKG";
24
25# Action needs to be pbinit
26my ($filteredfiles, $supfiles, $defpkgdir, $extpkgdir) = pb_env_init($pb{'proj'},undef,"pbinit");
27my ($scheme,$uri) = pb_vcs_init(undef);
28
29foreach 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") {
30 pb_vcs_export($uri,"$ENV{'PBDIR'}/mondo-doc/$f","docs");
31}
32pb_vcs_export($uri,"$ENV{'PBDIR'}/mondo-doc/images","docs/images");
33
34# call filter_file here
35my $ptr = pb_get_filters($pb{'pkg'});
36foreach my $f ((<docs/*.8>),(<docs/*.sgml>)) {
37 pb_filter_file_inplace($ptr,$f,\%pb);
38}
39
40system("cd docs ; make -f Makefile.howto ; make -f Makefile.man");
41
42# Fix man pages for Web usage
43foreach 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;
47 $content =~ s~/index.html~/index.shtml~g;
48 pb_set_content($f,$content);
49 }
Note: See TracBrowser for help on using the repository browser.