updated to modern VTK
[engrid-github.git] / src / scripts / makebindist.bash
blobaf78263393edb43ef55c9b2db82a02369d49d990
1 #!/usr/bin/env bash
2 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 # + +
4 # + This file is part of enGrid. +
5 # + +
6 # + Copyright 2008-2014 enGits GmbH +
7 # + +
8 # + enGrid is free software: you can redistribute it and/or modify +
9 # + it under the terms of the GNU General Public License as published by +
10 # + the Free Software Foundation, either version 3 of the License, or +
11 # + (at your option) any later version. +
12 # + +
13 # + enGrid is distributed in the hope that it will be useful, +
14 # + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 # + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 # + GNU General Public License for more details. +
17 # + +
18 # + You should have received a copy of the GNU General Public License +
19 # + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
20 # + +
21 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 set -e -x -u
25 # TMPDIR=$(mktemp -d)
26 # echo "================"
27 # echo "TMPDIR = $TMPDIR"
28 # echo "================"
30 # ldd ./engrid > $TMPDIR/ldd.out
31 # mkdir $TMPDIR/enGrid
32 # #cp engrid $TMPDIR/enGrid
33 # #cp start_engrid enGrid
34 # tar -czvf enGrid_bin.tar.gz $TMPDIR/enGrid/*
35 # # rm -rf enGrid
36 # # rm ldd.out
38 # exit 0
40 # Check if all parameters are present
41 # If no, exit
42 if [ $# -ne 3 ]
43 then
44 echo "usage :"
45 echo "`basename $0` VERSION SRCDIR ARCHITECTURE"
46 echo "You must run this script from SRCDIR/.."
47 exit 0
50 VERSION=$1
51 #SRCDIR=$(readlink -f $2)
52 SRCDIR=$2
53 ARCH=$3
55 ORIG_WD=$(pwd)
57 #define variables
58 tarname="enGrid_linux"$ARCH"bit_"$VERSION".tar"
59 gzname="enGrid_linux"$ARCH"bit_"$VERSION".tar.gz"
60 dirname="enGrid_linux"$ARCH"bit_"$VERSION
62 saferemove()
64 TARGET=$(readlink -f $1)
65 if [ -e $TARGET ]
66 then
67 echo "$TARGET already exists."
68 echo "rm -v $TARGET ?(y/n/q)"
69 read ans
70 case $ans in
71 y|Y|yes) rm -v $TARGET;;
72 q) exit 0;;
73 *) echo "proceeding without removing";;
74 esac
78 saferemove_recursive()
80 TARGET=$(readlink -f $1)
81 if [ -e $TARGET ]
82 then
83 echo "$TARGET already exists."
84 echo "rm -rfv $TARGET ?(y/n/q)"
85 read ans
86 case $ans in
87 y|Y|yes) rm -rfv $TARGET;;
88 q) exit 0;;
89 *) echo "proceeding without removing";;
90 esac
94 # remove traces from last use
95 saferemove_recursive tmp
96 saferemove $tarname
98 #TMP=$(mktemp -d)
99 #TMP=/tmp/toto
101 #if [ -e $TMP ]
102 #then
103 # echo "$TMP already exists."
104 # echo "rm -rfv $TMP ?(y/n/q)"
105 # read ans
106 # case $ans in
107 # y|Y|yes) rm -rfv $TMP;;
108 # q) exit 0;;
109 # *) echo "proceeding without removing";;
110 # esac
113 #mkdir -p $TMP
115 #get all dependencies
116 cd $SRCDIR
117 ./engrid -distbin
118 #mv -v enGrid_bin.tar.gz $TMP
120 #clean up
121 #cd $SRCDIR
122 qmake
123 make distclean
124 cd netgen_svn
125 qmake
126 make distclean
127 cd ../..
129 #add scripts + dependencies
131 tar -f $tarname -r $SRCDIR/distribution/setup
132 #tar -f $tarname -r $SRCDIR/start_engrid
133 tar -f $tarname -r $SRCDIR/enGrid_bin.tar.gz
134 tar -f $tarname -r $SRCDIR/distribution/README
136 #change back to SRCDIR + add source files
137 tar -f $tarname -r $SRCDIR/*.h
138 tar -f $tarname -r $SRCDIR/*.cpp
139 tar -f $tarname -r $SRCDIR/*.cxx
140 tar -f $tarname -r $SRCDIR/*.ui
141 tar -f $tarname -r $SRCDIR/licence.txt
142 tar -f $tarname -r $SRCDIR/resources
143 tar -f $tarname -r $SRCDIR/engrid.pro
144 tar -f $tarname -r $SRCDIR/engrid.qrc
145 tar -f $tarname -r $SRCDIR/math/*.h
146 tar -f $tarname -r $SRCDIR/netgen_svn/netgen-mesher/netgen
147 tar -f $tarname -r $SRCDIR/netgen_svn/ng.pro
149 #cd /tmp
150 #tar -czvf $gzname $TMP
151 #mv -v $gzname $ORIG_WD
153 #exit 0
155 #extract .tar in ./tmp
157 mkdir -p tmp
158 cd tmp
159 tar xf ../$tarname
162 #rename the extracted dir
163 mv $SRCDIR $dirname
164 tar czf $gzname $dirname
165 mv $gzname ..
166 cd ..
167 saferemove_recursive tmp
168 saferemove $tarname