From 3addea6e74a1f02b6e0a416bdb98b06c00e98e62 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 16 Jun 2010 15:54:18 +0300 Subject: Provide 'make unsigned_sis' target for Symbian mkspecs Rationale for this is that currently there is no simple way to create a sis package that can be properly signed via Symbian open signed mechanism, as 'make sis' will by default use self-signed certificates and automatically patch capabilities of binaries to remove non-self-signable ones. Task-number: QTBUG-11455 Reviewed-by: Janne Koskinen --- bin/createpackage.pl | 33 +++++++++++++++++++++++++++------ bin/patch_capabilities.pl | 3 ++- 2 files changed, 29 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/createpackage.pl b/bin/createpackage.pl index 939c38e136..8b787cb2ee 100755 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -78,6 +78,7 @@ Where supported options are as follows: as a comments. Also empty lines are ignored. The paths in can be absolute or relative to . [-u|unsigned] = Preserves the unsigned package. + [-o|only-unsigned] = Creates only unsigned package. [-s|stub] = Generates stub sis for ROM. [-n|sisname ] = Specifies the final sis name. Where parameters are as follows: @@ -121,11 +122,13 @@ my $certfile = ""; my $preserveUnsigned = ""; my $stub = ""; my $signed_sis_name = ""; +my $onlyUnsigned = ""; unless (GetOptions('i|install' => \$install, 'p|preprocess' => \$preprocessonly, 'c|certfile=s' => \$certfile, 'u|unsigned' => \$preserveUnsigned, + 'o|only-unsigned' => \$onlyUnsigned, 's|stub' => \$stub, 'n|sisname=s' => \$signed_sis_name,)) { Usage(); @@ -292,7 +295,10 @@ if($stub) { # Create stub SIS. system ("makesis -s $pkgoutput $stub_sis_name"); } else { - if ($certtext eq "Self Signed" && !@certificates && $templatepkg !~ m/_installer\.pkg$/i) { + if ($certtext eq "Self Signed" + && !@certificates + && $templatepkg !~ m/_installer\.pkg$/i + && !$onlyUnsigned) { print("Auto-patching capabilities for self signed package.\n"); system ("patch_capabilities $pkgoutput"); } @@ -302,6 +308,25 @@ if($stub) { system ("makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed"); print("\n"); + my $targetInsert = ""; + if ($targetplatform ne "-") { + $targetInsert = " for $targetplatform"; + } + + if ($onlyUnsigned) { + stat($unsigned_sis_name); + if( -e _ ) { + print ("Successfully created unsigned package ${unsigned_sis_name}${targetInsert}!\n"); + } else { + print ("\nUnsigned package creation failed!\n"); + } + + if (!$preservePkgOutput) { + unlink $pkgoutput; + } + exit; + } + # Sign SIS with certificate info given as an argument. my $relcert = File::Spec->abs2rel($certificate); my $relkey = File::Spec->abs2rel($key); @@ -311,11 +336,7 @@ if($stub) { # Check if creating signed SIS Succeeded stat($signed_sis_name); if( -e _ ) { - my $targetInsert = ""; - if ($targetplatform ne "-") { - $targetInsert = "for $targetplatform "; - } - print ("Successfully created $signed_sis_name ${targetInsert}using certificate: $certtext!\n"); + print ("Successfully created signed package ${signed_sis_name}${targetInsert} using certificate: $certtext!\n"); # Sign with additional certificates & keys for my $row ( @certificates ) { diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl index 9741bc3510..501939afc2 100755 --- a/bin/patch_capabilities.pl +++ b/bin/patch_capabilities.pl @@ -269,7 +269,8 @@ if (@ARGV) } print ("\n"); - print ("NOTE: A patched package should not be used for distribution!\n"); + print ("NOTE: A patched package may not work as expected due to reduced capabilities.\n"); + print (" Therefore it should not be used for any kind of Symbian signing or distribution!\n"); print ("\n"); } } -- cgit v1.2.3