Commit 23a87c2bf3703e80db4769e0485f30affc0f1f2a

Authored by Perry Werneck
1 parent 368dc170

Melhorando construção automática de pacotes windows.

Showing 3 changed files with 73 additions and 24 deletions   Show diff stats
@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
13 *.depend 13 *.depend
14 *.tar 14 *.tar
15 *.bz2 15 *.bz2
  16 +*.cache
16 ChangeLog* 17 ChangeLog*
17 Makefile 18 Makefile
18 aclocal.m4 19 aclocal.m4
@@ -5,7 +5,7 @@ msgid "" @@ -5,7 +5,7 @@ msgid ""
5 msgstr "" 5 msgstr ""
6 "Project-Id-Version: pw3270 5.0\n" 6 "Project-Id-Version: pw3270 5.0\n"
7 "Report-Msgid-Bugs-To: \n" 7 "Report-Msgid-Bugs-To: \n"
8 -"POT-Creation-Date: 2015-11-03 15:43-0200\n" 8 +"POT-Creation-Date: 2015-11-09 16:05-0200\n"
9 "PO-Revision-Date: 2014-02-17 08:05-0300\n" 9 "PO-Revision-Date: 2014-02-17 08:05-0300\n"
10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 "Language-Team: Portugues <>\n" 11 "Language-Team: Portugues <>\n"
@@ -8,7 +8,6 @@ cleanup() @@ -8,7 +8,6 @@ cleanup()
8 cd ${myDIR} 8 cd ${myDIR}
9 rm -fr ${TEMPDIR} 9 rm -fr ${TEMPDIR}
10 rm -fr ${RUNTIMEDIR} 10 rm -fr ${RUNTIMEDIR}
11 - rm -fr ${DESTDIR}  
12 exit -1 11 exit -1
13 } 12 }
14 13
@@ -22,24 +21,58 @@ failed() @@ -22,24 +21,58 @@ failed()
22 # 21 #
23 # Copia pacote gerado 22 # Copia pacote gerado
24 # 23 #
25 -# $1 = Arquitetura (x86_32/x86_64) 24 +# $1 = Arquitetura (i686/x86_64)
26 # $2 = Tipo do link 25 # $2 = Tipo do link
27 # 26 #
28 CopyPacket() 27 CopyPacket()
29 { 28 {
  29 + #
  30 + # Primeiro move a versão baseada no runtime
  31 + #
  32 + FILENAME=$(find nsi -maxdepth 1 -name "pw3270-*-requires-gtk-*-${1}.exe" | head --lines 1)
30 33
31 - FILENAME=$(find nsi -maxdepth 1 -name "*.exe" | head --lines 1 | sed "s@./@@g") 34 + if [ ! -z ${FILENAME} ]; then
32 35
33 - mkdir -p ${DESTDIR}/${1} 36 + mkdir -p ${DESTDIR}/${1}
  37 +
  38 + echo "Copiando ${FILENAME} para ${DESTDIR}/${1}"
  39 +
  40 + mv "${FILENAME}" "${DESTDIR}/${1}"
  41 + if [ "$?" != "0" ]; then
  42 + echo "src=${FILENAME}"
  43 + echo "dst=${DESTDIR}/${1}"
  44 + failed "Erro ao copiar instalador sem o runtime"
  45 + fi
34 46
35 - cp ${FILENAME} ${DESTDIR}/${1}  
36 - if [ "$?" != "0" ]; then  
37 - failed "Erro ao copiar instalador"  
38 fi 47 fi
39 48
40 - ln -sf ${FILENAME} ${DESTDIR}/${1}/pw3270-${1}-${2}.exe  
41 - if [ "$?" != "0" ]; then  
42 - failed "Erro ao criar o link simbólico" 49 + #
  50 + # Depois copia o pacote completo
  51 + #
  52 + FILENAME=$(find nsi -maxdepth 1 -name "pw3270-*-gtk-*-${1}.exe" | head --lines 1)
  53 +
  54 + if [ ! -z ${FILENAME} ]; then
  55 +
  56 + mkdir -p ${DESTDIR}/${1}
  57 +
  58 + echo "Copiando ${FILENAME} para ${DESTDIR}/${1}"
  59 +
  60 + mv "${FILENAME}" "${DESTDIR}/${1}"
  61 + if [ "$?" != "0" ]; then
  62 + echo "src=${FILENAME}"
  63 + echo "dst=${DESTDIR}/${1}"
  64 + failed "Erro ao copiar instalador completo"
  65 + fi
  66 +
  67 + #
  68 + # Cria link do pacote completo para "latest"
  69 + #
  70 + ln -sf $(basename ${FILENAME}) ${DESTDIR}/${1}/pw3270-with-gtk-${2}-${1}.exe
  71 + if [ "$?" != "0" ]; then
  72 + failed "Erro ao criar o link simbólico"
  73 + fi
  74 +
  75 +
43 fi 76 fi
44 77
45 } 78 }
@@ -74,7 +107,7 @@ build() @@ -74,7 +107,7 @@ build()
74 esac 107 esac
75 108
76 ./configure \ 109 ./configure \
77 - --cache-file=${1}.cache \ 110 + --cache-file=.${1}.cache \
78 --host=${host} \ 111 --host=${host} \
79 --prefix=${prefix} 112 --prefix=${prefix}
80 113
@@ -117,7 +150,7 @@ build() @@ -117,7 +150,7 @@ build()
117 failed "Erro ao gerar pacote windows" 150 failed "Erro ao gerar pacote windows"
118 fi 151 fi
119 152
120 - CopyPacket ${1} "latest" 153 + CopyPacket ${host_cpu} "latest"
121 154
122 make clean 155 make clean
123 rm -f *.exe 156 rm -f *.exe
@@ -128,7 +161,6 @@ myDIR=$(readlink -f $(dirname $0)) @@ -128,7 +161,6 @@ myDIR=$(readlink -f $(dirname $0))
128 TEMPDIR=$(mktemp -d) 161 TEMPDIR=$(mktemp -d)
129 DESTDIR=${HOME}/public_html/win 162 DESTDIR=${HOME}/public_html/win
130 RUNTIMEDIR=$(mktemp -d) 163 RUNTIMEDIR=$(mktemp -d)
131 -SRC=svn  
132 ARCHS="x86_32 x86_64" 164 ARCHS="x86_32 x86_64"
133 RUNTIME=0 165 RUNTIME=0
134 COMPLETE=1 166 COMPLETE=1
@@ -144,13 +176,16 @@ do @@ -144,13 +176,16 @@ do
144 176
145 case $parameter in 177 case $parameter in
146 178
147 - SRC)  
148 - value=${tmp##*=}  
149 - eval SRC=$value 179 + 32)
  180 + ARCHS="x86_32"
  181 + ;;
  182 +
  183 + 64)
  184 + ARCHS="x86_64"
