shell prompt should not beep and only show MSYSTEM when non-standard.
[msysgit.git] / src / tcltk / release-tkImg.sh
blob0fdc94404d6f6c5b632c7c17bde1d534a821cad7
1 #!/bin/sh
3 # This is a package updating script for msysGit
5 cd "$(dirname "$0")" || {
6 echo "Could not switch to $(dirname "$0")"
7 exit 1
10 package=TkImg
11 list=fileList-tkImg.txt
12 version=1.3
13 dir=tkimg$version
14 tar=tkimg$version.tar.bz2
15 taropt=-j
16 url=http://kent.dl.sourceforge.net/sourceforge/tkimg/$tar
18 patch_tkImg () {
19 init_git &&
20 git rev-parse --verify HEAD^ || {
21 perl -i.bak -pe "s/(MP-RAS.*relid)\'/\\1/" \
22 $(find -name configure) &&
23 perl -i.bak -pe "s/EXTERN (int TkimgInitUtilities)/\\1/" \
24 base/tkimg.c &&
25 git commit -m "fix configure" -a
29 patch=patch_tkImg
31 configure_extra=--srcdir=$(pwd)/$dir
33 premake_tkImg () {
34 perl -i.bak -pe "s/-L(\\S+) -l(tkimgstub\S+)/\\1\/\\2.a/" \
35 $(find -name Makefile)
38 premake=premake_tkImg
40 # The functions (overridable by setting $fetch, $unpack, $compile or $install)
42 fetch_it () {
43 test -f $tar || curl $url > $tar
46 test -z "$fetch" && fetch=fetch_it
48 unpack_it () {
49 test -d $dir || tar -xv $taropt -f $tar
52 test -z "$unpack" && unpack=unpack_it
54 test -z "$premake" && premake=true
56 compile_it () {
57 test -f Makefile || {
58 ./configure --prefix=/mingw $configure_extra &&
59 $premake &&
60 make
64 test -z "$compile" && compile=compile_it
66 install_it () {
67 make install
70 test -z "$install" && install=install_it
72 init_git () {
73 test -d .git || {
74 git init &&
75 git add . &&
76 git commit -m "imported $package $version"
80 # Do the real work
82 $fetch &&
84 $unpack &&
86 (cd $dir &&
88 $patch &&
90 $compile
91 ) &&
93 # Install
95 index=$(/share/msysGit/pre-install.sh) &&
97 # Remove old files stored in the file list
98 cat $list | (cd / && xargs -r git rm) &&
100 (cd $dir && $install) &&
102 /share/msysGit/post-install.sh $index "Install $package $version" &&
104 git diff --diff-filter=AM --name-only HEAD^! |
105 sed -e "s/^/\//" > $list &&
106 git commit -C HEAD --amend $list ||
107 exit
109 echo "Successfully built and installed $package $version"
110 echo "After checking the result, please commit (possibly with --amend)"
111 echo