#-*- perl -*- # Copyright (C) 2001-6 R Development Core Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # Send any bug reports to r-bugs@r-project.org use Cwd; use File::Find; use Win32; my $fn, $component, $path; my $startdir=cwd(); my $RVER, $RVER0; my $RW=$ARGV[0]; my $SRCDIR=$ARGV[1]; $SRCDIR =~ s+/+\\+g; # need DOS-style paths ## add to the target command line in the CmdParms function below open ver, "< ../../../VERSION"; $RVER = ; close ver; $RVER =~ s/\n.*$//; $RVER =~ s/Under .*$/Pre-release/; $RVER0 = $RVER; $RVER0 =~ s/ .*$//; my $sRW = Win32::GetShortPathName($SRCDIR); my %uuids; ## we could use Win32::Guidgen, but it is not normally installed ## so it is easier to use C code. my $nc = 900; open guidfile, ") { chomp; $uuids{$nc++} = $_; } close guidfile; $nc = 920; open insfile, "> R.wxs" or die "Cannot open R.wxs\n"; print insfile < END my $rgui, $rhelp; my %comp; open tfile, ") { next unless /^ /; if(/ 1, "README.packages" => 1, "COPYING.LIB" => 1, "bin\\INSTALL" => 1, "bin\\REMOVE" => 1, "bin\\SHLIB" => 1, "bin\\build" => 1, "bin\\check" => 1, "bin\\massage-Examples" => 1, "bin\\Rd2dvi.sh" => 1, "bin\\Rd2txt" => 1, "bin\\Rdconv" => 1, "bin\\Rdiff.sh" => 1, "bin\\Sd2Rd" => 1); $path="${SRCDIR}";chdir($path); my %main; find(\&listFiles, "."); print insfile < END foreach $n (sort values %main) { print insfile " \n"; } print insfile < END foreach $n (sort values %chtml) { print insfile " \n"; } print insfile < END foreach $n (sort values %html) { print insfile " \n"; } print insfile < END foreach $n (sort values %manuals) { print insfile " \n"; } print insfile < END foreach $n (sort values %refman) { print insfile " \n"; } print insfile < END foreach $n (sort values %latex) { print insfile " \n"; } print insfile < END foreach $n (sort values %devel) { print insfile " \n"; } print insfile < END foreach $n (sort values %Rd) { print insfile " \n"; } print insfile < END foreach $n (sort values %libdocs) { print insfile " \n"; } print insfile < END foreach $n (sort values %tcl) { print insfile " \n"; } print insfile < END foreach $n (sort values %trans) { print insfile " \n"; } ## look up local Windows system32 directory my $WINDOWS = Win32::GetFolderPath(Win32::CSIDL_SYSTEM); print insfile < END close insfile; sub listFiles { $fn = $File::Find::name; if (!(-d $_)) { $_ = $dir = $fn; s+^./++; s+/+\\+g; $fn =~ s+.*/++g; if ($_ eq "bin\\Rchtml.dll" || m/^library\\[^\\]*\\chtml/) { $component = "chtml"; #} elsif ($_ eq "doc\\html\\logo.jpg") { # $component = "html devel"; } elsif ($_ eq "doc\\manual\\R-FAQ.html" || $_ eq "doc\\html\\rw-FAQ.html" || $_ eq "share\\texmf\\Sweave.sty") { $component = "main"; } elsif (m/^doc\\html/ || m/^doc\\manual\\[^\\]*\.html/ || m/^library\\[^\\]*\\html/ || m/^library\\[^\\]*\\CONTENTS/ || $_ eq "library\\R.css") { $component = "html"; } elsif ($_ eq "doc\\manual\\refman.pdf") { $component = "refman"; } elsif (m/^doc\\manual/ && $_ ne "doc\\manual\\R-FAQ.pdf") { $component = "manuals"; } elsif (m/^library\\[^\\]*\\latex/) { $component = "latex"; } elsif (m/^library\\[^\\]*\\man/) { $component = "Rd"; } elsif (m/^Tcl/) { $component = "tcl"; } elsif (exists($develfiles{$_}) || m/^doc\\KEYWORDS/ || m/^src\\gnuwin32/ || m/^include/ || m/^src\\library\\windlgs/ || m/^share\\make/ || m/^share\\perl/ || m/^share\\R/ || m/^share\\texmf/ || m/^bin\\build/ || m/^bin\\check/ || m/^bin\\INSTALL/ || m/^bin\\massage-Examples/ || m/^bin\\Rd2dvi.sh/ || m/^bin\\Rd2txt/ || m/^bin\\Rdconv/ || m/^bin\\Rdiff.sh/ || m/^bin\\REMOVE/ || m/^bin\\Rprof/ || m/^bin\\Sd2Rd/ || m/^bin\\SHLIB/ || m/^lib\\/) { $component = "devel"; } elsif (m/^library\\grid\\doc/ || $_ eq "library\\survival\\survival.ps.gz") { $component = "libdocs"; } elsif ($_ eq "modules\\iconv.dll") { $component = "main"; } elsif (m/^share\\locale/ || m/^library\\[^\\]*\\po/) { # needs iconv $component = "trans"; } else { $component = "main"; } s+\\+/+g; $ncomp = $comp{$_}; $main{$_} = $ncomp if $component eq "main"; $devel{$_} = $ncomp if $component eq "devel"; $chtml{$_} = $ncomp if $component eq "chtml"; $html{$_} = $ncomp if $component eq "html"; $latex{$_} = $ncomp if $component eq "latex"; $manuals{$_} = $ncomp if $component eq "manuals"; $refman{$_} = $ncomp if $component eq "refman"; $Rd{$_} = $ncomp if $component eq "Rd"; $libdocs{$_} = $ncomp if $component eq "libdocs"; $tcl{$_} = $ncomp if $component eq "tcl"; $trans{$_} = $ncomp if $component eq "trans"; } }