150 ;; 185 ;;
151 186
152 FULL) 187 FULL)
153 - RUNTIME=0 188 + RUNTIME=1
154 COMPLETE=1 189 COMPLETE=1
155 ;; 190 ;;
156 191
@@ -200,12 +235,11 @@ if [ &quot;${RUNTIME}&quot; == &quot;1&quot; ]; then @@ -200,12 +235,11 @@ if [ &quot;${RUNTIME}&quot; == &quot;1&quot; ]; then
200 235
201 for i in ${ARCHS}; do 236 for i in ${ARCHS}; do
202 237
203 - rm -f *.exe  
204 -  
205 echo -e "\e]2;gtk-runtime-${i}\a" 238 echo -e "\e]2;gtk-runtime-${i}\a"
206 239
207 case ${i} in 240 case ${i} in
208 x86_32) 241 x86_32)
  242 + host_cpu=i686
209 ./win32.sh 243 ./win32.sh
210 if [ "$?" != "0" ]; then 244 if [ "$?" != "0" ]; then
211 exit -1 245 exit -1
@@ -213,6 +247,7 @@ if [ &quot;${RUNTIME}&quot; == &quot;1&quot; ]; then @@ -213,6 +247,7 @@ if [ &quot;${RUNTIME}&quot; == &quot;1&quot; ]; then
213 ;; 247 ;;
214 248
215 x86_64) 249 x86_64)
  250 + host_cpu=x86_64
216 ./win64.sh 251 ./win64.sh
217 if [ "$?" != "0" ]; then 252 if [ "$?" != "0" ]; then
218 exit -1 253 exit -1
@@ -225,6 +260,9 @@ if [ &quot;${RUNTIME}&quot; == &quot;1&quot; ]; then @@ -225,6 +260,9 @@ if [ &quot;${RUNTIME}&quot; == &quot;1&quot; ]; then
225 260
226 esac 261 esac
227 262
  263 + rm -f gtk-runtime-*-${host_cpu}.exe
  264 +
  265 +
228 chmod +x ./makeruntime.sh 266 chmod +x ./makeruntime.sh
229 267
230 ./makeruntime.sh 268 ./makeruntime.sh
@@ -232,11 +270,21 @@ if [ &quot;${RUNTIME}&quot; == &quot;1&quot; ]; then @@ -232,11 +270,21 @@ if [ &quot;${RUNTIME}&quot; == &quot;1&quot; ]; then
232 exit -1 270 exit -1
233 fi 271 fi
234 272
235 - cp *.exe ${DESTDIR}/${i} 273 + # Copia o pacote gerado
  274 + FILENAME=$(find . -maxdepth 1 -name "gtk-runtime-*-${host_cpu}.exe" | head --lines 1)
  275 +
  276 + mkdir -p ${DESTDIR}/${host_cpu}
  277 +
  278 + mv gtk-runtime-*-${host_cpu}.exe ${DESTDIR}/${host_cpu}
236 if [ "$?" != "0" ]; then 279 if [ "$?" != "0" ]; then
237 failed "Erro ao copiar instalador" 280 failed "Erro ao copiar instalador"
238 fi 281 fi
239 282
  283 + ln -sf $(basename ${FILENAME}) "${DESTDIR}/${host_cpu}/gtk-runtime-latest-${host_cpu}.exe"
  284 + if [ "$?" != "0" ]; then
  285 + failed "Erro ao criar o link simbólico"
  286 + fi
  287 +
240 done 288 done
241 289
242 fi 290 fi
@@ -245,9 +293,9 @@ cd $myDIR @@ -245,9 +293,9 @@ cd $myDIR
245 rm -fr ${TEMPDIR} 293 rm -fr ${TEMPDIR}
246 rm -fr ${RUNTIMEDIR} 294 rm -fr ${RUNTIMEDIR}
247 295
248 -zip -r -j ${HOME}/public_html/win/pw3270-latest.zip \  
249 - ${HOME}/public_html/win/x86_32/pw3270-x86_32-latest.exe \  
250 - ${HOME}/public_html/win/x86_64/pw3270-x86_64-latest.exe 296 +#zip -r -j ${HOME}/public_html/win/pw3270-latest.zip \
  297 +# ${HOME}/public_html/win/x86_32/pw3270-x86_32-latest.exe \
  298 +# ${HOME}/public_html/win/x86_64/pw3270-x86_64-latest.exe
251 299
252 echo -e "\e]2;Success!\a" 300 echo -e "\e]2;Success!\a"
253 301