WinGit: strip executables (Issue 25)
[git/jnareb-git.git] / share / WinGit / release.sh
blob4297287842134ce6e8189384a3b3e5199286f40a
1 #!/bin/sh
3 test -z "$1" && {
4 echo "Usage: $0 <version>"
5 exit 1
8 TARGET="$HOME"/WinGit-$1.exe
9 OPTS7="-m0=lzma -mx=9 -md=64M"
10 TARGET7=tmp.7z
11 LIST7=fileList.txt
12 TMPDIR=/tmp/WinGit
14 (test ! -d "$TMPDIR" || echo "Removing $TMPDIR" && rm -rf "$TMPDIR") &&
15 mkdir "$TMPDIR" &&
16 cd "$TMPDIR" &&
17 echo "Copying files" &&
18 (cd / && tar cf - bin/ lib/perl5/) |
19 tar xvf - &&
20 (cd /mingw && tar cf - bin/*{tcl,tk,wish,gpg,curl.exe}* \
21 lib/*{tcl,tk}* libexec/gnupg/) |
22 tar xvf - &&
23 strip bin/{[a-fh-z],g[a-oq-z],gp[a-fh-z]}*.exe &&
24 mkdir etc &&
25 cp /etc/profile etc/ &&
26 cp /share/WinGit/install.tcl ./ &&
27 : > "$LIST7" &&
28 find * -type f | sed "s|^\./||" > "$LIST7" &&
29 7z a $OPTS7 $TARGET7 @"$LIST7" ||
30 exit
32 (cat /share/7-Zip/7zSD.sfx &&
33 echo ';!@Install@!UTF-8!' &&
34 echo 'Progress="yes"' &&
35 echo 'Directory="%%T\bin"' &&
36 echo 'RunProgram="wish.exe %%T\install.tcl %%T"' &&
37 echo ';!@InstallEnd@!7z' &&
38 cat $TARGET7) > "$TARGET"
39 exit