summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2010-02-04 15:08:44 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2010-02-04 16:52:30 +0200
commit9cc4ae77a73bd28ff495f36f26dd87c78b76b976 (patch)
tree4419fec06b6722016f4fcf7912a1b65df8b7081e /bin
parent91e236022acd79dfbc4aef9e30edb4d1aeb2685c (diff)
Added support for smart installer package generation in Symbian
Smart installer packages bundle normal application sis with a bootstrap package that will download a smart installer when the package is installed. Smart installer in turn will download any dependencies of the application that are available on remote server, such as Open C, Qt, and QtWebkit packages, and install them Smart installer packages are generated when DEPLOYMENT.installer_header variable is defined in applicatoin .pro file. This commit is still missing properly signed bootstrap.sis package. Task-number: QTBUG-7908 Reviewed-by: Shane Kearns
Diffstat (limited to 'bin')
-rwxr-xr-xbin/createpackage.pl64
1 files changed, 44 insertions, 20 deletions
diff --git a/bin/createpackage.pl b/bin/createpackage.pl
index 197dffef89..460df31e0d 100755
--- a/bin/createpackage.pl
+++ b/bin/createpackage.pl
@@ -64,7 +64,7 @@ sub Usage() {
==============================================================================================
Convenience script for creating signed packages you can install on your phone.
-Usage: createpackage.pl [options] templatepkg target-platform [certificate key [passphrase]]
+Usage: createpackage.pl [options] templatepkg [target]-[platform] [certificate key [passphrase]]
Where supported optiobns are as follows:
[-i|install] = Install the package right away using PC suite
@@ -72,9 +72,10 @@ Where supported optiobns are as follows:
[-c|certfile=<file>] = The file containing certificate information for signing.
The file can have several certificates, each specified in
separate line. The certificate, key and passphrase in line
- must be ';' separated. Lines starting with '#' are treated
- as a comments. Also empty lines are ignored. The paths in
+ must be ';' separated. Lines starting with '#' are treated
+ as a comments. Also empty lines are ignored. The paths in
<file> can be absolute or relative to <file>.
+ [-u|unsigned] = Preserves the unsigned package
Where parameters are as follows:
templatepkg = Name of .pkg file template
target = Either debug or release
@@ -86,10 +87,10 @@ Where parameters are as follows:
Example:
createpackage.pl fluidlauncher_template.pkg release-armv5
-
+
Example with certfile:
createpackage.pl -c=mycerts.txt fluidlauncher_template.pkg release-armv5
-
+
Content of 'mycerts.txt' must be something like this:
# This is comment line, also the empty lines are ignored
rd.cer;rd-key.pem
@@ -109,8 +110,12 @@ ENDUSAGESTRING
my $install = "";
my $preprocessonly = "";
my $certfile = "";
+my $preserveUnsigned = "";
-unless (GetOptions('i|install' => \$install, 'p|preprocess' => \$preprocessonly, 'c|certfile=s' => \$certfile)){
+unless (GetOptions('i|install' => \$install,
+ 'p|preprocess' => \$preprocessonly,
+ 'c|certfile=s' => \$certfile,
+ 'u|unsigned' => \$preserveUnsigned,)){
Usage();
}
@@ -134,7 +139,12 @@ my $passphrase = $ARGV[4];
# Generate output pkg basename (i.e. file name without extension)
my $pkgoutputbasename = $templatepkg;
-$pkgoutputbasename =~ s/_template\.pkg/_$targetplatform/g;
+my $preservePkgOutput = "";
+$pkgoutputbasename =~ s/_template/_$targetplatform/g;
+if ($pkgoutputbasename eq $templatepkg) {
+ $preservePkgOutput = "1";
+}
+$pkgoutputbasename =~ s/\.pkg//g;
$pkgoutputbasename = lc($pkgoutputbasename);
# Store output file names to variables
@@ -150,12 +160,20 @@ $certpath =~ s-^(.*[^\\])$-$1\\-o; # ensure path ends with a backslash
$certpath =~ s-/-\\-go; # for those working with UNIX shells
$certpath =~ s-bin\\$-src\\s60installs\\-; # certificates are one step up in hierarcy
-# Check some pre-conditions and print error messages if needed
-unless (length($templatepkg) && length($platform) && length($target)) {
- print "\nError: Template PKG filename, platform or target is not defined!\n";
+# Check some pre-conditions and print error messages if needed.
+unless (length($templatepkg)) {
+ print "\nError: Template PKG filename is not defined!\n";
Usage();
}
+# If the pkg file is not actually a template, there is no need for plaform or target.
+if ($templatepkg =~ m/_template\.pkg/i) {
+ unless (length($platform) && length($target)) {
+ print "\nError: Platform or target is not defined!\n";
+ Usage();
+ }
+}
+
# Check template exist
stat($templatepkg);
unless( -e _ ) {
@@ -192,18 +210,18 @@ if (length($certfile)) {
next if /^(\s)*$/; # skip blank lines
chomp; # remove trailing newline characters
my @certinfo = split(';', $_); # split row to certinfo
-
+
# Trim spaces
for(@certinfo) {
s/^\s+//;
s/\s+$//;
- }
-
+ }
+
# Do some validation
- unless(scalar(@certinfo) >= 2 && scalar(@certinfo) <= 3 && length($certinfo[0]) && length($certinfo[1]) ) {
+ unless(scalar(@certinfo) >= 2 && scalar(@certinfo) <= 3 && length($certinfo[0]) && length($certinfo[1]) ) {
print "\nError: $certfile line '$_' does not contain valid information!\n";
- Usage();
- }
+ Usage();
+ }
push @certificates, [@certinfo]; # push data to two dimensional array
}
@@ -212,7 +230,9 @@ if (length($certfile)) {
# Remove any existing .sis packages
unlink $unsigned_sis_name;
unlink $signed_sis_name;
-unlink $pkgoutput;
+if (!$preservePkgOutput) {
+ unlink $pkgoutput;
+}
# Preprocess PKG
local $/;
@@ -254,10 +274,14 @@ if( -e _ ) {
system ("signsis $signed_sis_name $signed_sis_name $abscert $abskey $row->[2]");
print ("\tAdditionally signed the SIS with certificate: $row->[0]!\n");
}
-
+
# remove temporary pkg and unsigned sis
- unlink $pkgoutput;
- unlink $unsigned_sis_name;
+ if (!$preservePkgOutput) {
+ unlink $pkgoutput;
+ }
+ if (!$preserveUnsigned) {
+ unlink $unsigned_sis_name;
+ }
# Install the sis if requested
if ($install) {