summaryrefslogtreecommitdiff
path: root/download.in
blob: 27fd6b2bfd05a889b9c57d339841a41b3bcf67d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/perl -w

sub webget($$)
{
    my ($src, $dest) = @_;

    print "Get $src -> $dest\n";
    system ("cd $dest ; $WGET $src") != 0 && die "Failed fetch";
}

sub usage {
    print STDERR "\ndownload\n";
    print STDERR "Syntax:	download    [--help] \n\n";
    print STDERR "  download's behavior is coded by your configure options eg.\n";
    print STDERR "  if you configure with --with-system-gcc it will not download\n";
    print STDERR "  gcc & binutils\n";
};

%SRC_URLS = (
    'binutils-2.13.2.1.tar.bz2'          => 'http://ooo.ximian.com/packages/support',
    'gcc-3.2.2.tar.bz2'                  => 'http://ooo.ximian.com/packages/support',
    'OOO_1_0_3.tar.bz2'                  => 'http://ooo.ximian.com/packages/OOO_1_0_3',
    'OOO_1_1_0.tar.bz2'                  => 'http://ooo.ximian.com/packages/OOO_1_1_0',
    'OOO_1_1_1.tar.bz2'                  => 'http://ooo.ximian.com/packages/OOO_1_1_1',
    'OOO_1_1_2.tar.bz2'                  => 'http://ooo.ximian.com/packages/OOO_1_1_2',
    'OOO_1_1_3.tar.bz2'                  => 'http://ooo.ximian.com/packages/OOO_1_1_3',
    'OOO_1_1_3_fix2.tar.bz2'             => 'http://ooo.ximian.com/packages/OOO_1_1_3',
    'libwpd-snap-20040823.tar.gz'	 => 'http://ooo.ximian.com/packages',
    'ooo-scaled-icons.tar.gz'            => 'http://ooo.ximian.com/packages',
    'ooo-icons-OOO_1_1-10.tar.gz'	 => 'http://ooo.ximian.com/packages',
    'ooo-KDE_icons-OOO_1_1-0.3.tar.gz'	 => 'http://kde.openoffice.org/files/documents/159/1975',
    'ooo-debug_icons-OOO_1_1-0.1.tar.gz' => 'http://kde.openoffice.org/files/documents/159/1786',
    'ooo-icons-bluecurve-OOO_1_1-9.tar.gz' => '',
# Win32 bits:
    'unicows.exe'			 => 'http://download.microsoft.com/download/b/7/5/b75eace3-00e2-4aa0-9a6f-0b6882c71642',
    # from http://www.microsoft.com/downloads/release.asp?releaseid=30682'
    'dbghinst.EXE'			 => 'http://download.microsoft.com/download/platformsdk/Redist/5.0.2195.1/W9XNT4/EN-US',
    '5_11_98Odma20.zip'			 => 'http://ooo.ximian.com/packages/support'
);

$WGET='/usr/bin/wget';

sub download_files($$)
{
    my ($files, $locations) = @_;

    for my $file ( @{$files} ) {
	if (-f "src/$file") {
	    print "Skipping $file\n";
	} else {
	    print "No file src/$file\n";
	    webget( $locations->{$file}."/$file", 'src' );
	}
    }
}

if (!-d "src") {
    `mkdir -p src`;
}

# Files to download
@files = ();

# Defaults
$tag = '@CVSTAG@';
if ('@SYSTEM_GCC@' ne '') {
    $support_files= 'none';
} else {
    $support_files = 'all';
}

while ($arg = shift @ARGV) {
    if ( $arg eq '--help' ) {
        &usage and exit(0);
    }
}

print "Downloading files for $tag\n";

-x $WGET || die "Can't find wget - install it and try again\n";

if ( $support_files eq 'all' ) {
    push @files, ( 'binutils-2.13.2.1.tar.bz2', 'gcc-3.2.2.tar.bz2' );
}

# Icons to use
foreach (split (" ",'@OOO_ICONS_VERS@')) {
    push @files, ( "$_.tar.gz" );
}

# Scaled icons for Win32
if ('@BUILD_WIN32@' ne '') {
    push @files, ( 'ooo-scaled-icons.tar.gz', 'unicows.exe', 'dbghinst.EXE' );
    # FIXME: it'd be nice to auto-install wdevenv
    # but ... it's a nightmare.
    push @files, ( '5_11_98Odma20.zip' );
}

push @files, "libwpd-snap-20040823.tar.gz";

push @files, ( "$tag.tar.bz2" );

download_files (\@files, \%SRC_URLS);


print "Done\n";