mktoolzip.tcl 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/usr/bin/tclsh
  2. #
  3. # Run this script in order to generate a ZIP archive containing various
  4. # command-line tools.
  5. #
  6. # The makefile that invokes this script must first build the following
  7. # binaries:
  8. #
  9. # testfixture -- used to run this script
  10. # sqlite3 -- the SQLite CLI
  11. # sqldiff -- Program to diff two databases
  12. # sqlite3_analyzer -- Space analyzer
  13. # sqlite3_rsync -- Remote db sync
  14. #
  15. switch $tcl_platform(os) {
  16. {Windows NT} {
  17. set OS win32
  18. set EXE .exe
  19. }
  20. Linux {
  21. set OS linux
  22. set EXE {}
  23. }
  24. Darwin {
  25. set OS osx
  26. set EXE {}
  27. }
  28. default {
  29. set OS unknown
  30. set EXE {}
  31. }
  32. }
  33. switch $tcl_platform(machine) {
  34. arm64 {
  35. set ARCH arm64
  36. }
  37. x86_64 {
  38. set ARCH x64
  39. }
  40. amd64 -
  41. intel {
  42. if {$tcl_platform(pointerSize)==4} {
  43. set ARCH x86
  44. } else {
  45. set ARCH x64
  46. }
  47. }
  48. default {
  49. set ARCH unk
  50. }
  51. }
  52. set in [open [file join [file dirname [file dirname [info script]]] VERSION]]
  53. set vers [read $in]
  54. close $in
  55. scan $vers %d.%d.%d v1 v2 v3
  56. set v2 [format 3%02d%02d00 $v2 $v3]
  57. set name sqlite-tools-$OS-$ARCH-$v2.zip
  58. set toollist "sqlite3$EXE sqldiff$EXE sqlite3_analyzer$EXE sqlite3_rsync$EXE"
  59. puts "zip $name {*}$toollist"
  60. exec zip $name {*}$toollist
  61. puts "$name: [file size $name] bytes"