sis/makeme.pl
changeset 0 671dee74050a
child 7 a5fbfefd615f
equal deleted inserted replaced
-1:000000000000 0:671dee74050a
       
     1 #
       
     2 # Copyright (c) 2009 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 
       
    17 if (!$ARGV[0]) {
       
    18 	printf("ERROR: Target (udeb/urel) needs to be specified.\n"); 
       
    19 	printf("Use either 'makeme udeb' or 'makeme urel'\n"); 
       
    20 	exit(0); 
       
    21 }
       
    22 
       
    23 if (!$ARGV[1]) {
       
    24 	printf("ERROR: EPOCROOT needs to be specified as a second parameter.\n"); 
       
    25 	exit(0); 
       
    26 }
       
    27 
       
    28 
       
    29 print "Creating package file...\n";
       
    30 open(SOURCE, "<CPiXSearch.pkg.source"); 
       
    31 open(TARGET, ">CPiXSearch.pkg"); 
       
    32 
       
    33 $version = `svnversion`; 
       
    34 $version =~ s/\d+://;
       
    35 $version =~ s/M//;
       
    36 
       
    37 $target = $ARGV[0];
       
    38 $epocroot = $ARGV[1];
       
    39 
       
    40 
       
    41 while ($line = <SOURCE>) {
       
    42 	$line =~ s/\$\(SVN\)/$version/;
       
    43 	$line =~ s/\$\(TARGET\)/$target/; 
       
    44 	$line =~ s/\$\(EPOCROOT\)/$epocroot/; 
       
    45 	print TARGET $line;
       
    46 }
       
    47 close(TARGET); 
       
    48 close(SOURCE); 
       
    49 print "DONE.\n";