package_nsis-weasel.sh 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/sh
  2. set -e
  3. #
  4. # Script to package a Tor installer on win32. This script assumes that
  5. # you have already built Tor, that you are running cygwin, and that your
  6. # environment is basically exactly the same as Nick's.
  7. if ! [ -d Win32Build ] || ! [ -d contrib ]; then
  8. echo "No Win32Build and/or no contrib directory here. Are we in the right place?" >&2
  9. exit 1
  10. fi
  11. rm -rf win_tmp
  12. mkdir win_tmp
  13. mkdir win_tmp/bin
  14. mkdir win_tmp/contrib
  15. mkdir win_tmp/doc
  16. mkdir win_tmp/doc/design-paper
  17. mkdir win_tmp/doc/contrib
  18. mkdir win_tmp/src
  19. mkdir win_tmp/src/config
  20. mkdir win_tmp/tmp
  21. cp Win32Build/vc7/Tor/Debug/Tor.exe win_tmp/bin/tor.exe
  22. cp Win32Build/vc7/tor_resolve/Debug/tor_resolve.exe win_tmp/bin
  23. cp ../c-windows-system32/libeay32.dll win_tmp/bin
  24. cp ../c-windows-system32/ssleay32.dll win_tmp/bin
  25. man2html doc/tor.1.in > win_tmp/tmp/tor-reference.html
  26. man2html doc/tor-resolve.1 > win_tmp/tmp/tor-resolve.html
  27. clean_newlines() {
  28. perl -pe 's/^\n$/\r\n/mg; s/([^\r])\n$/\1\r\n/mg;' $1 >$2
  29. }
  30. clean_localstatedir() {
  31. perl -pe 's/^\n$/\r\n/mg; s/([^\r])\n$/\1\r\n/mg; s{\@LOCALSTATEDIR\@/(lib|log)/tor/}{C:\\Documents and Settings\\Application Data\\Tor\\}' $1 >$2
  32. }
  33. for fn in \
  34. HACKING \
  35. control-spec.txt \
  36. dir-spec.txt \
  37. rend-spec.txt \
  38. socks-extensions.txt \
  39. version-spec.txt \
  40. \
  41. website/stylesheet.css \
  42. website/tor-doc-osx.html.en \
  43. website/tor-doc-osx.html.it \
  44. website/tor-doc-server.html.en \
  45. website/tor-doc-server.html.it \
  46. website/tor-doc-unix.html.en \
  47. website/tor-doc-unix.html.it \
  48. website/tor-doc-win32.html.en \
  49. website/tor-doc-win32.html.es \
  50. website/tor-doc-win32.html.it \
  51. website/tor-hidden-service.html.en \
  52. website/tor-switchproxy.html.en \
  53. website/tor-switchproxy.html.it \
  54. \
  55. ; do
  56. clean_newlines doc/"$fn" win_tmp/doc/"`basename $fn`"
  57. done
  58. cp doc/design-paper/tor-design.pdf win_tmp/doc/design-paper/tor-design.pdf
  59. for fn in tor-reference.html tor-resolve.html; do \
  60. clean_newlines win_tmp/tmp/$fn win_tmp/doc/$fn
  61. done
  62. for fn in README AUTHORS ChangeLog LICENSE; do \
  63. clean_newlines $fn win_tmp/$fn
  64. done
  65. clean_localstatedir src/config/torrc.sample.in win_tmp/src/config/torrc.sample
  66. cp contrib/tor.nsi win_tmp/contrib
  67. cd win_tmp/contrib
  68. echo "Now run"
  69. echo ' t:'
  70. echo ' cd \tor\win_tmp\contrib'
  71. echo ' c:\programme\nsis\makensis tor.nsi'
  72. echo ' move tor-*.exe ../../..'