my $ip = (split / /, `ifconfig | grep "inet .*broadcast"`)[1];
+my $cpve_dir = '/Users/peli3-imac/CPVE/cpve_trunk/';
+my $ecc_dir = '/Users/peli3-imac/JCC/ecc-p2p-mac/';
+
+my $ecc_mac_libs = "$ecc_dir/contrib/cpve/lib/darwin/x86_64";
+my $cpve_mac_libs = "$cpve_dir/target/dist/lib/darwin/x86_64";
+
+
+####
if($options{n})
{
print "==== don't build CPVE ======\n";
}
else
{
- print "building cpve\n";
- chdir '/Users/peli3/CPVE/cpve_trunk' or die ": $!";
+ ## building CPVE
+ chdir $cpve_dir or die ": $!";
!system "scons arch=x86_64 platform=darwin debug=True -j16 osxversion=10.10" or die "building CPVE failed : $!";
- chdir '/Users/peli3/JCC/ecc-p2p' or die ": $!";
- print "remove cpve libs\n";
- !system "rm -rf ./contrib/cpve/lib/darwin/x86_64/*" or die "remove libs failed : $!";
+ ## remove old cpve libs and replace in ECC
+# !system "rm -rf $ecc_dir/contrib/cpve/lib/darwin/x86_64/*" or die "remove libs failed : $!";
+ !system "rm -rf $ecc_mac_libs/*" or die "remove libs failed : $!";
- print "copy cpve libs\n";
- !system "/bin/cp -r /Users/peli3/CPVE/cpve_trunk/target/dist/lib/darwin/x86_64/* ./contrib/cpve/lib/darwin/x86_64/" or die "copy libs failed: $!";
+ mkdir $ecc_mac_libs unless -e $ecc_mac_libs;
+
+ !system "/bin/cp -r $cpve_mac_libs/* $ecc_mac_libs/" or die "copy libs failed: $!";
}
-print "building ecc\n";
-!system "python runSconsBuild.py JabberMac64Bit -j 16 -t no --early_cpve" or die " building ECC failed : $!";
+#### building ecc
+chdir $ecc_dir or die ": $!";
+!system "rm $ecc_dir/contrib/cpve/SConstruct" or die "$!" if -e "$ecc_dir/contrib/cpve/SConstruct";
+!system "python runSconsBuild.py JabberMac64Bit -j 16 -t no --early_cpve --nofetch" or die " building ECC failed : $!";
print "copy bin-s bin-c\n";
-###system "rm -rf bin-s binn-c";
-!system "/bin/cp -r out/bin ./bin-c" or die "$!";
-!system "/bin/cp -r out/bin ./bin-s" or die "$!";
+!system "rm -rf bin-s/* bin-c/*" or die "$!";
+!system "/bin/cp -r $ecc_dir/out/bin/* $ecc_dir/bin-c" or die "$!";
+!system "/bin/cp -r $ecc_dir/out/bin/* $ecc_dir/bin-s" or die "$!";
print "copy config files\n";
-!system "/bin/cp ./sss.txt ./bin-s/cucm-credentials.txt" or die ": $!";
-!system "/bin/cp ./ccc.txt ./bin-c/cucm-credentials.txt" or die ": $!";
+!system "/bin/cp $ecc_dir/sss.txt $ecc_dir/bin-s/cucm-credentials.txt" or die ": $!";
+!system "/bin/cp $ecc_dir/ccc.txt $ecc_dir/bin-c/cucm-credentials.txt" or die ": $!";
print "add p2p server ip\n";
-open CONF, ">>", './bin-c/cucm-credentials.txt' or die "error $!";
-#print CONF "P2P_SERVER_IP=" . &get_local_ip . "\n";
+open CONF, ">>", "$ecc_dir/bin-c/cucm-credentials.txt" or die "error $!";
print CONF "P2P_SERVER_IP=" . $ip . "\n";
close CONF;
print "####### DONE #######\n";
-
-#sub get_local_ip{
-# my @cc = (split / /, `ifconfig | grep "inet .*broadcast"`)[1];
-## @cc[1]; ## return value
-## return @cc[1];
-#}
-