package_nsis-mingw.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. rm -rf win_tmp
  8. mkdir win_tmp
  9. mkdir win_tmp/bin
  10. mkdir win_tmp/contrib
  11. mkdir win_tmp/doc
  12. mkdir win_tmp/doc/design-paper
  13. mkdir win_tmp/doc/contrib
  14. mkdir win_tmp/src
  15. mkdir win_tmp/src/config
  16. mkdir win_tmp/tmp
  17. cp src/or/tor.exe win_tmp/bin/tor.exe
  18. cp src/tools/tor_resolve.exe win_tmp/bin
  19. cp /usr/local/ssl/lib/libcrypto.a win_tmp/bin
  20. cp /usr/local/ssl/lib/libssl.a win_tmp/bin
  21. # There is no man2html in mingw.
  22. # Maybe we should add this into make dist instead.
  23. man2html doc/tor.1.in > win_tmp/tmp/tor-reference.html
  24. man2html doc/tor-resolve.1 > win_tmp/tmp/tor-resolve.html
  25. clean_newlines() {
  26. perl -pe 's/^\n$/\r\n/mg; s/([^\r])\n$/\1\r\n/mg;' $1 >$2
  27. }
  28. clean_localstatedir() {
  29. 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
  30. }
  31. for fn in tor-spec.txt HACKING rend-spec.txt control-spec.txt \
  32. tor-doc.html tor-doc.css version-spec.txt; do
  33. clean_newlines doc/$fn win_tmp/doc/$fn
  34. done
  35. cp doc/design-paper/tor-design.pdf win_tmp/doc/design-paper/tor-design.pdf
  36. for fn in tor-reference.html tor-resolve.html; do \
  37. clean_newlines win_tmp/tmp/$fn win_tmp/doc/$fn
  38. done
  39. for fn in README AUTHORS ChangeLog LICENSE; do \
  40. clean_newlines $fn win_tmp/$fn
  41. done
  42. clean_localstatedir src/config/torrc.sample.in win_tmp/src/config/torrc.sample
  43. cp contrib/tor.nsi win_tmp/contrib
  44. cd win_tmp/contrib
  45. C:\Program Files\NSIS\makensis.exe tor.nsi
  46. mv tor-*.exe ../..