-
Notifications
You must be signed in to change notification settings - Fork 115
/
build.sh
104 lines (89 loc) · 2.67 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
#
# (C) 2021, all rights reserved,
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Script for building WinDivert binary packages. This script assumes the
# binaries are already built and are in the install/ subdirectory.
set -e
WINDIVERT=WinDivert-2.2.0-B
TOR=tor-win32-0.4.5.10
VERSION=`cat VERSION`
echo "Checking for dependencies..."
cd contrib
if [ ! -e "$WINDIVERT.zip" ]
then
echo "ERROR: missing \"$WINDIVERT.zip\"; download from" \
"(http://reqrypt.org/windivert.html)" 2>&1
exit 1
fi
for FILE in "$TOR.zip"
do
if [ ! -e "$FILE" ]
then
echo "ERROR: missing \"$FILE\"; download the Tor" \
"Expert Bundle for Windows (https://www.torproject.org/)" 2>&1
exit 1;
fi
done
echo "Extracting WinDivert..."
unzip -o $WINDIVERT.zip
echo "Extracting Tor..."
unzip -o $TOR.zip
echo "Building Tallow..."
cd ..
make VERSION=$VERSION WINDIVERT=$WINDIVERT
echo "Copying \"tallow.exe\"..."
cp tallow.exe install/.
echo "Copying \"hosts.deny\"..."
cp hosts.deny install/.
echo "Copying \"traffic.deny\"..."
cp traffic.deny install/.
echo "Copying \"traffic.divert\"..."
cp traffic.divert install/.
echo "Copying \"torrc\"..."
cp torrc install/.
echo "Copying \"LICENSE\"..."
cp LICENSE install/.
for FILE in \
"$WINDIVERT/x64/WinDivert64.sys" \
"$WINDIVERT/x86/WinDivert32.sys" \
"$WINDIVERT/x86/WinDivert.dll" \
"Tor/libcrypto-1_1.dll" \
"Tor/libssl-1_1.dll" \
"Tor/libwinpthread-1.dll" \
"Tor/libevent-2-1-7.dll" \
"Tor/libevent_core-2-1-7.dll" \
"Tor/libevent_extra-2-1-7.dll" \
"Tor/libgcc_s_sjlj-1.dll" \
"Tor/libssp-0.dll" \
"Tor/zlib1.dll" \
"Tor/tor.exe" \
"Data/Tor/geoip" \
"Data/Tor/geoip6"
do
echo "Copying \"$FILE\"..."
cp contrib/"$FILE" install/.
done
echo "Building installation package..."
cd install
zip -r "../TallowBundle-$VERSION-files.zip" *
cp ../install.nsi .
makensis install.nsi
mv TallowBundle-install.exe "../TallowBundle-$VERSION-install.exe"
cd ..
echo "Cleaning up..."
rm -f install/*
make clean
echo "Done!"