bin/createpackage.pl
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
    79                                <file> can be absolute or relative to <file>.
    79                                <file> can be absolute or relative to <file>.
    80      [-u|unsigned]           = Preserves the unsigned package.
    80      [-u|unsigned]           = Preserves the unsigned package.
    81      [-o|only-unsigned]      = Creates only unsigned package.
    81      [-o|only-unsigned]      = Creates only unsigned package.
    82      [-s|stub]               = Generates stub sis for ROM.
    82      [-s|stub]               = Generates stub sis for ROM.
    83      [-n|sisname <name>]     = Specifies the final sis name.
    83      [-n|sisname <name>]     = Specifies the final sis name.
       
    84      [-g|gcce-is-armv5]      = Convert gcce platform to armv5.
    84 Where parameters are as follows:
    85 Where parameters are as follows:
    85      templatepkg             = Name of .pkg file template
    86      templatepkg             = Name of .pkg file template
    86      target                  = Either debug or release
    87      target                  = Either debug or release
    87      platform                = One of the supported platform
    88      platform                = One of the supported platform
    88                                winscw | gcce | armv5 | armv6 | armv7
    89                                winscw | gcce | armv5 | armv6 | armv7
       
    90                                Note that when packaging binaries built using gcce and symbian-sbsv2
       
    91                                mkspec, armv5 must be used for platform instead of gcce.
    89      certificate             = The certificate file used for signing
    92      certificate             = The certificate file used for signing
    90      key                     = The certificate's private key file
    93      key                     = The certificate's private key file
    91      passphrase              = The passphrase of the certificate's private key file
    94      passphrase              = The passphrase of the certificate's private key file
    92 
    95 
    93 Example:
    96 Example:
   121 my $certfile = "";
   124 my $certfile = "";
   122 my $preserveUnsigned = "";
   125 my $preserveUnsigned = "";
   123 my $stub = "";
   126 my $stub = "";
   124 my $signed_sis_name = "";
   127 my $signed_sis_name = "";
   125 my $onlyUnsigned = "";
   128 my $onlyUnsigned = "";
       
   129 my $convertGcce = "";
   126 
   130 
   127 unless (GetOptions('i|install' => \$install,
   131 unless (GetOptions('i|install' => \$install,
   128                    'p|preprocess' => \$preprocessonly,
   132                    'p|preprocess' => \$preprocessonly,
   129                    'c|certfile=s' => \$certfile,
   133                    'c|certfile=s' => \$certfile,
   130                    'u|unsigned' => \$preserveUnsigned,
   134                    'u|unsigned' => \$preserveUnsigned,
   131                    'o|only-unsigned' => \$onlyUnsigned,
   135                    'o|only-unsigned' => \$onlyUnsigned,
   132                    's|stub' => \$stub,
   136                    's|stub' => \$stub,
   133                    'n|sisname=s' => \$signed_sis_name,)) {
   137                    'n|sisname=s' => \$signed_sis_name,
       
   138                    'g|gcce-is-armv5' => \$convertGcce,)) {
   134     Usage();
   139     Usage();
   135 }
   140 }
   136 
   141 
   137 my $certfilepath = abs_path(dirname($certfile));
   142 my $certfilepath = abs_path(dirname($certfile));
   138 
   143 
   143 my @tmpvalues = split('-', $targetplatform);
   148 my @tmpvalues = split('-', $targetplatform);
   144 my $target;
   149 my $target;
   145 $target = $tmpvalues[0] or $target = "";
   150 $target = $tmpvalues[0] or $target = "";
   146 my $platform;
   151 my $platform;
   147 $platform = $tmpvalues[1] or $platform = "";
   152 $platform = $tmpvalues[1] or $platform = "";
       
   153 
       
   154 if ($platform =~ m/^gcce$/i) {
       
   155     if (($convertGcce ne "")) {
       
   156         $platform = "armv5";
       
   157     } elsif ($ENV{SBS_HOME}) {
       
   158         # Print a informative note in case suspected misuse is detected.
       
   159         print "\nNote: You should use armv5 as platform or specify -g parameter to convert platform\n";
       
   160         print "      when packaging gcce binaries built using symbian-sbsv2 mkspec.\n\n";
       
   161     }
       
   162 }
   148 
   163 
   149 # Convert visual target to real target (debug->udeb and release->urel)
   164 # Convert visual target to real target (debug->udeb and release->urel)
   150 $target =~ s/debug/udeb/i;
   165 $target =~ s/debug/udeb/i;
   151 $target =~ s/release/urel/i;
   166 $target =~ s/release/urel/i;
   152 
   167 
   298     if ($certtext eq "Self Signed"
   313     if ($certtext eq "Self Signed"
   299         && !@certificates
   314         && !@certificates
   300         && $templatepkg !~ m/_installer\.pkg$/i
   315         && $templatepkg !~ m/_installer\.pkg$/i
   301         && !$onlyUnsigned) {
   316         && !$onlyUnsigned) {
   302         print("Auto-patching capabilities for self signed package.\n");
   317         print("Auto-patching capabilities for self signed package.\n");
   303         system ("patch_capabilities $pkgoutput");
   318         my $patch_capabilities = File::Spec->catfile(dirname($0), "patch_capabilities");
       
   319         system ("$patch_capabilities $pkgoutput");
   304     }
   320     }
   305 
   321 
   306     # Create SIS.
   322     # Create SIS.
   307     # The 'and' is because system uses 0 to indicate success.
   323     # The 'and' is because system uses 0 to indicate success.
   308     system ("makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed");
   324     system ("makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed");