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 $SDK = do "sdk.pl";
15 my $UID = do "uid.pl";
16 my %PORT = %{ do "port.pl" };
18 my $ARM = 'thumb'; # TODO
19 my $S60SK = $ENV{S60SDK}; # from sdk.pl
21 my $UREL = $ENV{UREL}; # from sdk.pl
22 $UREL =~ s/-ARM-/$ARM/;
24 my $app = '!:\System\Apps\Perl';
25 my $lib = '!:\System\Libs';
31 "perl${VERSION}dll", "perl${VERSION}lib",
36 @suffix{ "miniperl", "perl", "perl$VERSION" } = ( "exe", "exe", "dll", );
38 for my $target (@target) {
39 $target = "perl${VERSION}" if $target eq "perl${VERSION}dll";
42 my $pkg = "$target.pkg";
43 print "\nCreating $pkg...\n";
45 my $suffix = $suffix{$target} || "";
46 my $dst = $suffix eq "dll" ? $lib : $app;
48 my $srctarget = "$UREL\\$target.$suffix";
50 if ( $target =~ /^(miniperl|perl|perl${VERSION}(?:dll)?)$/ ) {
51 $copy{$srctarget} = "$dst\\$target.$suffix";
52 print "\t$target.$suffix\n";
54 if ( $target eq "perl${VERSION}lib" ) {
55 print "Libraries...\n";
57 print "\tConfig.pm\n";
58 $copy{"lib\\Config.pm"} =
59 "$lib\\Perl\\$R_V_SV\\thumb-symbian\\Config.pm";
61 print "\tConfig_heavy.pl\n";
62 $copy{"xlib\\symbian\\Config_heavy.pl"} =
63 "$lib\\Perl\\$R_V_SV\\thumb-symbian\\Config_heavy.pl";
65 print "\tDynaLoader.pm\n";
66 $copy{"ext\\DynaLoader\\DynaLoader.pm"} =
67 "$lib\\Perl\\$R_V_SV\\DynaLoader.pm";
70 $copy{"ext\\Errno\\Errno.pm"} = "$lib\\Perl\\$R_V_SV\\Errno.pm";
72 open( my $cfg, "symbian/install.cfg" )
73 or die "$!: symbian/install.cfg: $!\n";
75 next unless /^lib\s+(.+)/;
79 $copy{"lib\\$f"} = "$lib\\Perl\\$R_V_SV\\$f";
85 if ( $target eq "perl${VERSION}ext" ) {
86 my @lst = glob("symbian/*.lst");
87 print "Extensions...\n";
88 print "\t(none found)\n" unless @lst;
90 $lst =~ m:^symbian/(.+)\.:;
94 if ( open( my $pkg, $lst ) ) {
96 if (m!^"(.+)"-"(.+)"$!) {
97 my ( $src, $dst ) = ( $1, $2 );
101 warn "$0: $lst: $.: unknown syntax\n";
107 warn "$0: $lst: $!\n";
112 for my $file ( keys %copy ) {
113 warn "$0: $file does not exist\n" unless -f $file;
116 my @copy = map { qq["$_"-"$copy{$_}"] } sort keys %copy;
117 my $copy = join( "\n", @copy );
122 "perl${VERSION}" => $UID + 0,
123 "perl${VERSION}dll" => $UID + 0,
124 "perl${VERSION}ext" => $UID + 1,
125 "perl${VERSION}lib" => $UID + 2,
131 die "$0: target has no UID\n" unless defined $UID{$target};
133 my $uid = sprintf( "0x%08X", $UID{$target} );
135 my ( $MAJOR, $MINOR, $PATCH ) = ( 0, 0, 0 );
137 if ( $target =~ m:^perl$VERSION(dll|ext|lib)?$: ) {
138 my $pkg = defined $1 ? $1 : "dll";
139 $MAJOR = $PORT{$pkg}->{MAJOR};
140 $MINOR = $PORT{$pkg}->{MINOR};
141 $PATCH = $PORT{$pkg}->{PATCH};
144 die "$0: Bad version for $target\n"
145 unless defined $MAJOR
146 && ( $MAJOR eq 0 || $MAJOR > 0 )
148 && ( $MINOR eq 0 || $MINOR > 0 )
150 && ( $PATCH eq 0 || $PATCH > 0 );
152 open PKG, ">$pkg" or die "$0: failed to create $pkg: $!\n";
154 ; \u$target installation script
156 ; The supported languages
159 ; The installation name and header data
161 #{"\u$target"},($uid),$MAJOR,$MINOR,$PATCH
163 ; Private key and certificate (unused)
165 ;* "\u$target.key", "\u$target.cer"
167 ; Supports Series60 v0.9
168 (0x101F6F88), 0, 0, 0, {"Series60ProductID"}
169 ; The files to install
175 print "Created $pkg\n";
177 print "Running makesis...\n";
179 unlink("$target.sis");
181 system("makesis $pkg") == 0
182 || die "$0: makesis $pkg failed: $!\n";