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
22 my $S90SDK = $ENV{S90SDK}; # from sdk.pl
24 my $UREL = $ENV{UREL}; # from sdk.pl
25 $UREL =~ s/-ARM-/$ARM/;
27 my $app = '!:\System\Apps\Perl';
28 my $lib = '!:\System\Libs';
34 "perl${VERSION}dll", "perl${VERSION}lib",
39 @suffix{ "miniperl", "perl", "perl$VERSION" } = ( "exe", "exe", "dll", );
41 for my $target (@target) {
42 $target = "perl${VERSION}" if $target eq "perl${VERSION}dll";
45 my $pkg = "$target.pkg";
46 print "\nCreating $pkg...\n";
48 my $suffix = $suffix{$target} || "";
49 my $dst = $suffix eq "dll" ? $lib : $app;
51 my $srctarget = "$UREL\\$target.$suffix";
53 if ( $target =~ /^(miniperl|perl|perl${VERSION}(?:dll)?)$/ ) {
54 $copy{$srctarget} = "$dst\\$target.$suffix";
55 print "\t$target.$suffix\n";
57 if ( $target eq "perl${VERSION}lib" ) {
58 print "Libraries...\n";
60 print "\tConfig.pm\n";
61 $copy{"lib\\Config.pm"} =
62 "$lib\\Perl\\$R_V_SV\\thumb-symbian\\Config.pm";
64 print "\tConfig_heavy.pl\n";
65 $copy{"xlib\\symbian\\Config_heavy.pl"} =
66 "$lib\\Perl\\$R_V_SV\\thumb-symbian\\Config_heavy.pl";
68 print "\tDynaLoader.pm\n";
69 $copy{"ext\\DynaLoader\\DynaLoader.pm"} =
70 "$lib\\Perl\\$R_V_SV\\DynaLoader.pm";
73 $copy{"ext\\Errno\\Errno.pm"} = "$lib\\Perl\\$R_V_SV\\Errno.pm";
75 open( my $cfg, "symbian/install.cfg" )
76 or die "$!: symbian/install.cfg: $!\n";
78 next unless /^lib\s+(.+)/;
81 unless (-f "lib/$f") {
82 warn qq[$0: No "lib/$f", skipping...\n];
86 $copy{"lib\\$f"} = "$lib\\Perl\\$R_V_SV\\$f";
92 if ( $target eq "perl${VERSION}ext" ) {
93 my @lst = glob("symbian/*.lst");
94 print "Extensions...\n";
95 print "\t(none found)\n" unless @lst;
97 $lst =~ m:^symbian/(.+)\.:;
101 if ( open( my $pkg, $lst ) ) {
103 if (m!^"(.+)"-"(.+)"$!) {
104 my ( $src, $dst ) = ( $1, $2 );
108 warn "$0: $lst: $.: unknown syntax\n";
114 warn "$0: $lst: $!\n";
119 for my $file ( keys %copy ) {
120 warn "$0: $file does not exist\n" unless -f $file;
123 my @copy = map { qq["$_"-"$copy{$_}"] } sort keys %copy;
124 my $copy = join( "\n", @copy );
129 "perl${VERSION}" => $UID + 0,
130 "perl${VERSION}dll" => $UID + 0,
131 "perl${VERSION}ext" => $UID + 1,
132 "perl${VERSION}lib" => $UID + 2,
133 "perlapp" => $UID + 3,
134 "perlrecog" => $UID + 4,
135 "perlappmin" => $UID + 5,
138 die "$0: target has no UID\n" unless defined $UID{$target};
140 my $uid = sprintf( "0x%08X", $UID{$target} );
142 my ( $MAJOR, $MINOR, $PATCH ) = ( 0, 0, 0 );
144 if ( $target =~ m:^perl$VERSION(dll|ext|lib)?$: ) {
145 my $pkg = defined $1 ? $1 : "dll";
146 $MAJOR = $PORT{$pkg}->{MAJOR};
147 $MINOR = $PORT{$pkg}->{MINOR};
148 $PATCH = $PORT{$pkg}->{PATCH};
151 die "$0: Bad version for $target\n"
152 unless defined $MAJOR
153 && ( $MAJOR eq 0 || $MAJOR > 0 )
155 && ( $MINOR eq 0 || $MINOR > 0 )
157 && ( $PATCH eq 0 || $PATCH > 0 );
161 qq[;Supports Series 60 v0.9\n(0x101F6F88), 0, 0, 0, {"Series60ProductID"}\n] :
163 qq[;Supports Series 80 v2.0\n(0x101F8ED2), 0, 0, 0, {"Series80ProductID"}\n] :
165 qq[;Supports Series 90 v1.1\n(0x101FBE05), 0, 0, 0, {"Series90ProductID"}\n] :
166 ";Supports Series NN";
168 open PKG, ">$pkg" or die "$0: failed to create $pkg: $!\n";
170 ; \u$target installation script
172 ; The supported languages
175 ; The installation name and header data
177 #{"\u$target"},($uid),$MAJOR,$MINOR,$PATCH
179 ; Private key and certificate (unused)
181 ;* "\u$target.key", "\u$target.cer"
184 ; The files to install
190 print "Created $pkg\n";
192 print "Running makesis...\n";
194 unlink("$target.sis");
196 system("makesis $pkg") == 0
197 || die "$0: makesis $pkg failed: $!\n";