create_pack.pl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. #!/usr/bin/perl
  2. use Getopt::Std;
  3. getopts("l:ehs", \%args);
  4. if ($args{h})
  5. {
  6. print "Usage: create_pack.pl [OPTION]...\n\n";
  7. print " -l file write down list of files\n";
  8. print " -e enterprise version\n";
  9. print " -s dont add version suffix to package name\n";
  10. print " -h this help\n\n";
  11. exit 1;
  12. }
  13. #to create list of files:
  14. if ($args{l})
  15. {
  16. create_files_list($args{l});
  17. exit 1;
  18. }
  19. $enterprise = 0;
  20. if ($args{e})
  21. {
  22. $enterprise = 1;
  23. }
  24. if ($args{s})
  25. {
  26. $packdir="libzrtp";
  27. }
  28. else
  29. {
  30. $LIBZRTP_VERSION=`cat ../../include/zrtp_version.h | grep 'LIBZRTP_VERSION_STR' | awk '{print \$3, \$4}' | sed 's/"v\\(.*\\) \\(.*\\)"/\\1.\\2/'`;
  31. chomp($LIBZRTP_VERSION);
  32. $packdir="libzrtp-$LIBZRTP_VERSION";
  33. }
  34. if (-d $packdir)
  35. {
  36. `rm -rf $packdir`
  37. }
  38. mkdir $packdir;
  39. create_array();
  40. foreach $file(@array)
  41. {
  42. if (!$enterprise &&
  43. (($file =~ m/\/enterprise/i) ||
  44. ($file =~ m/_ec.*(proj|sln)/i) ||
  45. ($file =~ m/_EC.*(WIN)/i) ||
  46. ($file =~ m/\/xcode/i)))
  47. {
  48. print "$file skipped\n";
  49. next;
  50. }
  51. $path = "../../" . $file;
  52. if (!-e $path)
  53. {
  54. print "[ERROR]: file $file doesn't exist!\n";
  55. `rm -rf $packdir`;
  56. exit -1;
  57. }
  58. if (-d $path)
  59. {
  60. mkdir "$packdir/$file";
  61. }
  62. else
  63. {
  64. # print "copying $path file\n";
  65. `cp $path $packdir/$file`
  66. }
  67. }
  68. if (!$enterprise)
  69. {
  70. `cp -f ../../projects/win/libzrtp_not_ec.vcproj $packdir/projects/win/libzrtp.vcproj`;
  71. `cp -f ../../projects/win_ce/libzrtp_wince_not_ec.vcproj $packdir/projects/win_ce/libzrtp_wince.vcproj`;
  72. `cp -f ../../projects/win_kernel/MAKEFILE_NOT_EC.WIN64 $packdir/projects/win_kernel/MAKEFILE.WIN64`;
  73. `cp -f ../../projects/win_kernel/MAKEFILE_NOT_EC.WIN32 $packdir/projects/win_kernel/MAKEFILE.WIN32`;
  74. `rm $packdir/include/zrtp_ec.h`;
  75. # `rm $packdir/include/zrtp_iface_cache.h`;
  76. `rm $packdir/src/zrtp_crypto_ecdsa.c`;
  77. `rm $packdir/src/zrtp_crypto_ec.c`;
  78. # `rm $packdir/src/zrtp_engine_driven.c`;
  79. `rm $packdir/src/zrtp_crypto_ecdh.c`;
  80. # `rm $packdir/src/zrtp_iface_cache.c`;
  81. }
  82. `find $packdir -name "._*" -delete`;
  83. $pack_name = $packdir;
  84. if ($enterprise)
  85. {
  86. $pack_name = $pack_name . "-ec";
  87. }
  88. $system = `uname -a`;
  89. if ($system =~ m/darwin/i)
  90. {
  91. `rm -rf $pack_name.zip`;
  92. `zip -r $pack_name.zip $packdir`;
  93. }
  94. else
  95. {
  96. `rm -rf $pack_name.tar.gz`;
  97. `tar -zcvf $pack_name.tar.gz $packdir`;
  98. }
  99. `rm -rf $packdir`;
  100. print "package was created\n";
  101. #for item in $array; do
  102. # echo "item:"$'\t'"$item"
  103. sub create_files_list()
  104. {
  105. $path = `pwd`;
  106. chop($path);
  107. `cd ../..;find . -not -path *svn* -print | awk '{printf \"\\t\\t\\"%s\\",\\n\", \$1} ' > $path/$_[0];cd $path`;
  108. }
  109. sub create_array()
  110. {
  111. @array =
  112. (
  113. "./ChangeLog",
  114. "./README",
  115. "./AUTHORS",
  116. "./projects",
  117. "./projects/gnu",
  118. "./projects/gnu/Makefile.am",
  119. "./projects/gnu/Makefile.in",
  120. "./projects/gnu/COPYING",
  121. "./projects/gnu/aclocal.m4",
  122. "./projects/gnu/configure",
  123. "./projects/gnu/README",
  124. "./projects/gnu/AUTHORS",
  125. "./projects/gnu/configure.in",
  126. "./projects/gnu/INSTALL",
  127. "./projects/gnu/autoreconf.sh",
  128. "./projects/gnu/config",
  129. "./projects/gnu/config/config.guess",
  130. "./projects/gnu/config/config.sub",
  131. "./projects/gnu/config/config.h.in",
  132. "./projects/gnu/config/install-sh",
  133. "./projects/gnu/config/missing",
  134. "./projects/gnu/config/prefix_config.m4",
  135. "./projects/gnu/config/depcomp",
  136. "./projects/gnu/NEWS",
  137. "./projects/gnu/Makefile.in",
  138. "./projects/gnu/build",
  139. "./projects/gnu/build/Makefile.am",
  140. "./projects/gnu/build/Makefile.in",
  141. "./projects/gnu/build/test",
  142. "./projects/gnu/build/test/Makefile.am",
  143. "./projects/gnu/build/test/Makefile.in",
  144. "./projects/gnu/ChangeLog",
  145. "./projects/xcode",
  146. "./projects/xcode/libzrtp.xcodeproj",
  147. "./projects/xcode/libzrtp.xcodeproj/project.pbxproj",
  148. "./projects/xcode/libzrtp_test.xcodeproj",
  149. "./projects/xcode/libzrtp_test.xcodeproj/project.pbxproj",
  150. "./projects/win_kernel",
  151. "./projects/win_kernel/MAKEFILE.WIN64",
  152. "./projects/win_kernel/MAKEFILE.WIN32",
  153. "./projects/win",
  154. "./projects/win/libzrtp.vcproj",
  155. "./projects/win/libzrtp.sln",
  156. "./projects/win/libzrtp_test.vcproj",
  157. "./projects/win_ce",
  158. "./projects/win_ce/libzrtp_test_wince.vcproj",
  159. "./projects/win_ce/libzrtp_wince.sln",
  160. "./projects/win_ce/libzrtp_wince.vcproj",
  161. "./projects/symbian",
  162. "./projects/symbian/bld.bat",
  163. "./projects/symbian/bld.inf",
  164. "./projects/symbian/bldgcce.bat",
  165. "./projects/symbian/libzrtp.mmp",
  166. "./projects/symbian/zrtp_iface_symb.cpp",
  167. "./src",
  168. "./src/zrtp.c",
  169. "./src/zrtp_crc.c",
  170. "./src/zrtp_crypto_aes.c",
  171. "./src/zrtp_crypto_atl.c",
  172. "./src/zrtp_crypto_hash.c",
  173. "./src/zrtp_crypto_pk.c",
  174. "./src/zrtp_crypto_sas.c",
  175. "./src/zrtp_datatypes.c",
  176. "./src/zrtp_engine.c",
  177. "./src/zrtp_iface_scheduler.c",
  178. "./src/zrtp_iface_sys.c",
  179. "./src/zrtp_initiator.c",
  180. "./src/zrtp_legal.c",
  181. "./src/zrtp_list.c",
  182. "./src/zrtp_log.c",
  183. "./src/zrtp_pbx.c",
  184. "./src/zrtp_protocol.c",
  185. "./src/zrtp_responder.c",
  186. "./src/zrtp_rng.c",
  187. "./src/zrtp_srtp_builtin.c",
  188. "./src/zrtp_srtp_dm.c",
  189. "./src/zrtp_string.c",
  190. "./src/zrtp_utils.c",
  191. "./src/zrtp_utils_proto.c",
  192. "./src/zrtp_crypto_ecdsa.c",
  193. "./src/zrtp_crypto_ec.c",
  194. "./src/zrtp_engine_driven.c",
  195. "./src/zrtp_crypto_ecdh.c",
  196. "./src/zrtp_iface_cache.c",
  197. "./doc",
  198. "./include",
  199. "./include/zrtp.h",
  200. "./include/zrtp_base.h",
  201. "./include/zrtp_config.h",
  202. "./include/zrtp_config_user.h",
  203. "./include/zrtp_config_win.h",
  204. "./include/zrtp_config_symbian.h",
  205. "./include/zrtp_crypto.h",
  206. "./include/zrtp_engine.h",
  207. "./include/zrtp_error.h",
  208. "./include/zrtp_ec.h",
  209. "./include/zrtp_iface.h",
  210. "./include/zrtp_iface_cache.h",
  211. "./include/zrtp_iface_system.h",
  212. "./include/zrtp_iface_scheduler.h",
  213. "./include/zrtp_legal.h",
  214. "./include/zrtp_list.h",
  215. "./include/zrtp_log.h",
  216. "./include/zrtp_pbx.h",
  217. "./include/zrtp_protocol.h",
  218. "./include/zrtp_srtp.h",
  219. "./include/zrtp_srtp_builtin.h",
  220. "./include/zrtp_string.h",
  221. "./include/zrtp_types.h",
  222. "./include/zrtp_version.h",
  223. "./third_party",
  224. "./third_party/bnlib",
  225. "./third_party/bnlib/lbnmem.c",
  226. "./third_party/bnlib/lbn00.c",
  227. "./third_party/bnlib/bn16.c",
  228. "./third_party/bnlib/bn32.c",
  229. "./third_party/bnlib/bn.c",
  230. "./third_party/bnlib/lbnppc.h",
  231. "./third_party/bnlib/bnsize00.h",
  232. "./third_party/bnlib/lbn32.h",
  233. "./third_party/bnlib/lbn80386.h",
  234. "./third_party/bnlib/lbn68020.h",
  235. "./third_party/bnlib/germtest",
  236. "./third_party/bnlib/jacobi.h",
  237. "./third_party/bnlib/bn00.c",
  238. "./third_party/bnlib/bnconfig.h",
  239. "./third_party/bnlib/lbn8086.h",
  240. "./third_party/bnlib/bntest00.c",
  241. "./third_party/bnlib/germain.c",
  242. "./third_party/bnlib/lbn960jx.h",
  243. "./third_party/bnlib/sizetest.c",
  244. "./third_party/bnlib/config.cache",
  245. "./third_party/bnlib/bn68000.c",
  246. "./third_party/bnlib/lbnalpha.h",
  247. "./third_party/bnlib/cputime.h",
  248. "./third_party/bnlib/legal.c",
  249. "./third_party/bnlib/configure.lineno",
  250. "./third_party/bnlib/configure",
  251. "./third_party/bnlib/bnprint.c",
  252. "./third_party/bnlib/bn8086.c",
  253. "./third_party/bnlib/lbn68020.c",
  254. "./third_party/bnlib/README.bntest",
  255. "./third_party/bnlib/lbn8086.asm",
  256. "./third_party/bnlib/lbn16.c",
  257. "./third_party/bnlib/lbn32.c",
  258. "./third_party/bnlib/legal.h",
  259. "./third_party/bnlib/configure.in",
  260. "./third_party/bnlib/lbn960jx.s",
  261. "./third_party/bnlib/prime.h",
  262. "./third_party/bnlib/bninit16.c",
  263. "./third_party/bnlib/bninit32.c",
  264. "./third_party/bnlib/files",
  265. "./third_party/bnlib/ppcasm.h",
  266. "./third_party/bnlib/lbn.h",
  267. "./third_party/bnlib/README.bn",
  268. "./third_party/bnlib/bnintern.doc",
  269. "./third_party/bnlib/sieve.c",
  270. "./third_party/bnlib/bn16.h",
  271. "./third_party/bnlib/bn32.h",
  272. "./third_party/bnlib/bnprint.h",
  273. "./third_party/bnlib/sieve.h",
  274. "./third_party/bnlib/cfg",
  275. "./third_party/bnlib/lbn68000.h",
  276. "./third_party/bnlib/lbnalpha.s",
  277. "./third_party/bnlib/bntest16.c",
  278. "./third_party/bnlib/bntest32.c",
  279. "./third_party/bnlib/cfg.debug",
  280. "./third_party/bnlib/lbnmem.h",
  281. "./third_party/bnlib/germtest.c",
  282. "./third_party/bnlib/prime.c",
  283. "./third_party/bnlib/lbn68000.c",
  284. "./third_party/bnlib/config.log",
  285. "./third_party/bnlib/germain.h",
  286. "./third_party/bnlib/kludge.h",
  287. "./third_party/bnlib/Makefile.in",
  288. "./third_party/bnlib/test",
  289. "./third_party/bnlib/test/primetest.c",
  290. "./third_party/bnlib/test/rsaglue.h",
  291. "./third_party/bnlib/test/randpool.c",
  292. "./third_party/bnlib/test/keys.c",
  293. "./third_party/bnlib/test/primes.doc",
  294. "./third_party/bnlib/test/rsatest.c",
  295. "./third_party/bnlib/test/posix.h",
  296. "./third_party/bnlib/test/legal.c",
  297. "./third_party/bnlib/test/README.rsatest",
  298. "./third_party/bnlib/test/rsaglue.c",
  299. "./third_party/bnlib/test/kbmsdos.c",
  300. "./third_party/bnlib/test/keygen.c",
  301. "./third_party/bnlib/test/README.dsatest",
  302. "./third_party/bnlib/test/types.h",
  303. "./third_party/bnlib/test/random.c",
  304. "./third_party/bnlib/test/md5.c",
  305. "./third_party/bnlib/test/userio.h",
  306. "./third_party/bnlib/test/md5.h",
  307. "./third_party/bnlib/test/dsatest.c",
  308. "./third_party/bnlib/test/pt.c",
  309. "./third_party/bnlib/test/dhtest.c",
  310. "./third_party/bnlib/test/sha.h",
  311. "./third_party/bnlib/test/keygen.h",
  312. "./third_party/bnlib/test/noise.h",
  313. "./third_party/bnlib/test/first.h",
  314. "./third_party/bnlib/test/README.dhtest",
  315. "./third_party/bnlib/test/randtest.c",
  316. "./third_party/bnlib/test/randpool.h",
  317. "./third_party/bnlib/test/random.h",
  318. "./third_party/bnlib/test/sha.c",
  319. "./third_party/bnlib/test/noise.c",
  320. "./third_party/bnlib/test/kbunix.c",
  321. "./third_party/bnlib/test/kludge.h",
  322. "./third_party/bnlib/test/keys.h",
  323. "./third_party/bnlib/test/usuals.h",
  324. "./third_party/bnlib/test/kb.h",
  325. "./third_party/bnlib/CHANGES",
  326. "./third_party/bnlib/bnconfig.hin",
  327. "./third_party/bnlib/lbn80386.asm",
  328. "./third_party/bnlib/jacobi.c",
  329. "./third_party/bnlib/config.status",
  330. "./third_party/bnlib/lbn16.h",
  331. "./third_party/bnlib/lbn80386.s",
  332. "./third_party/bnlib/lbn68360.s",
  333. "./third_party/bnlib/bignum-ARM",
  334. "./third_party/bnlib/bignum-ARM/lbnmem.c",
  335. "./third_party/bnlib/bignum-ARM/sha256_core.s",
  336. "./third_party/bnlib/bignum-ARM/lbnarm.h",
  337. "./third_party/bnlib/bignum-ARM/config.h",
  338. "./third_party/bnlib/bignum-ARM/cputime.h",
  339. "./third_party/bnlib/bignum-ARM/lbn16.c",
  340. "./third_party/bnlib/bignum-ARM/lbnarm.s",
  341. "./third_party/bnlib/bignum-ARM/README-small-memory",
  342. "./third_party/bnlib/bignum-ARM/sha256_arm.c",
  343. "./third_party/bnlib/bignum-ARM/lbn.h",
  344. "./third_party/bnlib/bignum-ARM/bntest16.c",
  345. "./third_party/bnlib/bignum-ARM/lbnmem.h",
  346. "./third_party/bnlib/bignum-ARM/kludge.h",
  347. "./third_party/bnlib/bignum-ARM/lbn16.h",
  348. "./third_party/bnlib/bn.doc",
  349. "./third_party/bnlib/lbnppc.c",
  350. "./third_party/bnlib/bn.h",
  351. "./third_party/bgaes",
  352. "./third_party/bgaes/sha1.h",
  353. "./third_party/bgaes/sha1.c",
  354. "./third_party/bgaes/brg_types.h",
  355. "./third_party/bgaes/aestab.c",
  356. "./third_party/bgaes/aestab.h",
  357. "./third_party/bgaes/sha2.h",
  358. "./third_party/bgaes/aes_modes.c",
  359. "./third_party/bgaes/aescrypt.c",
  360. "./third_party/bgaes/bg2zrtp.h",
  361. "./third_party/bgaes/aeskey.c",
  362. "./third_party/bgaes/sha2.c",
  363. "./third_party/bgaes/aes.h",
  364. "./third_party/bgaes/aesopt.h",
  365. "./test",
  366. "./test/README",
  367. "./test/pc",
  368. "./test/pc/zrtp_test_core.c",
  369. "./test/pc/zrtp_test_core.h",
  370. "./test/pc/zrtp_test_crypto.c",
  371. "./test/pc/zrtp_test_queue.c",
  372. "./test/pc/zrtp_test_queue.h",
  373. "./test/pc/zrtp_test_ui.c",
  374. "./test/win_ce",
  375. "./test/win_ce/libzrtp_test_GUI.cpp",
  376. "./test/win_ce/libzrtp_test_GUI.h",
  377. "./test/win_ce/libzrtp_test_GUI.ico",
  378. "./test/win_ce/libzrtp_test_GUIppc.rc",
  379. "./test/win_ce/libzrtp_test_GUIppc.rc2",
  380. "./test/win_ce/libzrtp_test_GUIsp.rc",
  381. "./test/win_ce/libzrtp_test_GUIsp.rc2",
  382. "./test/win_ce/ReadMe.txt",
  383. "./test/win_ce/resourceppc.h",
  384. "./test/win_ce/resourcesp.h",
  385. "./test/win_ce/stdafx.cpp",
  386. "./test/win_ce/stdafx.h",
  387. "./doc",
  388. "./doc/img",
  389. "./doc/manuals",
  390. "./doc/manuals/howto.dox",
  391. "./doc/manuals/main.dox",
  392. "./doc/manuals/rng.dox",
  393. "./doc/out",
  394. "./doc/out/html",
  395. "./doc/out/html/zfone.jpg",
  396. "./doc/Doxyfile",
  397. "./doc/doxygen.css",
  398. "./doc/footer.html",
  399. "./doc/header.html"
  400. )
  401. }