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.
7 # Start in the tor source directory after you've compiled tor.exe
8 # This means start as ./contrib/package_nsis-mingw.sh
15 mkdir win_tmp
/doc
/spec
16 mkdir win_tmp
/doc
/design-paper
17 mkdir win_tmp
/doc
/contrib
19 mkdir win_tmp
/src
/config
22 cp src
/or
/tor.exe win_tmp
/bin
/
23 cp src
/tools
/tor-resolve.exe win_tmp
/bin
/
24 cp contrib
/tor.ico win_tmp
/bin
/
26 # YOU must copy torbutton xpi into the contrib dir
27 #cp contrib/torbutton-1.0.4-fx+tb.xpi win_tmp/bin/
29 # There is no man2html in mingw.
30 # Maybe we should add this into make dist instead.
31 # One has to do this manually and cp it do the tor-source/doc dir
32 #man2html doc/tor.1.in > win_tmp/tmp/tor-reference.html
33 #man2html doc/tor-resolve.1 > win_tmp/tmp/tor-resolve.html
36 perl
-pe 's/^\n$/\r\n/mg; s/([^\r])\n$/\1\r\n/mg;' $1 >$2
39 clean_localstatedir
() {
40 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
43 for fn
in address-spec.txt control-spec.txt control-spec-v0.txt dir-spec.txt dir-spec-v1.txt path-spec.txt rend-spec.txt socks-extensions.txt tor-spec.txt version-spec.txt
; do
44 clean_newlines
doc
/spec
/$fn win_tmp
/doc
/spec
/$fn
47 cp doc
/design-paper
/tor-design.pdf win_tmp
/doc
/design-paper
/tor-design.pdf
49 for fn
in HACKING tor-reference.html tor-resolve.html
; do
50 clean_newlines
doc
/$fn win_tmp
/doc
/$fn
53 for fn
in README AUTHORS ChangeLog LICENSE
; do
54 clean_newlines
$fn win_tmp
/$fn
57 clean_localstatedir src
/config
/torrc.sample.
in win_tmp
/src
/config
/torrc.sample
59 cp contrib
/tor-mingw.nsi.
in win_tmp
/contrib
/
62 "C:\Program Files\NSIS\makensis.exe" contrib
/tor-mingw.nsi.
in