package_nsis-mingw.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/sh
  2. #
  3. # Script to package a Tor installer on win32. This script assumes that
  4. # you have already built Tor, that you are running msys/mingw, and that
  5. # you know what you are doing.
  6. # Start in the tor source directory after you've compiled tor.exe
  7. # This means start as ./contrib/package_nsis-mingw.sh
  8. rm -rf win_tmp
  9. mkdir win_tmp
  10. mkdir win_tmp/bin
  11. mkdir win_tmp/contrib
  12. mkdir win_tmp/doc
  13. mkdir win_tmp/doc/design-paper
  14. mkdir win_tmp/doc/contrib
  15. mkdir win_tmp/src
  16. mkdir win_tmp/src/config
  17. mkdir win_tmp/tmp
  18. cp src/or/tor.exe win_tmp/bin/
  19. cp src/tools/tor-resolve.exe win_tmp/bin/
  20. cp /usr/local/ssl/lib/libcrypto.a win_tmp/bin/
  21. cp /usr/local/ssl/lib/libssl.a win_tmp/bin/
  22. cp contrib/tor.ico win_tmp/bin/
  23. # There is no man2html in mingw.
  24. # Maybe we should add this into make dist instead.
  25. # One has to do this manually and cp it do the tor-source/doc dir
  26. #man2html doc/tor.1.in > win_tmp/tmp/tor-reference.html
  27. #man2html doc/tor-resolve.1 > win_tmp/tmp/tor-resolve.html
  28. clean_newlines() {
  29. perl -pe 's/^\n$/\r\n/mg; s/([^\r])\n$/\1\r\n/mg;' $1 >$2
  30. }
  31. clean_localstatedir() {
  32. 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
  33. }
  34. for fn in socks-extensions.txt dir-spec.txt tor-spec.txt HACKING rend-spec.txt control-spec.txt tor-doc.html tor-doc.css version-spec.txt; do
  35. clean_newlines doc/$fn win_tmp/doc/$fn
  36. done
  37. cp doc/design-paper/tor-design.pdf win_tmp/doc/design-paper/tor-design.pdf
  38. for fn in tor-reference.html tor-resolve.html; do
  39. clean_newlines doc/$fn win_tmp/doc/$fn
  40. done
  41. for fn in README AUTHORS ChangeLog LICENSE; do
  42. clean_newlines $fn win_tmp/$fn
  43. done
  44. clean_localstatedir src/config/torrc.sample.in win_tmp/src/config/torrc.sample
  45. cp contrib/tor-mingw.nsi win_tmp/contrib/
  46. cd win_tmp
  47. "C:\Program Files\NSIS\makensis.exe" contrib/tor-mingw.nsi