WinGit: only copy the files from /bin/ that are really necessary
[git/jnareb-git.git] / share / WinGit / release.sh
blob0c1be6c5ef63848f758da33af38f88dcae4e162c
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 "$(dirname "$0")" &&
17 make &&
18 mkdir "$TMPDIR"/bin &&
19 cp create-shortcut.exe "$TMPDIR"/bin) &&
20 cd "$TMPDIR" &&
21 echo "Copying files" &&
22 (cd / && tar cf - bin/{git*,awk,basename.exe,bash.exe,bunzip2,bzip2.exe,cat.exe,chmod.exe,clear,cmp.exe,cp.exe,cpio,cut.exe,cvs.exe,date.exe,diff.exe,du.exe,echo,egrep,env.exe,expr.exe,false.exe,find.exe,gawk.exe,grep.exe,gunzip,gzip.exe,head.exe,id.exe,less.exe,libW11.dll,ln.exe,ls.exe,md5sum.exe,mkdir.exe,msys-1.0.dll,msysltdl-3.dll,mv.exe,patch.exe,patch.exe.manifest,perl.exe,printf,ps.exe,pwd,rm.exe,rmdir.exe,rxvt.exe,scp.exe,sed.exe,sh.exe,sleep.exe,sort.exe,split.exe,ssh-agent.exe,ssh.exe,tail.exe,tar.exe,tee.exe,touch.exe,tr.exe,true.exe,uname.exe,uniq.exe,vi,vim.exe,wc.exe,which,xargs.exe} lib/perl5/) |
23 tar xvf - &&
24 gitmd5=$(md5sum bin/git.exe | cut -c 1-32) &&
25 md5sum bin/git-*.exe | sed -n "s/^$gitmd5 \\*//p" > fileList-builtins.txt &&
26 rm $(cat fileList-builtins.txt) &&
27 (cd /mingw && tar cf - bin/*{tcl,tk,wish,gpg,curl.exe}* \
28 lib/*{tcl,tk}* libexec/gnupg/) |
29 tar xvf - &&
30 strip bin/{[a-fh-z],g[a-oq-z]}*.exe &&
31 mkdir etc &&
32 cp /git/contrib/completion/git-completion.bash etc/ &&
33 sed 's/^\. .*\(git-completion.bash\)/. \/etc\/\1/' \
34 < /etc/profile > etc/profile &&
35 cp /share/resources/git.ico etc/ &&
36 cp /share/WinGit/install.tcl ./ &&
37 : > "$LIST7" &&
38 find * -type f | sed "s|^\./||" > "$LIST7" &&
39 7z a $OPTS7 $TARGET7 @"$LIST7" ||
40 exit
42 (cat /share/7-Zip/7zSD.sfx &&
43 echo ';!@Install@!UTF-8!' &&
44 echo 'Progress="yes"' &&
45 echo 'Title="WinGit: MinGW Git + minimal MSys installation"' &&
46 echo 'BeginPrompt="This program installes a complete Git for MSys setup"' &&
47 echo 'CancelPrompt="Do you want to cancel WinGit installation?"' &&
48 echo 'ExtractDialogText="Please, wait..."' &&
49 echo 'ExtractPathText="Where do you want to install WinGit?"' &&
50 echo 'ExtractTitle="Extracting..."' &&
51 echo 'GUIFlags="8+32+64+256+4096"' &&
52 echo 'GUIMode="1"' &&
53 echo 'InstallPath="%PROGRAMFILES%\\Git"' &&
54 echo 'OverwriteMode="2"' &&
55 echo 'RunProgram="\"%%T\\bin\\wish.exe\" \"%%T\install.tcl\" \"%%T\""' &&
56 echo ';!@InstallEnd@!7z' &&
57 cat $TARGET7) > "$TARGET"
58 exit