6 # Script to package a Tor installer on win32. This script assumes that
7 # you have already built Tor, that you are running cygwin, and that your
8 # environment is basically exactly the same as Nick's.
10 if ! [ -d Win32Build
] ||
! [ -d contrib
]; then
11 echo "No Win32Build and/or no contrib directory here. Are we in the right place?" >&2
20 mkdir win_tmp
/doc
/website
21 mkdir win_tmp
/doc
/design-paper
22 mkdir win_tmp
/doc
/contrib
24 mkdir win_tmp
/src
/config
27 cp Win32Build
/vc
7/Tor
/Debug
/Tor.exe win_tmp
/bin
/tor.exe
28 cp Win32Build
/vc
7/tor_resolve
/Debug
/tor_resolve.exe win_tmp
/bin
29 cp ..
/c-windows-system32
/libeay32.dll win_tmp
/bin
30 cp ..
/c-windows-system32
/ssleay32.dll win_tmp
/bin
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
45 doc
/control-spec.txt \
48 doc
/socks-extensions.txt \
50 doc
/version-spec.txt \
54 clean_newlines
"$fn" win_tmp
/"$fn"
56 mmv win_tmp
/doc
/website
/"*.html.*" win_tmp
/doc
/website
/"#1.#2.html"
58 cp doc
/design-paper
/tor-design.pdf win_tmp
/doc
/design-paper
/tor-design.pdf
60 for fn
in tor-reference.html tor-resolve.html
; do \
61 clean_newlines win_tmp
/tmp
/$fn win_tmp
/doc
/$fn
64 for fn
in README AUTHORS ChangeLog LICENSE
; do \
65 clean_newlines
$fn win_tmp
/$fn
68 clean_localstatedir src
/config
/torrc.sample.
in win_tmp
/src
/config
/torrc.sample
70 cp contrib
/tor.nsi.
in win_tmp
/contrib
/tor.nsi
72 echo '/WEBSITE-FILES-HERE/'
74 for fn
in win_tmp
/doc
/website
/*; do
75 echo -n 'File "..\doc\website\'
76 echo -n "`basename $fn`"
82 ) | ed win_tmp/contrib/tor.nsi
88 echo ' cd \tor\win_tmp\contrib'
89 echo ' c:\programme\nsis\makensis tor.nsi'
90 echo ' move tor-*.exe ../../..'