The control port should declare that it requires password auth
[tor.git] / contrib / package_nsis-mingw.sh
blobe562a786345cf0e17da01d403b8a52f85d68ff8f
1 #!/bin/sh
3 # ===============================================================================
4 # package_nsis-ming.sh is distributed under this license:
6 # Copyright (c) 2006-2007 Andrew Lewman
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions are
10 # met:
12 # * Redistributions of source code must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
15 # * Redistributions in binary form must reproduce the above
16 # copyright notice, this list of conditions and the following disclaimer
17 # in the documentation and/or other materials provided with the
18 # distribution.
20 # * Neither the names of the copyright owners nor the names of its
21 # contributors may be used to endorse or promote products derived from
22 # this software without specific prior written permission.
24 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 # ===============================================================================
37 # Script to package a Tor installer on win32. This script assumes that
38 # you have already built Tor, that you are running msys/mingw, and that
39 # you know what you are doing.
41 # Start in the tor source directory after you've compiled tor.exe
42 # This means start as ./contrib/package_nsis-mingw.sh
44 rm -rf win_tmp
45 mkdir win_tmp
46 mkdir win_tmp/bin
47 mkdir win_tmp/contrib
48 mkdir win_tmp/doc
49 mkdir win_tmp/doc/spec
50 mkdir win_tmp/doc/design-paper
51 mkdir win_tmp/doc/contrib
52 mkdir win_tmp/src
53 mkdir win_tmp/src/config
54 mkdir win_tmp/tmp
56 cp src/or/tor.exe win_tmp/bin/
57 cp src/tools/tor-resolve.exe win_tmp/bin/
58 cp contrib/tor.ico win_tmp/bin/
60 # YOU must copy torbutton xpi into the contrib dir
61 #cp contrib/torbutton-1.0.4-fx+tb.xpi win_tmp/bin/
63 # There is no man2html in mingw.
64 # Maybe we should add this into make dist instead.
65 # One has to do this manually and cp it do the tor-source/doc dir
66 #man2html doc/tor.1.in > win_tmp/tmp/tor-reference.html
67 #man2html doc/tor-resolve.1 > win_tmp/tmp/tor-resolve.html
69 clean_newlines() {
70 perl -pe 's/^\n$/\r\n/mg; s/([^\r])\n$/\1\r\n/mg;' $1 >$2
73 clean_localstatedir() {
74 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
77 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
78 clean_newlines doc/spec/$fn win_tmp/doc/spec/$fn
79 done
81 cp doc/design-paper/tor-design.pdf win_tmp/doc/design-paper/tor-design.pdf
83 for fn in HACKING tor-reference.html tor-resolve.html; do
84 clean_newlines doc/$fn win_tmp/doc/$fn
85 done
87 for fn in README AUTHORS ChangeLog LICENSE; do
88 clean_newlines $fn win_tmp/$fn
89 done
91 clean_localstatedir src/config/torrc.sample.in win_tmp/src/config/torrc.sample
93 cp contrib/tor-mingw.nsi.in win_tmp/contrib/
95 cd win_tmp
96 "C:\Program Files\NSIS\makensis.exe" contrib/tor-mingw.nsi.in