new mode-line Fix not showing when minibuffer is active
[dotfiles.git] / bin / update_cpve.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 use Getopt::Std;
6
7 my %options = ();
8 getopts("n", \%options);
9 print "-n $options{n}\n" if defined $options{n};
10
11 my $ip = (split / /, `ifconfig | grep "inet .*broadcast"`)[1];
12
13 my $cpve_dir = '/Users/peli3-imac/CPVE/cpve_trunk/';
14 my $ecc_dir = '/Users/peli3-imac/JCC/ecc-p2p-mac/';
15
16 my $ecc_mac_libs = "$ecc_dir/contrib/cpve/lib/darwin/x86_64";
17 my $cpve_mac_libs = "$cpve_dir/target/dist/lib/darwin/x86_64";
18
19
20 #### 
21 if($options{n})
22 {
23     print "==== don't build CPVE ======\n";
24 }
25 else 
26 {    
27     ## building CPVE
28     chdir $cpve_dir or die ": $!";
29     !system "scons arch=x86_64 platform=darwin debug=True -j16 osxversion=10.10"    or die "building CPVE failed : $!";
30
31     ## remove old cpve libs and replace in ECC
32 #    !system "rm -rf $ecc_dir/contrib/cpve/lib/darwin/x86_64/*"     or die "remove libs failed : $!";
33     !system "rm -rf $ecc_mac_libs/*"     or die "remove libs failed : $!";
34
35     mkdir $ecc_mac_libs unless -e $ecc_mac_libs;
36
37     !system "/bin/cp -r $cpve_mac_libs/* $ecc_mac_libs/"     or die "copy libs failed: $!";
38
39 }
40
41 #### building ecc
42 chdir $ecc_dir or die ": $!";
43 !system "rm $ecc_dir/contrib/cpve/SConstruct" or die "$!" if -e "$ecc_dir/contrib/cpve/SConstruct";
44 !system "python runSconsBuild.py JabberMac64Bit  -j 16  -t no --early_cpve --nofetch"     or die " building ECC failed : $!";
45
46 print "copy bin-s bin-c\n";
47 !system "rm -rf bin-s/* bin-c/*" or die "$!";
48 !system "/bin/cp -r $ecc_dir/out/bin/* $ecc_dir/bin-c" or die "$!";
49 !system "/bin/cp -r $ecc_dir/out/bin/* $ecc_dir/bin-s" or die "$!";
50
51 print "copy config files\n";
52 !system "/bin/cp $ecc_dir/sss.txt  $ecc_dir/bin-s/cucm-credentials.txt" or die ": $!";
53 !system "/bin/cp $ecc_dir/ccc.txt  $ecc_dir/bin-c/cucm-credentials.txt" or die ": $!";
54
55 print "add p2p server ip\n";
56 open CONF, ">>", "$ecc_dir/bin-c/cucm-credentials.txt" or  die "error $!";
57 print CONF "P2P_SERVER_IP=" . $ip . "\n";
58 close CONF;
59
60
61 print "####### DONE #######\n";