3 # Copyright (c) 2004-2005 Nokia. All rights reserved.
10 my %VERSION = %{ do "version.pl" };
11 my $VERSION = "$VERSION{REVISION}$VERSION{VERSION}$VERSION{SUBVERSION}";
12 my $R_V_SV = "$VERSION{REVISION}.$VERSION{VERSION}.$VERSION{SUBVERSION}";
14 my ($SYMBIAN_ROOT, $SYMBIAN_VERSION, $SDK_NAME, $SDK_VARIANT, $SDK_VERSION) =
16 my $UID = do "uid.pl";
17 my %PORT = %{ do "port.pl" };
19 my $ARM = 'thumb'; # TODO
20 my $S60SDK = $ENV{S60SDK}; # from sdk.pl
21 my $S80SDK = $ENV{S80SDK}; # from sdk.pl
23 my $UREL = $ENV{UREL}; # from sdk.pl
24 $UREL =~ s/-ARM-/$ARM/;
26 my $app = '!:\System\Apps\Perl';
27 my $lib = '!:\System\Libs';
33 "perl${VERSION}dll", "perl${VERSION}lib",
38 @suffix{ "miniperl", "perl", "perl$VERSION" } = ( "exe", "exe", "dll", );
40 for my $target (@target) {
41 $target = "perl${VERSION}" if $target eq "perl${VERSION}dll";
44 my $pkg = "$target.pkg";
45 print "\nCreating $pkg...\n";
47 my $suffix = $suffix{$target} || "";
48 my $dst = $suffix eq "dll" ? $lib : $app;
50 my $srctarget = "$UREL\\$target.$suffix";
52 if ( $target =~ /^(miniperl|perl|perl${VERSION}(?:dll)?)$/ ) {
53 $copy{$srctarget} = "$dst\\$target.$suffix";
54 print "\t$target.$suffix\n";
56 if ( $target eq "perl${VERSION}lib" ) {
57 print "Libraries...\n";
59 print "\tConfig.pm\n";
60 $copy{"lib\\Config.pm"} =
61 "$lib\\Perl\\$R_V_SV\\thumb-symbian\\Config.pm";
63 print "\tConfig_heavy.pl\n";
64 $copy{"xlib\\symbian\\Config_heavy.pl"} =
65 "$lib\\Perl\\$R_V_SV\\thumb-symbian\\Config_heavy.pl";
67 print "\tDynaLoader.pm\n";
68 $copy{"ext\\DynaLoader\\DynaLoader.pm"} =
69 "$lib\\Perl\\$R_V_SV\\DynaLoader.pm";
72 $copy{"ext\\Errno\\Errno.pm"} = "$lib\\Perl\\$R_V_SV\\Errno.pm";
74 open( my $cfg, "symbian/install.cfg" )
75 or die "$!: symbian/install.cfg: $!\n";
77 next unless /^lib\s+(.+)/;
80 unless (-f "lib/$f") {
81 warn qq[$0: No "lib/$f", skipping...\n];
85 $copy{"lib\\$f"} = "$lib\\Perl\\$R_V_SV\\$f";
91 if ( $target eq "perl${VERSION}ext" ) {
92 my @lst = glob("symbian/*.lst");
93 print "Extensions...\n";
94 print "\t(none found)\n" unless @lst;
96 $lst =~ m:^symbian/(.+)\.:;
100 if ( open( my $pkg, $lst ) ) {
102 if (m!^"(.+)"-"(.+)"$!) {
103 my ( $src, $dst ) = ( $1, $2 );
107 warn "$0: $lst: $.: unknown syntax\n";
113 warn "$0: $lst: $!\n";
118 for my $file ( keys %copy ) {
119 warn "$0: $file does not exist\n" unless -f $file;
122 my @copy = map { qq["$_"-"$copy{$_}"] } sort keys %copy;
123 my $copy = join( "\n", @copy );
128 "perl${VERSION}" => $UID + 0,
129 "perl${VERSION}dll" => $UID + 0,
130 "perl${VERSION}ext" => $UID + 1,
131 "perl${VERSION}lib" => $UID + 2,
137 die "$0: target has no UID\n" unless defined $UID{$target};
139 my $uid = sprintf( "0x%08X", $UID{$target} );
141 my ( $MAJOR, $MINOR, $PATCH ) = ( 0, 0, 0 );
143 if ( $target =~ m:^perl$VERSION(dll|ext|lib)?$: ) {
144 my $pkg = defined $1 ? $1 : "dll";
145 $MAJOR = $PORT{$pkg}->{MAJOR};
146 $MINOR = $PORT{$pkg}->{MINOR};
147 $PATCH = $PORT{$pkg}->{PATCH};
150 die "$0: Bad version for $target\n"
151 unless defined $MAJOR
152 && ( $MAJOR eq 0 || $MAJOR > 0 )
154 && ( $MINOR eq 0 || $MINOR > 0 )
156 && ( $PATCH eq 0 || $PATCH > 0 );
160 qq[;Supports Series 60 v0.9\n(0x101F6F88), 0, 0, 0, {"Series60ProductID"}\n] :
162 qq[;Supports Series 80 v2.0\n(0x101F8ED2), 0, 0, 0, {"Series80ProductID"}\n] :
163 ";Supports Series NN";
165 open PKG, ">$pkg" or die "$0: failed to create $pkg: $!\n";
167 ; \u$target installation script
169 ; The supported languages
172 ; The installation name and header data
174 #{"\u$target"},($uid),$MAJOR,$MINOR,$PATCH
176 ; Private key and certificate (unused)
178 ;* "\u$target.key", "\u$target.cer"
181 ; The files to install
187 print "Created $pkg\n";
189 print "Running makesis...\n";
191 unlink("$target.sis");
193 system("makesis $pkg") == 0
194 || die "$0: makesis $pkg failed: $!\n";