Changeset 651 for trunk/bin/createpackage.pl
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/bin/createpackage.pl
r561 r651 2 2 ############################################################################# 3 3 ## 4 ## Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).4 ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 5 5 ## All rights reserved. 6 6 ## Contact: Nokia Corporation (qt-info@nokia.com) … … 65 65 Convenience script for creating signed packages you can install on your phone. 66 66 67 Usage: createpackage.pl [options] templatepkg target-platform[certificate key [passphrase]]67 Usage: createpackage.pl [options] templatepkg [target]-[platform] [certificate key [passphrase]] 68 68 69 69 Where supported optiobns are as follows: … … 73 73 The file can have several certificates, each specified in 74 74 separate line. The certificate, key and passphrase in line 75 must be ';' separated. Lines starting with '#' are treated 76 as a comments. Also empty lines are ignored. The paths in 75 must be ';' separated. Lines starting with '#' are treated 76 as a comments. Also empty lines are ignored. The paths in 77 77 <file> can be absolute or relative to <file>. 78 [-u|unsigned] = Preserves the unsigned package 78 79 Where parameters are as follows: 79 80 templatepkg = Name of .pkg file template … … 87 88 Example: 88 89 createpackage.pl fluidlauncher_template.pkg release-armv5 89 90 90 91 Example with certfile: 91 92 createpackage.pl -c=mycerts.txt fluidlauncher_template.pkg release-armv5 92 93 93 94 Content of 'mycerts.txt' must be something like this: 94 95 # This is comment line, also the empty lines are ignored 95 96 rd.cer;rd-key.pem 96 97 .\\cert\\mycert.cer;.\\cert\\mykey.key;yourpassword 97 X:\\QtS60\\s elfsigned.cer;X:\\QtS60\\selfsigned.key98 X:\\QtS60\\s60installs\\selfsigned.cer;X:\\QtS60\\s60installs\\selfsigned.key 98 99 99 100 If no certificate and key files are provided, either a RnD certificate or 100 a self-signed certificate from Qt installation rootdirectory is used.101 a self-signed certificate from QtDir\\src\\s60installs directory is used. 101 102 ============================================================================================== 102 103 … … 110 111 my $preprocessonly = ""; 111 112 my $certfile = ""; 112 113 unless (GetOptions('i|install' => \$install, 'p|preprocess' => \$preprocessonly, 'c|certfile=s' => \$certfile)){ 113 my $preserveUnsigned = ""; 114 115 unless (GetOptions('i|install' => \$install, 116 'p|preprocess' => \$preprocessonly, 117 'c|certfile=s' => \$certfile, 118 'u|unsigned' => \$preserveUnsigned,)){ 114 119 Usage(); 115 120 } … … 135 140 # Generate output pkg basename (i.e. file name without extension) 136 141 my $pkgoutputbasename = $templatepkg; 137 $pkgoutputbasename =~ s/_template\.pkg/_$targetplatform/g; 142 my $preservePkgOutput = ""; 143 $pkgoutputbasename =~ s/_template/_$targetplatform/g; 144 if ($pkgoutputbasename eq $templatepkg) { 145 $preservePkgOutput = "1"; 146 } 147 $pkgoutputbasename =~ s/\.pkg//g; 138 148 $pkgoutputbasename = lc($pkgoutputbasename); 139 149 140 150 # Store output file names to variables 141 151 my $pkgoutput = lc($pkgoutputbasename.".pkg"); 142 my $unsigned_sis_name = $pkgoutputbasename."_unsigned.sis"; 143 my $signed_sis_name = $pkgoutputbasename.".sis"; 152 my $sisoutputbasename = lc($pkgoutputbasename); 153 $sisoutputbasename =~ s/_$targetplatform//g; 154 my $unsigned_sis_name = $sisoutputbasename."_unsigned.sis"; 155 my $signed_sis_name = $sisoutputbasename.".sis"; 144 156 145 157 # Store some utility variables … … 151 163 $certpath =~ s-bin\\$-src\\s60installs\\-; # certificates are one step up in hierarcy 152 164 153 # Check some pre-conditions and print error messages if needed 154 unless (length($templatepkg) && length($platform) && length($target)) {155 print "\nError: Template PKG filename , platform or targetis not defined!\n";165 # Check some pre-conditions and print error messages if needed. 166 unless (length($templatepkg)) { 167 print "\nError: Template PKG filename is not defined!\n"; 156 168 Usage(); 169 } 170 171 # If the pkg file is not actually a template, there is no need for plaform or target. 172 if ($templatepkg =~ m/_template\.pkg/i) { 173 unless (length($platform) && length($target)) { 174 print "\nError: Platform or target is not defined!\n"; 175 Usage(); 176 } 157 177 } 158 178 … … 193 213 chomp; # remove trailing newline characters 194 214 my @certinfo = split(';', $_); # split row to certinfo 195 215 196 216 # Trim spaces 197 217 for(@certinfo) { 198 218 s/^\s+//; 199 219 s/\s+$//; 200 } 201 220 } 221 202 222 # Do some validation 203 unless(scalar(@certinfo) >= 2 && scalar(@certinfo) <= 3 && length($certinfo[0]) && length($certinfo[1]) ) { 223 unless(scalar(@certinfo) >= 2 && scalar(@certinfo) <= 3 && length($certinfo[0]) && length($certinfo[1]) ) { 204 224 print "\nError: $certfile line '$_' does not contain valid information!\n"; 205 Usage(); 206 } 225 Usage(); 226 } 207 227 208 228 push @certificates, [@certinfo]; # push data to two dimensional array … … 213 233 unlink $unsigned_sis_name; 214 234 unlink $signed_sis_name; 215 unlink $pkgoutput; 235 if (!$preservePkgOutput) { 236 unlink $pkgoutput; 237 } 216 238 217 239 # Preprocess PKG … … 244 266 stat($signed_sis_name); 245 267 if( -e _ ) { 246 print ("\nSuccessfully created $signed_sis_name using certificate: $certtext!\n"); 268 my $targetInsert = ""; 269 if ($targetplatform ne "-") { 270 $targetInsert = "for $targetplatform "; 271 } 272 print ("\nSuccessfully created $signed_sis_name ${targetInsert}using certificate: $certtext!\n"); 247 273 248 274 # Sign with additional certificates & keys … … 255 281 print ("\tAdditionally signed the SIS with certificate: $row->[0]!\n"); 256 282 } 257 283 258 284 # remove temporary pkg and unsigned sis 259 unlink $pkgoutput; 260 unlink $unsigned_sis_name; 285 if (!$preservePkgOutput) { 286 unlink $pkgoutput; 287 } 288 if (!$preserveUnsigned) { 289 unlink $unsigned_sis_name; 290 } 261 291 262 292 # Install the sis if requested
Note:
See TracChangeset
for help on using the changeset viewer.