|
37 | 37 |
|
38 | 38 | set -e |
39 | 39 |
|
| 40 | +LABEL= |
| 41 | +if [ $# -ge 1 ] |
| 42 | +then |
| 43 | + LABEL="-$1" |
| 44 | +fi |
| 45 | + |
| 46 | +TARGET=MINGW |
| 47 | + |
| 48 | +WINDIVERT32_SYS=install/$TARGET/i386/WinDivert32.sys |
| 49 | +if [ $# -ge 2 ] |
| 50 | +then |
| 51 | + WINDIVERT32_SYS=$2 |
| 52 | +fi |
| 53 | + |
| 54 | +WINDIVERT64_SYS=install/$TARGET/amd64/WinDivert64.sys |
| 55 | +if [ $# -ge 3 ] |
| 56 | +then |
| 57 | + WINDIVERT64_SYS=$3 |
| 58 | +fi |
| 59 | + |
40 | 60 | VERSION=`cat ./VERSION` |
41 | 61 | NAME=WinDivert-$VERSION |
42 | 62 |
|
43 | | -for TARGET in MINGW |
44 | | -do |
45 | | - if [ ! -d "install/$TARGET" ] |
46 | | - then |
47 | | - echo "SKIP $NAME-$TARGET" |
48 | | - continue |
49 | | - fi |
50 | | - echo "BUILD $NAME" |
51 | | - INSTALL=install/$NAME |
52 | | - echo "\tmake $INSTALL..." |
53 | | - rm -rf $INSTALL |
54 | | - mkdir -p $INSTALL |
55 | | - echo "\tcopy $INSTALL/README..." |
56 | | - cp README $INSTALL |
57 | | - echo "\tcopy $INSTALL/CHANGELOG..." |
58 | | - cp CHANGELOG $INSTALL |
59 | | - echo "\tcopy $INSTALL/LICENSE..." |
60 | | - cp LICENSE $INSTALL |
61 | | - echo "\tcopy $INSTALL/VERSION..." |
62 | | - cp VERSION $INSTALL |
63 | | - echo "\tmake $INSTALL/include..." |
64 | | - mkdir -p $INSTALL/include |
65 | | - echo "\tcopy $INSTALL/include/windivert.h..." |
66 | | - cp include/windivert.h $INSTALL/include |
67 | | - echo "\tmake $INSTALL/doc..." |
68 | | - mkdir -p $INSTALL/doc |
69 | | - echo "\tcopy $INSTALL/doc/WinDivert.html..." |
70 | | - cp doc/windivert.html $INSTALL/doc/WinDivert.html |
71 | | - echo "\tmake $INSTALL/x86..." |
72 | | - mkdir -p $INSTALL/x86 |
73 | | - echo "\tcopy $INSTALL/x86/WinDivert32.sys..." |
74 | | - cp install/$TARGET/i386/WinDivert32.sys $INSTALL/x86 |
75 | | - if ! grep "DigiCert High Assurance EV Root" $INSTALL/x86/WinDivert32.sys \ |
76 | | - 2>&1 >/dev/null |
77 | | - then |
78 | | - echo "\t\033[33mWARNING\033[0m: unsigned WinDivert32.sys..." |
79 | | - fi |
80 | | - if [ -d "install/$TARGET/amd64" ] |
81 | | - then |
82 | | - echo "\tcopy $INSTALL/amd64/WinDivert64.sys..." |
83 | | - cp install/$TARGET/amd64/WinDivert64.sys $INSTALL/x86 |
84 | | - fi |
85 | | - echo "\tcopy $INSTALL/x86/WinDivert.lib..." |
86 | | - cp install/$TARGET/i386/WinDivert.lib $INSTALL/x86 |
87 | | - echo "\tcopy $INSTALL/x86/WinDivert.dll..." |
88 | | - cp install/$TARGET/i386/WinDivert.dll $INSTALL/x86 |
89 | | - echo "\tcopy $INSTALL/x86/netdump.exe..." |
90 | | - cp install/$TARGET/i386/netdump.exe $INSTALL/x86 |
91 | | - echo "\tcopy $INSTALL/x86/netfilter.exe..." |
92 | | - cp install/$TARGET/i386/netfilter.exe $INSTALL/x86 |
93 | | - echo "\tcopy $INSTALL/x86/passtru.exe..." |
94 | | - cp install/$TARGET/i386/passthru.exe $INSTALL/x86 |
95 | | - echo "\tcopy $INSTALL/x86/webfilter.exe..." |
96 | | - cp install/$TARGET/i386/webfilter.exe $INSTALL/x86 |
97 | | - echo "\tcopy $INSTALL/x86/streamdump.exe..." |
98 | | - cp install/$TARGET/i386/streamdump.exe $INSTALL/x86 |
99 | | - echo "\tcopy $INSTALL/x86/flowtrack.exe..." |
100 | | - cp install/$TARGET/i386/flowtrack.exe $INSTALL/x86 |
101 | | - echo "\tcopy $INSTALL/x86/socketdump.exe..." |
102 | | - cp install/$TARGET/i386/socketdump.exe $INSTALL/x86 |
103 | | - echo "\tcopy $INSTALL/x86/windivertctl.exe..." |
104 | | - cp install/$TARGET/i386/windivertctl.exe $INSTALL/x86 |
105 | | - echo "\tcopy $INSTALL/x86/test.exe..." |
106 | | - cp install/$TARGET/i386/test.exe $INSTALL/x86 |
107 | | - if [ -d "install/$TARGET/amd64" ] |
| 63 | +echo "BUILD $NAME$LABEL" |
| 64 | +INSTALL=install/$NAME$LABEL |
| 65 | +echo "\tmake $INSTALL..." |
| 66 | +rm -rf $INSTALL |
| 67 | +mkdir -p $INSTALL |
| 68 | +echo "\tcopy $INSTALL/README..." |
| 69 | +cp README $INSTALL |
| 70 | +echo "\tcopy $INSTALL/CHANGELOG..." |
| 71 | +cp CHANGELOG $INSTALL |
| 72 | +echo "\tcopy $INSTALL/LICENSE..." |
| 73 | +cp LICENSE $INSTALL |
| 74 | +echo "\tcopy $INSTALL/VERSION..." |
| 75 | +cp VERSION $INSTALL |
| 76 | +echo "\tmake $INSTALL/include..." |
| 77 | +mkdir -p $INSTALL/include |
| 78 | +echo "\tcopy $INSTALL/include/windivert.h..." |
| 79 | +cp include/windivert.h $INSTALL/include |
| 80 | +echo "\tmake $INSTALL/doc..." |
| 81 | +mkdir -p $INSTALL/doc |
| 82 | +echo "\tcopy $INSTALL/doc/WinDivert.html..." |
| 83 | +cp doc/windivert.html $INSTALL/doc/WinDivert.html |
| 84 | +echo "\tmake $INSTALL/x86..." |
| 85 | +mkdir -p $INSTALL/x86 |
| 86 | +echo "\tcopy $INSTALL/x86/WinDivert32.sys..." |
| 87 | +cp "$WINDIVERT32_SYS" $INSTALL/x86 |
| 88 | +if ! grep "DigiCert High Assurance EV Root" $INSTALL/x86/WinDivert32.sys \ |
| 89 | + 2>&1 >/dev/null |
| 90 | +then |
| 91 | + echo "\t\033[33mWARNING\033[0m: unsigned WinDivert32.sys..." |
| 92 | +fi |
| 93 | +if [ -d "$WINDIVERT64_SYS" ] |
| 94 | +then |
| 95 | + echo "\tcopy $INSTALL/x64/WinDivert64.sys..." |
| 96 | + cp "$WINDIVERT64_SYS" $INSTALL/x86 |
| 97 | +fi |
| 98 | +echo "\tcopy $INSTALL/x86/WinDivert.lib..." |
| 99 | +cp install/$TARGET/i386/WinDivert.lib $INSTALL/x86 |
| 100 | +echo "\tcopy $INSTALL/x86/WinDivert.dll..." |
| 101 | +cp install/$TARGET/i386/WinDivert.dll $INSTALL/x86 |
| 102 | +echo "\tcopy $INSTALL/x86/netdump.exe..." |
| 103 | +cp install/$TARGET/i386/netdump.exe $INSTALL/x86 |
| 104 | +echo "\tcopy $INSTALL/x86/netfilter.exe..." |
| 105 | +cp install/$TARGET/i386/netfilter.exe $INSTALL/x86 |
| 106 | +echo "\tcopy $INSTALL/x86/passtru.exe..." |
| 107 | +cp install/$TARGET/i386/passthru.exe $INSTALL/x86 |
| 108 | +echo "\tcopy $INSTALL/x86/webfilter.exe..." |
| 109 | +cp install/$TARGET/i386/webfilter.exe $INSTALL/x86 |
| 110 | +echo "\tcopy $INSTALL/x86/streamdump.exe..." |
| 111 | +cp install/$TARGET/i386/streamdump.exe $INSTALL/x86 |
| 112 | +echo "\tcopy $INSTALL/x86/flowtrack.exe..." |
| 113 | +cp install/$TARGET/i386/flowtrack.exe $INSTALL/x86 |
| 114 | +echo "\tcopy $INSTALL/x86/socketdump.exe..." |
| 115 | +cp install/$TARGET/i386/socketdump.exe $INSTALL/x86 |
| 116 | +echo "\tcopy $INSTALL/x86/windivertctl.exe..." |
| 117 | +cp install/$TARGET/i386/windivertctl.exe $INSTALL/x86 |
| 118 | +echo "\tcopy $INSTALL/x86/test.exe..." |
| 119 | +cp install/$TARGET/i386/test.exe $INSTALL/x86 |
| 120 | +if [ -d "install/$TARGET/amd64" ] |
| 121 | +then |
| 122 | + echo "\tmake $INSTALL/amd64..." |
| 123 | + mkdir -p $INSTALL/x64 |
| 124 | + echo "\tcopy $INSTALL/amd64/WinDivert64.sys..." |
| 125 | + cp "$WINDIVERT64_SYS" $INSTALL/x64 |
| 126 | + if ! grep "DigiCert High Assurance EV Root" \ |
| 127 | + $INSTALL/x64/WinDivert64.sys 2>&1 >/dev/null |
108 | 128 | then |
109 | | - echo "\tmake $INSTALL/amd64..." |
110 | | - mkdir -p $INSTALL/x64 |
111 | | - echo "\tcopy $INSTALL/amd64/WinDivert64.sys..." |
112 | | - cp install/$TARGET/amd64/WinDivert64.sys $INSTALL/x64 |
113 | | - if ! grep "DigiCert High Assurance EV Root" \ |
114 | | - $INSTALL/x64/WinDivert64.sys 2>&1 >/dev/null |
115 | | - then |
116 | | - echo "\t\033[33mWARNING\033[0m: unsigned WinDivert64.sys..." |
117 | | - fi |
118 | | - echo "\tcopy $INSTALL/x64/WinDivert.lib..." |
119 | | - cp install/$TARGET/amd64/WinDivert.lib $INSTALL/x64 |
120 | | - echo "\tcopy $INSTALL/x64/WinDivert.dll..." |
121 | | - cp install/$TARGET/amd64/WinDivert.dll $INSTALL/x64 |
122 | | - echo "\tcopy $INSTALL/x64/netdump.exe..." |
123 | | - cp install/$TARGET/amd64/netdump.exe $INSTALL/x64 |
124 | | - echo "\tcopy $INSTALL/x64/netfilter.exe..." |
125 | | - cp install/$TARGET/amd64/netfilter.exe $INSTALL/x64 |
126 | | - echo "\tcopy $INSTALL/x64/passtru.exe..." |
127 | | - cp install/$TARGET/amd64/passthru.exe $INSTALL/x64 |
128 | | - echo "\tcopy $INSTALL/x64/webfilter.exe..." |
129 | | - cp install/$TARGET/amd64/webfilter.exe $INSTALL/x64 |
130 | | - echo "\tcopy $INSTALL/x64/streamdump.exe..." |
131 | | - cp install/$TARGET/amd64/streamdump.exe $INSTALL/x64 |
132 | | - echo "\tcopy $INSTALL/x64/flowtrack.exe..." |
133 | | - cp install/$TARGET/amd64/flowtrack.exe $INSTALL/x64 |
134 | | - echo "\tcopy $INSTALL/x64/socketdump.exe..." |
135 | | - cp install/$TARGET/amd64/socketdump.exe $INSTALL/x64 |
136 | | - echo "\tcopy $INSTALL/x64/windivertctl.exe..." |
137 | | - cp install/$TARGET/amd64/windivertctl.exe $INSTALL/x64 |
138 | | - echo "\tcopy $INSTALL/x64/test.exe..." |
139 | | - cp install/$TARGET/amd64/test.exe $INSTALL/x64 |
140 | | - else |
141 | | - echo "\tWARNING: skipping missing AMD64 build..." |
| 129 | + echo "\t\033[33mWARNING\033[0m: unsigned WinDivert64.sys..." |
142 | 130 | fi |
143 | | - PACKAGE=$NAME.zip |
144 | | - echo "\tbuilding $PACKAGE..." |
145 | | - ( |
146 | | - cd install; |
147 | | - zip -r $PACKAGE $NAME > /dev/null |
148 | | - ) |
149 | | - echo -n "\tclean $INSTALL..." |
150 | | - rm -rf $INSTALL |
151 | | - echo "DONE" |
152 | | -done |
| 131 | + echo "\tcopy $INSTALL/x64/WinDivert.lib..." |
| 132 | + cp install/$TARGET/amd64/WinDivert.lib $INSTALL/x64 |
| 133 | + echo "\tcopy $INSTALL/x64/WinDivert.dll..." |
| 134 | + cp install/$TARGET/amd64/WinDivert.dll $INSTALL/x64 |
| 135 | + echo "\tcopy $INSTALL/x64/netdump.exe..." |
| 136 | + cp install/$TARGET/amd64/netdump.exe $INSTALL/x64 |
| 137 | + echo "\tcopy $INSTALL/x64/netfilter.exe..." |
| 138 | + cp install/$TARGET/amd64/netfilter.exe $INSTALL/x64 |
| 139 | + echo "\tcopy $INSTALL/x64/passtru.exe..." |
| 140 | + cp install/$TARGET/amd64/passthru.exe $INSTALL/x64 |
| 141 | + echo "\tcopy $INSTALL/x64/webfilter.exe..." |
| 142 | + cp install/$TARGET/amd64/webfilter.exe $INSTALL/x64 |
| 143 | + echo "\tcopy $INSTALL/x64/streamdump.exe..." |
| 144 | + cp install/$TARGET/amd64/streamdump.exe $INSTALL/x64 |
| 145 | + echo "\tcopy $INSTALL/x64/flowtrack.exe..." |
| 146 | + cp install/$TARGET/amd64/flowtrack.exe $INSTALL/x64 |
| 147 | + echo "\tcopy $INSTALL/x64/socketdump.exe..." |
| 148 | + cp install/$TARGET/amd64/socketdump.exe $INSTALL/x64 |
| 149 | + echo "\tcopy $INSTALL/x64/windivertctl.exe..." |
| 150 | + cp install/$TARGET/amd64/windivertctl.exe $INSTALL/x64 |
| 151 | + echo "\tcopy $INSTALL/x64/test.exe..." |
| 152 | + cp install/$TARGET/amd64/test.exe $INSTALL/x64 |
| 153 | +else |
| 154 | + echo "\tWARNING: skipping missing AMD64 build..." |
| 155 | +fi |
| 156 | +PACKAGE=$NAME$LABEL.zip |
| 157 | +echo "\tbuilding $PACKAGE..." |
| 158 | +( |
| 159 | + cd install; |
| 160 | + zip -r $PACKAGE $NAME$LABEL > /dev/null |
| 161 | +) |
| 162 | +echo -n "\tclean $INSTALL..." |
| 163 | +rm -rf $INSTALL |
| 164 | +echo "DONE" |
153 | 165 |
|
0 commit comments