searchengine/cpix/tsrc/perfmetrics/packidxdbs.pl
changeset 0 671dee74050a
equal deleted inserted replaced
-1:000000000000 0:671dee74050a
       
     1 #
       
     2 # Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description: 
       
    15 #
       
    16 #!/usr/bin/perl -w
       
    17 
       
    18 # This Perl program
       
    19 #
       
    20 #  o parses a directory
       
    21 #  o creates a package definition file for whatever it finds there
       
    22 #  o creates the package
       
    23 #  o and signs it
       
    24 #
       
    25 # NOTE: this program does not take arguments, you must set the
       
    26 # variables below.
       
    27 
       
    28 
       
    29 ############################################
       
    30 #
       
    31 #   Configuration Variables
       
    32 #
       
    33 
       
    34 # Input directory (use path separator at the end)
       
    35 my $SrcDir = "m:/epoc32/winscw/c/Data/perfmetrics/000/";
       
    36 
       
    37 # package definition file path
       
    38 my $PkgDefFile = "idxdb.pkg";
       
    39 
       
    40 # destination installation directory (use path separator at the end)
       
    41 my $DstDir = "c:/Data/indexing/indexdb/file/";
       
    42 
       
    43 # Certificate to sign with
       
    44 my $CertificateFile = "m:/rd.crt";
       
    45 
       
    46 # Key to sign with
       
    47 my $KeyFile = "m:/rd.key";
       
    48 
       
    49 
       
    50 
       
    51 
       
    52 ############################################
       
    53 #
       
    54 #   Global Variables (don't touch)
       
    55 #
       
    56 
       
    57 # List of files to generate package for
       
    58 my @SrcFiles = ();
       
    59 
       
    60 
       
    61 ############################################
       
    62 #
       
    63 #   Body of program
       
    64 #
       
    65 
       
    66 
       
    67 # Lists (not recursively) file names from source directory ($srcDir)
       
    68 # to %srcFiles
       
    69 sub readSrcFiles()
       
    70 {
       
    71     local $globbedSrcDir = $SrcDir . "*";
       
    72     local @srcFiles = glob $globbedSrcDir;
       
    73     foreach $file (@srcFiles) {
       
    74         push @SrcFiles, substr($file, length($SrcDir))
       
    75     }
       
    76 
       
    77     foreach $file (@SrcFiles) {
       
    78         print "TODO ### $file\n";
       
    79     }
       
    80 }
       
    81 
       
    82 
       
    83 sub createPkgDefFile()
       
    84 {
       
    85     open(PKGDEF, ">$PkgDefFile") or die "Can't open $PkgDefFile for writing: $!\n";
       
    86 
       
    87     print PKGDEF <<EOS;
       
    88 ; Installation file for test corpus
       
    89 ;
       
    90 ; This is an auto-generated PKG file by Carbide.
       
    91 ; This file uses variables specific to Carbide builds that will not work
       
    92 ; on command-line builds. If you want to use this generated PKG file from the
       
    93 ; command-line tools you will need to modify the variables with the appropriate
       
    94 ; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
       
    95 ;
       
    96 ;Languages
       
    97 &EN
       
    98 
       
    99 ;
       
   100 ; UID is the app\'s UID
       
   101 ;
       
   102 #{"testcorpus"},(0xEC2D35B4),1,0,0
       
   103 
       
   104 ;Localised Vendor name
       
   105 %{"Vendor-EN"}
       
   106 
       
   107 ;Unique Vendor name
       
   108 :"Vendor"
       
   109 
       
   110 ; Supports Series 60 v 3.0
       
   111 [0x101F7961], 0, 0, 0, {"S60ProductID"}
       
   112 
       
   113 ; Files to install
       
   114 ; Symbols set up for the source location are Carbide.c++ specific symbols
       
   115 EOS
       
   116 
       
   117     foreach $file (@SrcFiles) {
       
   118         print PKGDEF "\"$SrcDir$file\"-\"$DstDir$file\"\n";
       
   119     }
       
   120 
       
   121     close(PKGDEF);
       
   122 }
       
   123 
       
   124 
       
   125 sub makeAndSignSis()
       
   126 {
       
   127     $sisFile = $PkgDefFile;
       
   128     $sisFile =~ s/.pkg/.sis/;
       
   129 
       
   130     system ("makesis", "$PkgDefFile", "$sisFile");
       
   131 
       
   132     $sisxFile = $PkgDefFile;
       
   133     $sisxFile =~ s/.pkg/.sisx/;
       
   134 
       
   135     system ("signsis", "-v", "$sisFile", "$sisxFile", "$CertificateFile", "$KeyFile");
       
   136 }
       
   137 
       
   138 ############################################
       
   139 #
       
   140 #   Main
       
   141 #
       
   142 readSrcFiles();
       
   143 createPkgDefFile();
       
   144 makeAndSignSis();
       
   145