Commit 16c3dd17fcf8713e9c5947178840908aadd2cf2e
1 parent
12f57b04
Exists in
master
and in
5 other branches
Updating windows installer.
Showing
4 changed files
with
419 additions
and
714 deletions
Show diff stats
win/hllapipacket.sh
| @@ -1,136 +0,0 @@ | @@ -1,136 +0,0 @@ | ||
| 1 | -#!/bin/bash | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -# | ||
| 5 | -# Gera binários windows | ||
| 6 | -# | ||
| 7 | -# $1 = Arquitetura (x86_32/x86_64) | ||
| 8 | -# | ||
| 9 | -build() | ||
| 10 | -{ | ||
| 11 | - echo -e "\e]2;${PACKAGE_NAME}-${1}\a" | ||
| 12 | - | ||
| 13 | - case ${1} in | ||
| 14 | - x86_32) | ||
| 15 | - host=i686-w64-mingw32 | ||
| 16 | - host_cpu=i686 | ||
| 17 | - prefix=/usr/i686-w64-mingw32/sys-root/mingw | ||
| 18 | - tools=i686-w64-mingw32 | ||
| 19 | - ;; | ||
| 20 | - | ||
| 21 | - x86_64) | ||
| 22 | - host=x86_64-w64-mingw32 | ||
| 23 | - host_cpu=x86_64 | ||
| 24 | - prefix=/usr/x86_64-w64-mingw32/sys-root/mingw | ||
| 25 | - tools=x86_64-w64-mingw32 | ||
| 26 | - ;; | ||
| 27 | - | ||
| 28 | - | ||
| 29 | - *) | ||
| 30 | - failed "Arquitetura desconhecida: ${1}" | ||
| 31 | - | ||
| 32 | - esac | ||
| 33 | - | ||
| 34 | - # Detecto argumentos | ||
| 35 | - ARGS="" | ||
| 36 | - | ||
| 37 | - ./configure \ | ||
| 38 | - --cache-file=.${1}.cache \ | ||
| 39 | - --host=${host} \ | ||
| 40 | - --prefix=${prefix} \ | ||
| 41 | - --disable-rexx | ||
| 42 | - --disable-java \ | ||
| 43 | - --disable-office | ||
| 44 | - | ||
| 45 | - if [ "$?" != "0" ]; then | ||
| 46 | - failed "Erro ao configurar" | ||
| 47 | - fi | ||
| 48 | - | ||
| 49 | - make clean | ||
| 50 | - rm -f *.exe | ||
| 51 | - | ||
| 52 | - make Release | ||
| 53 | - if [ "$?" != "0" ]; then | ||
| 54 | - failed "Erro ao compilar fontes" | ||
| 55 | - fi | ||
| 56 | - | ||
| 57 | - mkdir -p ${TEMPDIR}/package/${host_cpu} | ||
| 58 | - | ||
| 59 | - cp -v .bin/Release/hllapi.dll* ${TEMPDIR}/package/${host_cpu} | ||
| 60 | - if [ "$?" != "0" ]; then | ||
| 61 | - failed "Erro ao copiar pacotes" | ||
| 62 | - fi | ||
| 63 | - | ||
| 64 | - make clean | ||
| 65 | - rm -f *.exe | ||
| 66 | - | ||
| 67 | -} | ||
| 68 | - | ||
| 69 | -myDIR=$(readlink -f $(dirname $0)) | ||
| 70 | -TEMPDIR=$(mktemp -d) | ||
| 71 | -DESTDIR=${HOME}/public_html/win | ||
| 72 | -RUNTIMEDIR=$(mktemp -d) | ||
| 73 | -ARCHS="x86_32 x86_64" | ||
| 74 | -RUNTIME=1 | ||
| 75 | -COMPLETE=1 | ||
| 76 | - | ||
| 77 | -trap cleanup INT | ||
| 78 | - | ||
| 79 | -until [ -z "$1" ] | ||
| 80 | -do | ||
| 81 | - if [ ${1:0:2} = '--' ]; then | ||
| 82 | - tmp=${1:2} | ||
| 83 | - parameter=${tmp%%=*} | ||
| 84 | - parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") | ||
| 85 | - | ||
| 86 | - case $parameter in | ||
| 87 | - | ||
| 88 | - 32) | ||
| 89 | - ARCHS="x86_32" | ||
| 90 | - ;; | ||
| 91 | - | ||
| 92 | - 64) | ||
| 93 | - ARCHS="x86_64" | ||
| 94 | - ;; | ||
| 95 | - | ||
| 96 | - OUT) | ||
| 97 | - DESTDIR=$value | ||
| 98 | - ;; | ||
| 99 | - | ||
| 100 | - ARCH) | ||
| 101 | - value=${tmp##*=} | ||
| 102 | - ARCHS=$value | ||
| 103 | - ;; | ||
| 104 | - | ||
| 105 | - *) | ||
| 106 | - value=${tmp##*=} | ||
| 107 | - eval $parameter=$value | ||
| 108 | - esac | ||
| 109 | - | ||
| 110 | - fi | ||
| 111 | - | ||
| 112 | - shift | ||
| 113 | -done | ||
| 114 | - | ||
| 115 | -# Configura | ||
| 116 | -aclocal | ||
| 117 | -if [ "$?" != "0" ]; then | ||
| 118 | - exit -1 | ||
| 119 | -fi | ||
| 120 | - | ||
| 121 | -autoconf | ||
| 122 | -if [ "$?" != "0" ]; then | ||
| 123 | - exit -1 | ||
| 124 | -fi | ||
| 125 | - | ||
| 126 | -# Gera pacotes | ||
| 127 | -for i in ${ARCHS}; do | ||
| 128 | - | ||
| 129 | - build "${i}" | ||
| 130 | - | ||
| 131 | -done | ||
| 132 | - | ||
| 133 | -cd ${TEMPDIR}/package | ||
| 134 | - | ||
| 135 | -zip -9 -m -r ~/public_html/win/hllapi_$(date "+%Y%m%d").zip . | ||
| 136 | - |
win/makegtkruntime.sh.in
| @@ -1,352 +0,0 @@ | @@ -1,352 +0,0 @@ | ||
| 1 | -#!/bin/bash | ||
| 2 | -PKG_CONFIG="@PKG_CONFIG@" | ||
| 3 | -GTK_VERSION="gtk+-@GTK_VERSION@" | ||
| 4 | - | ||
| 5 | -GTK_PREFIX=$($PKG_CONFIG --variable=prefix $GTK_VERSION) | ||
| 6 | -TARGET_PATH=".bin/gtkruntime" | ||
| 7 | - | ||
| 8 | -# Clean target folder | ||
| 9 | -rm -fr "$TARGET_PATH/*" | ||
| 10 | -mkdir -p "$TARGET_PATH" | ||
| 11 | - | ||
| 12 | -copyFile() { | ||
| 13 | - | ||
| 14 | - GTKPATH=$(find "$GTK_PREFIX/bin" -name "$1") | ||
| 15 | - SYSPATH=$(find "/bin" -name "$1") | ||
| 16 | - | ||
| 17 | - if [ ! -z "$GTKPATH" ]; then | ||
| 18 | - echo "$GTKPATH ..." | ||
| 19 | - cp $GTKPATH "$TARGET_PATH" | ||
| 20 | - if [ "$?" != "0" ]; then | ||
| 21 | - echo "Can´t copy $GTKPATH" | ||
| 22 | - return 1 | ||
| 23 | - fi | ||
| 24 | - elif [ ! -z "$SYSPATH" ]; then | ||
| 25 | - echo "$SYSPATH ..." | ||
| 26 | - cp $SYSPATH "$TARGET_PATH" | ||
| 27 | - if [ "$?" != "0" ]; then | ||
| 28 | - echo "Can´t copy $SYSPATH" | ||
| 29 | - return 1 | ||
| 30 | - fi | ||
| 31 | - | ||
| 32 | - else | ||
| 33 | - echo "Can´t find ${GTK_PREFIX}/bin/${1}" | ||
| 34 | - return 1 | ||
| 35 | - fi | ||
| 36 | - | ||
| 37 | - return 0 | ||
| 38 | -} | ||
| 39 | - | ||
| 40 | -copyFiles() { | ||
| 41 | - | ||
| 42 | - while read FILE | ||
| 43 | - do | ||
| 44 | - copyFile "$FILE" | ||
| 45 | - if [ "$?" != "0" ]; then | ||
| 46 | - exit -1 | ||
| 47 | - fi | ||
| 48 | - done < $1 | ||
| 49 | - rm -f $1 | ||
| 50 | - | ||
| 51 | -} | ||
| 52 | - | ||
| 53 | -copy_locale() { | ||
| 54 | - | ||
| 55 | - rm -fr $TARGET_PATH/share/locale/pt_BR/LC_MESSAGES | ||
| 56 | - mkdir -p $TARGET_PATH/share/locale/pt_BR/LC_MESSAGES | ||
| 57 | - | ||
| 58 | - while read FILE | ||
| 59 | - do | ||
| 60 | - echo "$GTK_PREFIX/share/locale/pt_BR/LC_MESSAGES/$FILE ..." | ||
| 61 | - | ||
| 62 | - if [ -e "$GTK_PREFIX/share/locale/pt_BR/LC_MESSAGES/$FILE" ]; then | ||
| 63 | - cp "$GTK_PREFIX/share/locale/pt_BR/LC_MESSAGES/$FILE" "$TARGET_PATH/share/locale/pt_BR/LC_MESSAGES" | ||
| 64 | - if [ "$?" != "0" ]; then | ||
| 65 | - echo "Can´t copy $FILE" | ||
| 66 | - exit -1 | ||
| 67 | - fi | ||
| 68 | - fi | ||
| 69 | - | ||
| 70 | - done < $1 | ||
| 71 | - rm -f $1 | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | -CopyGTK3Theme() { | ||
| 75 | - | ||
| 76 | - mkdir -p ${TARGET_PATH}/share/icons | ||
| 77 | - if [ "$?" != 0 ]; then | ||
| 78 | - echo "Can´t create icons folder" | ||
| 79 | - exit -1 | ||
| 80 | - fi | ||
| 81 | - | ||
| 82 | - cp -rv /usr/share/icons/${1} ${TARGET_PATH}/share/icons | ||
| 83 | - if [ "$?" != 0 ]; then | ||
| 84 | - echo "Can´t copy ${1} icons" | ||
| 85 | - exit -1 | ||
| 86 | - fi | ||
| 87 | - | ||
| 88 | - mkdir -p ${TARGET_PATH}/share/themes | ||
| 89 | - if [ "$?" != 0 ]; then | ||
| 90 | - echo "Can´t create themes folder" | ||
| 91 | - exit -1 | ||
| 92 | - fi | ||
| 93 | - | ||
| 94 | - cp -rv /usr/share/themes/${1} ${TARGET_PATH}/share/themes | ||
| 95 | - if [ "$?" != 0 ]; then | ||
| 96 | - echo "Can´t copy ${1} theme" | ||
| 97 | - exit -1 | ||
| 98 | - fi | ||
| 99 | - | ||
| 100 | - | ||
| 101 | -} | ||
| 102 | - | ||
| 103 | - | ||
| 104 | -gtk3() { | ||
| 105 | - | ||
| 106 | -TEMPFILE="temp1.tmp" | ||
| 107 | -cat > $TEMPFILE << EOF | ||
| 108 | -libglib-*.dll | ||
| 109 | -libintl*.dll | ||
| 110 | -libgmodule*.dll | ||
| 111 | -libgobject*.dll | ||
| 112 | -libffi*.dll | ||
| 113 | -libgtk-*.dll | ||
| 114 | -libgdk-*.dll | ||
| 115 | -libcairo-gobject*.dll | ||
| 116 | -libcairo-2*.dll | ||
| 117 | -libfontconfig-1*.dll | ||
| 118 | -libfreetype-6*.dll | ||
| 119 | -zlib1.dll | ||
| 120 | -libxml2-*.dll | ||
| 121 | -libpixman-1*.dll | ||
| 122 | -libpng*.dll | ||
| 123 | -libgdk_pixbuf*.dll | ||
| 124 | -libgio-*.dll | ||
| 125 | -libjasper-*.dll | ||
| 126 | -libjpeg-8*.dll | ||
| 127 | -libtiff-5*.dll | ||
| 128 | -liblzma-5*.dll | ||
| 129 | -libpango-1*.dll | ||
| 130 | -libpangocairo-1*.dll | ||
| 131 | -libpangoft2-1*.dll | ||
| 132 | -libpangowin32-1*.dll | ||
| 133 | -libatk-*.dll | ||
| 134 | -libcrypto-*.dll | ||
| 135 | -libssl-*.dll | ||
| 136 | -libharfbuzz-0.dll | ||
| 137 | -libstdc++-6.dll | ||
| 138 | -librsvg-*.dll | ||
| 139 | -libepoxy-*.dll | ||
| 140 | -gspawn-win*-helper-console.exe | ||
| 141 | -gspawn-win*-helper.exe | ||
| 142 | -gdk-pixbuf-query-loaders.exe | ||
| 143 | -EOF | ||
| 144 | -copyFiles $TEMPFILE | ||
| 145 | - | ||
| 146 | - | ||
| 147 | -# Copy loaders | ||
| 148 | -GDK_LOADERS=$(${PKG_CONFIG} --variable=gdk_pixbuf_binarydir gdk-pixbuf-2.0)/loaders | ||
| 149 | -GDK_PREFIX=$(${PKG_CONFIG} --variable=prefix gdk-pixbuf-2.0) | ||
| 150 | -GDK_TARGET=$(echo ${GDK_LOADERS}/ | sed -e "s@${GDK_PREFIX}@@g") | ||
| 151 | - | ||
| 152 | -mkdir -p ${TARGET_PATH}/${GDK_TARGET} | ||
| 153 | - | ||
| 154 | -cp -v ${GDK_LOADERS}/* ${TARGET_PATH}/${GDK_TARGET} | ||
| 155 | -if [ "$?" != 0 ]; then | ||
| 156 | - echo "Can´t copy loaders" | ||
| 157 | - exit -1 | ||
| 158 | -fi | ||
| 159 | - | ||
| 160 | - | ||
| 161 | -# Copy optional files | ||
| 162 | -copyFile libgcc_s_sjlj-1.dll | ||
| 163 | -copyFile libgcc_s_seh-1.dll | ||
| 164 | - | ||
| 165 | -# Build locale dirs | ||
| 166 | -cat > $TEMPFILE << EOF | ||
| 167 | -atk10.mo | ||
| 168 | -gdk-pixbuf.mo | ||
| 169 | -glib20.mo | ||
| 170 | -gtk30-properties.mo | ||
| 171 | -EOF | ||
| 172 | - | ||
| 173 | -copy_locale $TEMPFILE | ||
| 174 | - | ||
| 175 | -mkdir -p $TARGET_PATH/share/glib-2.0/schemas | ||
| 176 | -if [ "$?" != 0 ]; then | ||
| 177 | - echo "Can´t create schemas folder" | ||
| 178 | - exit -1 | ||
| 179 | -fi | ||
| 180 | - | ||
| 181 | -#if [ ! -e $GTK_PREFIX/share/glib-2.0/schemas/gschemas.compiled ]; then | ||
| 182 | -# glib-compile-schemas $GTK_PREFIX/share/glib-2.0/schemas | ||
| 183 | -#fi | ||
| 184 | - | ||
| 185 | -#cp $GTK_PREFIX/share/glib-2.0/schemas/gschemas.compiled $TARGET_PATH/share/glib-2.0/schemas/gschemas.compiled | ||
| 186 | -#if [ "$?" != 0 ]; then | ||
| 187 | -# echo "Can´t copy gshemas.compiled" | ||
| 188 | -# exit -1 | ||
| 189 | -#fi | ||
| 190 | - | ||
| 191 | -# Copia Adwaita | ||
| 192 | -CopyGTK3Theme "Adwaita" | ||
| 193 | - | ||
| 194 | -#mkdir -p $TARGET_PATH/share/icons/Adwaita | ||
| 195 | -#if [ "$?" != 0 ]; then | ||
| 196 | -# echo "Can´t create icons folder" | ||
| 197 | -# exit -1 | ||
| 198 | -#fi | ||
| 199 | -# | ||
| 200 | -#cp -rv /usr/share/icons/Adwaita $TARGET_PATH/share/icons/Adwaita | ||
| 201 | -#if [ "$?" != 0 ]; then | ||
| 202 | -# echo "Can´t copy icons" | ||
| 203 | -# exit -1 | ||
| 204 | -#fi | ||
| 205 | -# | ||
| 206 | -#mkdir -p $TARGET_PATH/share/themes/Adwaita | ||
| 207 | -#if [ "$?" != 0 ]; then | ||
| 208 | -# echo "Can´t create Adwaita theme" | ||
| 209 | -# exit -1 | ||
| 210 | -#fi | ||
| 211 | -# | ||
| 212 | -#cp -rv /usr/share/themes/Adwaita $TARGET_PATH/share/themes/Adwaita | ||
| 213 | -#if [ "$?" != 0 ]; then | ||
| 214 | -# echo "Can´t copy Adwaita theme" | ||
| 215 | -# exit -1 | ||
| 216 | -#fi | ||
| 217 | - | ||
| 218 | - | ||
| 219 | -# Copia gnome | ||
| 220 | -#mkdir -p $TARGET_PATH/share/icons/gnome | ||
| 221 | -#if [ "$?" != 0 ]; then | ||
| 222 | -# echo "Can´t create icons folder" | ||
| 223 | -# exit -1 | ||
| 224 | -#fi | ||
| 225 | -# | ||
| 226 | -#cp -rv $GTK_PREFIX/share/icons/gnome $TARGET_PATH/share/icons/gnome | ||
| 227 | -#if [ "$?" != 0 ]; then | ||
| 228 | -# echo "Can´t copy icons" | ||
| 229 | -# exit -1 | ||
| 230 | -#fi | ||
| 231 | - | ||
| 232 | -mkdir -p $TARGET_PATH/etc | ||
| 233 | -cp -rv $GTK_PREFIX/etc/gtk-3.0 $TARGET_PATH/etc/gtk-3.0 | ||
| 234 | -if [ "$?" != 0 ]; then | ||
| 235 | - echo "Can´t copy theme" | ||
| 236 | - exit -1 | ||
| 237 | -fi | ||
| 238 | - | ||
| 239 | -cat > $TARGET_PATH/etc/gtk-3.0/settings.ini << EOF | ||
| 240 | -[Settings] | ||
| 241 | -gtk-theme-name = Adwaita | ||
| 242 | -gtk-icon-theme-name = Adwaita | ||
| 243 | -gtk-fallback-icon-theme = Adwaita | ||
| 244 | -gtk-font-name = Sans 10 | ||
| 245 | -gtk-button-images = 1 | ||
| 246 | -EOF | ||
| 247 | -} | ||
| 248 | - | ||
| 249 | -gtk2() { | ||
| 250 | - | ||
| 251 | -# Build DLL list | ||
| 252 | -TEMPFILE="temp1.tmp" | ||
| 253 | -cat > $TEMPFILE << EOF | ||
| 254 | -intl.dll | ||
| 255 | -libatk-1.0-0.dll | ||
| 256 | -libcairo-2.dll | ||
| 257 | -libgailutil-18.dll | ||
| 258 | -libgdk_pixbuf-2.0-0.dll | ||
| 259 | -libgdk-win32-2.0-0.dll | ||
| 260 | -libgettextlib-0-*.dll | ||
| 261 | -libgettextpo*.dll | ||
| 262 | -libgettextsrc*.dll | ||
| 263 | -libgio-2.0-0.dll | ||
| 264 | -libglib-2.0-0.dll | ||
| 265 | -libgmodule-2.0-0.dll | ||
| 266 | -libgobject-2.0-0.dll | ||
| 267 | -libgthread-2.0-0.dll | ||
| 268 | -libgtk-win32-2.0-0.dll | ||
| 269 | -libpango-1.0-0.dll | ||
| 270 | -libpangocairo-1.0-0.dll | ||
| 271 | -libpangoft2-1.0-0.dll | ||
| 272 | -libpangowin32-1.0-0.dll | ||
| 273 | -zlib1.dll | ||
| 274 | -libpng*.dll | ||
| 275 | -libfontconfig*.dll | ||
| 276 | -libasprintf*.dll | ||
| 277 | -libgettextlib*.dll | ||
| 278 | -libexpat*.dll | ||
| 279 | -freetype*.dll | ||
| 280 | -gspawn-win32-helper-console.exe | ||
| 281 | -gspawn-win32-helper.exe | ||
| 282 | -gdk-pixbuf-query-loaders.exe | ||
| 283 | -EOF | ||
| 284 | - | ||
| 285 | -# jpeg62.dll | ||
| 286 | -# libtiff*.dll | ||
| 287 | -copyFiles $TEMPFILE | ||
| 288 | - | ||
| 289 | -# Build locale dirs | ||
| 290 | -cat > $TEMPFILE << EOF | ||
| 291 | -atk10.mo | ||
| 292 | -gdk-pixbuf.mo | ||
| 293 | -gettext-runtime.mo | ||
| 294 | -gettext-tools.mo | ||
| 295 | -glib20.mo | ||
| 296 | -gtk20-properties.mo | ||
| 297 | -gtk20.mo | ||
| 298 | -libiconv.mo | ||
| 299 | -EOF | ||
| 300 | - | ||
| 301 | -copy_locale $TEMPFILE | ||
| 302 | - | ||
| 303 | -# Copy default theme | ||
| 304 | -THEME_PATH="themes/MS-Windows/gtk-2.0" | ||
| 305 | -rm -fr "$TARGET_PATH/$THEME_PATH" | ||
| 306 | -mkdir -p "$TARGET_PATH/share/$THEME_PATH" | ||
| 307 | - | ||
| 308 | -echo "$GTK_PREFIX/share/$THEME_PATH/gtkrc ..." | ||
| 309 | -cp "$GTK_PREFIX/share/$THEME_PATH/gtkrc" "$TARGET_PATH/share/$THEME_PATH/gtkrc" | ||
| 310 | -if [ "$?" != "0" ]; then | ||
| 311 | - echo "Can´t copy default theme" | ||
| 312 | - exit -1 | ||
| 313 | -fi | ||
| 314 | - | ||
| 315 | -cat > $TEMPFILE << EOF | ||
| 316 | -engines | ||
| 317 | -loaders | ||
| 318 | -EOF | ||
| 319 | - | ||
| 320 | -rm -fr $TARGET_PATH/lib/gtk-2.0/$GTK_RUNTIME_VERSION/ | ||
| 321 | -mkdir -p $TARGET_PATH/lib/gtk-2.0/$GTK_RUNTIME_VERSION/ | ||
| 322 | -while read DIRNAME | ||
| 323 | -do | ||
| 324 | - if [ -d "$GTK_PREFIX/lib/gtk-2.0/$GTK_RUNTIME_VERSION/$DIRNAME" ]; then | ||
| 325 | - echo "$GTK_PREFIX/lib/gtk-2.0/$GTK_RUNTIME_VERSION/$DIRNAME ..." | ||
| 326 | - mkdir -p "$TARGET_PATH/lib/gtk-2.0/$GTK_RUNTIME_VERSION/$DIRNAME" | ||
| 327 | - cp -r "$GTK_PREFIX/lib/gtk-2.0/$GTK_RUNTIME_VERSION/$DIRNAME" "$TARGET_PATH/lib/gtk-2.0/$GTK_RUNTIME_VERSION" | ||
| 328 | - if [ "$?" != "0" ]; then | ||
| 329 | - echo "Can´t copy $DIRNAME" | ||
| 330 | - exit -1 | ||
| 331 | - fi | ||
| 332 | - fi | ||
| 333 | -done < $TEMPFILE | ||
| 334 | -rm -f $TEMPFILE | ||
| 335 | - | ||
| 336 | -mkdir -p $TARGET_PATH/etc/gtk-2.0/ | ||
| 337 | -echo "gtk-theme-name = \"MS-Windows\"" > $TARGET_PATH/etc/gtk-2.0/gtkrc | ||
| 338 | -if [ "$?" != "0" ]; then | ||
| 339 | - echo "Can´t set theme name" | ||
| 340 | - exit -1 | ||
| 341 | -fi | ||
| 342 | - | ||
| 343 | -} | ||
| 344 | - | ||
| 345 | -if [ "$GTK_VERSION" == "gtk+-3.0" ]; then | ||
| 346 | - gtk3 | ||
| 347 | -else | ||
| 348 | - gtk2 | ||
| 349 | -fi | ||
| 350 | - | ||
| 351 | -echo $0 Complete | ||
| 352 | - |
win/pack.sh
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | -myDIR=$(dirname $(readlink -f $0)) | ||
| 3 | 2 | ||
| 4 | -cleanup() | 3 | +PROJECTDIR=$(dirname $(dirname $(readlink -f ${0}))) |
| 4 | +WORKDIR=$(mktemp -d) | ||
| 5 | + | ||
| 6 | +if [ -e /etc/os-release ]; then | ||
| 7 | + . /etc/os-release | ||
| 8 | +fi | ||
| 9 | + | ||
| 10 | +# | ||
| 11 | +# Limpa diretório temporário | ||
| 12 | +# | ||
| 13 | +cleanup() | ||
| 5 | { | 14 | { |
| 6 | - # | ||
| 7 | - # Apaga diretorio temporário caso o script seja interrompido | ||
| 8 | - # | ||
| 9 | - cd ${myDIR} | ||
| 10 | - rm -fr ${TEMPDIR} | ||
| 11 | - exit -1 | 15 | + rm -fr ${WORKDIR} |
| 12 | } | 16 | } |
| 13 | 17 | ||
| 14 | -failed() | 18 | +# |
| 19 | +# Monta projeto no diretório corrente. | ||
| 20 | +# | ||
| 21 | +build() | ||
| 15 | { | 22 | { |
| 16 | - echo -e "\e]2;Failed!\a" | ||
| 17 | - echo $1 | ||
| 18 | - cleanup | 23 | + make clean |
| 24 | + | ||
| 25 | + make all | ||
| 26 | + if [ "$?" != "0" ]; then | ||
| 27 | + cleanup | ||
| 28 | + exit -1 | ||
| 29 | + fi | ||
| 30 | + | ||
| 31 | + cp -rv .bin/Release/* ${WORKDIR}/build/bin | ||
| 32 | + if [ "$?" != "0" ]; then | ||
| 33 | + cleanup | ||
| 34 | + exit -1 | ||
| 35 | + fi | ||
| 36 | + | ||
| 37 | + make DESTDIR=${WORKDIR}/build install | ||
| 38 | + if [ "$?" != "0" ]; then | ||
| 39 | + cleanup | ||
| 40 | + exit -1 | ||
| 41 | + fi | ||
| 42 | + | ||
| 19 | } | 43 | } |
| 20 | 44 | ||
| 45 | +build_plugin() | ||
| 46 | +{ | ||
| 47 | + | ||
| 48 | + echo -e "\e]2;${2}-${1}\a" | ||
| 49 | + | ||
| 50 | + cd ${WORKDIR}/sources/pw3270-plugin-${2} | ||
| 51 | + if [ "$?" != "0" ]; then | ||
| 52 | + cleanup | ||
| 53 | + exit -1 | ||
| 54 | + fi | ||
| 55 | + | ||
| 56 | + export cache=${WORKDIR}/cache/pw3270-plugin-${2}.cache | ||
| 57 | + | ||
| 58 | + ./configure \ | ||
| 59 | + CFLAGS=${CFLAGS} \ | ||
| 60 | + LDFLAGS=${LDFLAGS} \ | ||
| 61 | + LIB3270_CFLAGS="${LIB3270_CFLAGS}" \ | ||
| 62 | + LIB3270_LIBS="${LIB3270_LIBS}" \ | ||
| 63 | + LIBV3270_CFLAGS="${LIBV3270_CFLAGS}" \ | ||
| 64 | + LIBV3270_LIBS="${LIBV3270_LIBS}" \ | ||
| 65 | + --host=${host} \ | ||
| 66 | + --prefix=${prefix} \ | ||
| 67 | + --libdir=${prefix}/lib | ||
| 68 | + | ||
| 69 | + if [ "$?" != "0" ]; then | ||
| 70 | + cleanup | ||
| 71 | + exit -1 | ||
| 72 | + fi | ||
| 73 | + | ||
| 74 | + make all | ||
| 75 | + if [ "$?" != "0" ]; then | ||
| 76 | + cleanup | ||
| 77 | + exit -1 | ||
| 78 | + fi | ||
| 79 | + | ||
| 80 | + cp -rv .bin/Release/* ${WORKDIR}/build/bin | ||
| 81 | + if [ "$?" != "0" ]; then | ||
| 82 | + cleanup | ||
| 83 | + exit -1 | ||
| 84 | + fi | ||
| 85 | + | ||
| 86 | +} | ||
| 21 | 87 | ||
| 22 | # | 88 | # |
| 23 | -# Gera pacote windows | 89 | +# Monta binários |
| 24 | # | 90 | # |
| 25 | # $1 = Arquitetura (x86_32/x86_64) | 91 | # $1 = Arquitetura (x86_32/x86_64) |
| 26 | # | 92 | # |
| 27 | -build() | 93 | +pack() |
| 28 | { | 94 | { |
| 29 | - cd $(dirname $myDIR) | ||
| 30 | - echo -e "\e]2;${1}\a" | 95 | + |
| 96 | + echo -e "\e]2;pw3270-${1}\a" | ||
| 31 | 97 | ||
| 32 | case ${1} in | 98 | case ${1} in |
| 33 | x86_32) | 99 | x86_32) |
| @@ -35,6 +101,8 @@ build() | @@ -35,6 +101,8 @@ build() | ||
| 35 | host_cpu=i686 | 101 | host_cpu=i686 |
| 36 | prefix=/usr/i686-w64-mingw32/sys-root/mingw | 102 | prefix=/usr/i686-w64-mingw32/sys-root/mingw |
| 37 | tools=i686-w64-mingw32 | 103 | tools=i686-w64-mingw32 |
| 104 | + pkg_config=/usr/bin/i686-w64-mingw32-pkg-config | ||
| 105 | + mingw_name=mingw32 | ||
| 38 | ;; | 106 | ;; |
| 39 | 107 | ||
| 40 | x86_64) | 108 | x86_64) |
| @@ -42,6 +110,8 @@ build() | @@ -42,6 +110,8 @@ build() | ||
| 42 | host_cpu=x86_64 | 110 | host_cpu=x86_64 |
| 43 | prefix=/usr/x86_64-w64-mingw32/sys-root/mingw | 111 | prefix=/usr/x86_64-w64-mingw32/sys-root/mingw |
| 44 | tools=x86_64-w64-mingw32 | 112 | tools=x86_64-w64-mingw32 |
| 113 | + pkg_config=/usr/bin/x86_64-w64-mingw32-pkg-config | ||
| 114 | + mingw_name=mingw64 | ||
| 45 | ;; | 115 | ;; |
| 46 | 116 | ||
| 47 | *) | 117 | *) |
| @@ -49,266 +119,390 @@ build() | @@ -49,266 +119,390 @@ build() | ||
| 49 | 119 | ||
| 50 | esac | 120 | esac |
| 51 | 121 | ||
| 122 | +# sudo zypper \ | ||
| 123 | +# --non-interactive \ | ||
| 124 | +# in \ | ||
| 125 | +# ${mingw_name}-libcurl-devel \ | ||
| 126 | +# ${mingw_name}-curl \ | ||
| 127 | +# ${mingw_name}-libopenssl-devel \ | ||
| 128 | +# ${mingw_name}-libintl-devel \ | ||
| 129 | +# ${mingw_name}-atk-devel \ | ||
| 130 | +# ${mingw_name}-pango-devel \ | ||
| 131 | +# ${mingw_name}-win_iconv-devel \ | ||
| 132 | +# ${mingw_name}-pixman-devel \ | ||
| 133 | +# ${mingw_name}-glib2-devel \ | ||
| 134 | +# ${mingw_name}-cairo-devel \ | ||
| 135 | +# ${mingw_name}-freetype-devel \ | ||
| 136 | +# ${mingw_name}-winpthreads-devel \ | ||
| 137 | +# ${mingw_name}-gtk3-devel \ | ||
| 138 | +# ${mingw_name}-cross-gcc-c++ \ | ||
| 139 | +# ${mingw_name}-cross-pkg-config \ | ||
| 140 | +# ${mingw_name}-cross-cpp \ | ||
| 141 | +# ${mingw_name}-cross-binutils \ | ||
| 142 | +# ${mingw_name}-cross-nsis | ||
| 143 | + | ||
| 144 | + if [ "$?" != "0" ]; then | ||
| 145 | + cleanup | ||
| 146 | + exit -1 | ||
| 147 | + fi | ||
| 148 | + | ||
| 52 | export HOST_CC=/usr/bin/gcc | 149 | export HOST_CC=/usr/bin/gcc |
| 53 | - export cache=${1}.cache | 150 | + |
| 151 | + rm -fr ${WORKDIR}/cache | ||
| 152 | + mkdir -p ${WORKDIR}/cache | ||
| 153 | + | ||
| 154 | + rm -fr ${WORKDIR}/build | ||
| 155 | + mkdir -p ${WORKDIR}/build/src/include | ||
| 156 | + mkdir -p ${WORKDIR}/build/.bin/Release | ||
| 157 | + | ||
| 158 | + # | ||
| 159 | + # Setup Target dir | ||
| 160 | + # | ||
| 161 | + mkdir -p ${WORKDIR}/build/bin | ||
| 162 | + | ||
| 163 | + export CFLAGS=-I${WORKDIR}/build/${prefix}/include -DWIN32 -D_WIN32 | ||
| 164 | + export LDFLAGS=-L${WORKDIR}/build/bin | ||
| 165 | + export PKG_CONFIG_PATH=${WORKDIR}/build/${prefix}/lib/pkgconfig | ||
| 166 | + | ||
| 167 | + # | ||
| 168 | + # Build lib3270 | ||
| 169 | + # | ||
| 170 | + echo -e "\e]2;lib3270-${1}\a" | ||
| 171 | + | ||
| 172 | + cd ${WORKDIR}/sources/lib3270 | ||
| 173 | + export cache=${WORKDIR}/cache/lib3270.cache | ||
| 54 | 174 | ||
| 55 | ./configure \ | 175 | ./configure \ |
| 56 | - --with-inet-ntop \ | 176 | + --host=${host} \ |
| 177 | + --prefix=${prefix} \ | ||
| 178 | + --libdir=${prefix}/lib \ | ||
| 179 | + --enable-self-signed-cert-check \ | ||
| 180 | + --enable-ssl-crl-check \ | ||
| 181 | + --enable-crl-expiration-check \ | ||
| 182 | + --disable-ldap \ | ||
| 183 | + --enable-curl \ | ||
| 184 | + --with-default-crl-url="ldap://pkildap.bb.com.br:389/CN=CRL1,CN=AC%20Banco%20do%20Brasil%20-%20EI%20v1,OU=ICP-BB,O=Banco%20do%20Brasil%20S.A.,C=BR?certificaterevocationlist" \ | ||
| 185 | + --with-default-host="tn3270s://3270.df.bb:9023" | ||
| 186 | + | ||
| 187 | + if [ "$?" != "0" ]; then | ||
| 188 | + cleanup | ||
| 189 | + exit -1 | ||
| 190 | + fi | ||
| 191 | + | ||
| 192 | + build | ||
| 193 | + | ||
| 194 | + export LIB3270_CFLAGS="-DLIB3270_NAME=3270" | ||
| 195 | + export LIB3270_LIBS="-l3270" | ||
| 196 | + | ||
| 197 | + # | ||
| 198 | + # Build libv3270 | ||
| 199 | + # | ||
| 200 | + echo -e "\e]2;libv3270-${1}\a" | ||
| 201 | + | ||
| 202 | + cd ${WORKDIR}/sources/libv3270 | ||
| 203 | + export cache=${WORKDIR}/cache/libv3270.cache | ||
| 204 | + | ||
| 205 | + ./configure \ | ||
| 206 | + CFLAGS=${CFLAGS} \ | ||
| 207 | + LDFLAGS=${LDFLAGS} \ | ||
| 208 | + LIB3270_CFLAGS="${LIB3270_CFLAGS}" \ | ||
| 209 | + LIB3270_LIBS="${LIB3270_LIBS}" \ | ||
| 57 | --host=${host} \ | 210 | --host=${host} \ |
| 58 | --prefix=${prefix} \ | 211 | --prefix=${prefix} \ |
| 59 | --libdir=${prefix}/lib | 212 | --libdir=${prefix}/lib |
| 60 | 213 | ||
| 61 | if [ "$?" != "0" ]; then | 214 | if [ "$?" != "0" ]; then |
| 62 | - failed "Erro ao configurar" | 215 | + cleanup |
| 216 | + exit -1 | ||
| 63 | fi | 217 | fi |
| 64 | 218 | ||
| 65 | - . ./versions | ||
| 66 | - echo -e "\e]2;${PACKAGE_NAME} - ${1}\a" | ||
| 67 | - | ||
| 68 | - make clean | ||
| 69 | - rm -f *.exe | 219 | + build |
| 220 | + | ||
| 221 | + export LIBV3270_CFLAGS="-DLIBV3270_MODE=3270" | ||
| 222 | + export LIBV3270_LIBS="-lv3270" | ||
| 223 | + | ||
| 224 | + # | ||
| 225 | + # Build main application | ||
| 226 | + # | ||
| 227 | + echo -e "\e]2;pw3270-${1}\a" | ||
| 228 | + | ||
| 229 | + cd ${WORKDIR}/sources/pw3270 | ||
| 230 | + export cache=${WORKDIR}/cache/application.cache | ||
| 231 | + | ||
| 232 | + ./configure \ | ||
| 233 | + CFLAGS=${CFLAGS} \ | ||
| 234 | + LDFLAGS=${LDFLAGS} \ | ||
| 235 | + LIB3270_CFLAGS="${LIB3270_CFLAGS}" \ | ||
| 236 | + LIB3270_LIBS="${LIB3270_LIBS}" \ | ||
| 237 | + LIBV3270_CFLAGS="${LIBV3270_CFLAGS}" \ | ||
| 238 | + LIBV3270_LIBS="${LIBV3270_LIBS}" \ | ||
| 239 | + --host=${host} \ | ||
| 240 | + --prefix=${prefix} \ | ||
| 241 | + --libdir=${prefix}/lib \ | ||
| 242 | + --with-source-locales=${WORKDIR}/locale | ||
| 70 | 243 | ||
| 71 | - make all | ||
| 72 | if [ "$?" != "0" ]; then | 244 | if [ "$?" != "0" ]; then |
| 73 | - failed "Erro ao compilar fontes" | 245 | + cleanup |
| 246 | + exit -1 | ||
| 74 | fi | 247 | fi |
| 75 | 248 | ||
| 76 | - rm -f ./win/*.exe | 249 | + mkdir -p ${WORKDIR}/locale |
| 77 | 250 | ||
| 78 | - if [ -e branding/${PACKAGE_TARNAME}.svg ]; then | ||
| 79 | - rm -f win/${PACKAGE_TARNAME}.ico | ||
| 80 | - convert -density 384 -background transparent branding/${PACKAGE_TARNAME}.svg -define icon:auto-resize -colors 256 win/${PACKAGE_TARNAME}.ico | 251 | + cp ${WORKDIR}/sources/lib3270/.pot/*.pot ${WORKDIR}/locale |
| 252 | + if [ "$?" != "0" ]; then | ||
| 253 | + cleanup | ||
| 254 | + exit -1 | ||
| 81 | fi | 255 | fi |
| 82 | 256 | ||
| 83 | - mkdir -p ${DESTDIR}/${PACKAGE_NAME}/${1} | 257 | + cp ${WORKDIR}/sources/libv3270/.pot/*.pot ${WORKDIR}/locale |
| 258 | + if [ "$?" != "0" ]; then | ||
| 259 | + cleanup | ||
| 260 | + exit -1 | ||
| 261 | + fi | ||
| 84 | 262 | ||
| 85 | - if [ "${RUNTIME}" == "1" ]; then | 263 | + build |
| 86 | 264 | ||
| 87 | - makensis ./win/${PACKAGE}.nsi | ||
| 88 | - if [ "$?" != "0" ]; then | ||
| 89 | - failed "Erro ao gerar instalador sem gtk" | ||
| 90 | - fi | ||
| 91 | - | ||
| 92 | - mv -f ./win/${PACKAGE}-${PACKAGE_VERSION}-requires-gtk-${GTK_MODVERSION}-${host_cpu}.exe \ | ||
| 93 | - ${DESTDIR}/${PACKAGE_NAME}/${1} | 265 | + # |
| 266 | + # Build plugins | ||
| 267 | + # | ||
| 268 | + build_plugin ${1} hllapi | ||
| 94 | 269 | ||
| 95 | - if [ "$?" != "0" ]; then | ||
| 96 | - failed "Erro ao copiar instalador sem gtk para ${1}" | ||
| 97 | - fi | 270 | + # |
| 271 | + # Install data & icons | ||
| 272 | + # | ||
| 273 | + echo -e "\e]2;pw3270-icons-${1}\a" | ||
| 274 | + | ||
| 275 | + cd ${WORKDIR}/sources/pw3270 | ||
| 276 | + | ||
| 277 | + make -C ${WORKDIR}/sources/pw3270 locale | ||
| 278 | + if [ "$?" != "0" ]; then | ||
| 279 | + cleanup | ||
| 280 | + exit -1 | ||
| 281 | + fi | ||
| 98 | 282 | ||
| 283 | + cp -rv .bin/locale ${WORKDIR}/build | ||
| 284 | + if [ "$?" != "0" ]; then | ||
| 285 | + cleanup | ||
| 286 | + exit -1 | ||
| 99 | fi | 287 | fi |
| 100 | 288 | ||
| 101 | - if [ "${COMPLETE}" == "1" ]; then | 289 | + mkdir -p ${WORKDIR}/build/win |
| 102 | 290 | ||
| 103 | - chmod +x ./win/makeruntime.sh | ||
| 104 | - ./win/makeruntime.sh | 291 | + mkdir -p ${WORKDIR}/sources/pw3270/.bin/Release |
| 292 | + cp -rv ${WORKDIR}/build/bin/* ${WORKDIR}/sources/pw3270/.bin/Release | ||
| 105 | 293 | ||
| 106 | - makensis -DWITHGTK ./win/${PACKAGE}.nsi | ||
| 107 | - if [ "$?" != "0" ]; then | ||
| 108 | - failed "Erro ao gerar instalador com runtime" | ||
| 109 | - fi | 294 | + chmod +x ${WORKDIR}/sources/pw3270/win/makeruntime.sh |
| 295 | + ${WORKDIR}/sources/pw3270/win/makeruntime.sh | ||
| 296 | + if [ "$?" != "0" ]; then | ||
| 297 | + cleanup | ||
| 298 | + exit -1 | ||
| 299 | + fi | ||
| 110 | 300 | ||
| 111 | - mv -f ./win/${PACKAGE}-${PACKAGE_VERSION}-gtk-${GTK_MODVERSION}-${host_cpu}.exe \ | ||
| 112 | - ${DESTDIR}/${PACKAGE_NAME}/${1} | 301 | + mkdir -p ${WORKDIR}/build/bin |
| 302 | + cp -rv ${WORKDIR}/sources/pw3270/.bin/runtime ${WORKDIR}/build/bin | ||
| 303 | + if [ "$?" != "0" ]; then | ||
| 304 | + cleanup | ||
| 305 | + exit -1 | ||
| 306 | + fi | ||
| 113 | 307 | ||
| 114 | - if [ "$?" != "0" ]; then | ||
| 115 | - failed "Erro ao copiar instalador completo para ${1}" | ||
| 116 | - fi | 308 | + # |
| 309 | + # Copy branding | ||
| 310 | + # | ||
| 311 | + cp ${WORKDIR}/branding/*.ico ${WORKDIR}/build | ||
| 312 | + if [ "$?" != "0" ]; then | ||
| 313 | + cleanup | ||
| 314 | + exit -1 | ||
| 315 | + fi | ||
| 316 | + | ||
| 317 | + cp ${WORKDIR}/branding/*.png ${WORKDIR}/build | ||
| 318 | + if [ "$?" != "0" ]; then | ||
| 319 | + cleanup | ||
| 320 | + exit -1 | ||
| 321 | + fi | ||
| 322 | + | ||
| 323 | + cp ${WORKDIR}/branding/AUTHORS ${WORKDIR}/build | ||
| 324 | + if [ "$?" != "0" ]; then | ||
| 325 | + cleanup | ||
| 326 | + exit -1 | ||
| 327 | + fi | ||
| 328 | + | ||
| 329 | + cp ${WORKDIR}/branding/LICENSE ${WORKDIR}/build | ||
| 330 | + if [ "$?" != "0" ]; then | ||
| 331 | + cleanup | ||
| 332 | + exit -1 | ||
| 333 | + fi | ||
| 334 | + | ||
| 335 | + cp -rv ${WORKDIR}/branding/ui ${WORKDIR}/build | ||
| 336 | + if [ "$?" != "0" ]; then | ||
| 337 | + cleanup | ||
| 338 | + exit -1 | ||
| 339 | + fi | ||
| 340 | + | ||
| 341 | + # | ||
| 342 | + # Create installation package | ||
| 343 | + # | ||
| 344 | + echo -e "\e]2;pw3270-package-${1}\a" | ||
| 345 | + | ||
| 346 | + cd ${WORKDIR}/build | ||
| 347 | + | ||
| 348 | + cp ${WORKDIR}/sources/pw3270/win/pw3270.nsi ./pw3270.nsi | ||
| 349 | + if [ "$?" != "0" ]; then | ||
| 350 | + cleanup | ||
| 351 | + exit -1 | ||
| 352 | + fi | ||
| 353 | + | ||
| 354 | + echo "------------------------------------------------------" | ||
| 355 | + echo makensis -DWITHGTK pw3270.nsi | ||
| 356 | + | ||
| 357 | + /bin/bash | ||
| 358 | + | ||
| 359 | + makensis -DWITHGTK pw3270.nsi | ||
| 360 | + if [ "$?" != "0" ]; then | ||
| 361 | + cleanup | ||
| 362 | + exit -1 | ||
| 363 | + fi | ||
| 117 | 364 | ||
| 118 | - ln -sf ${1}/${PACKAGE}-${PACKAGE_VERSION}-gtk-${GTK_MODVERSION}-${host_cpu}.exe \ | ||
| 119 | - ${DESTDIR}/${PACKAGE_NAME}/${PACKAGE}-latest-${host_cpu}.exe | 365 | + cp -v ./win/*.exe ${PROJECTDIR} |
| 366 | + if [ "$?" != "0" ]; then | ||
| 367 | + cleanup | ||
| 368 | + exit -1 | ||
| 369 | + fi | ||
| 120 | 370 | ||
| 371 | + if [ -d ~/public_html ]; then | ||
| 372 | + mkdir -p ~/public_html/win/pw3270/${1} | ||
| 373 | + cp -v ./win/*.exe ~/public_html/win/pw3270/${1} | ||
| 121 | if [ "$?" != "0" ]; then | 374 | if [ "$?" != "0" ]; then |
| 122 | - failed "Erro ao criar link para ${1}" | 375 | + cleanup |
| 376 | + exit -1 | ||
| 123 | fi | 377 | fi |
| 124 | fi | 378 | fi |
| 125 | 379 | ||
| 126 | - make clean | ||
| 127 | - rm -fr .bin | 380 | +# if [ ! -z ${WIN_PACKAGE_SERVER} ]; then |
| 381 | +# scp ./win/*.exe ${WIN_PACKAGE_SERVER}/pw3270 | ||
| 382 | +# if [ "$?" != "0" ]; then | ||
| 383 | +# cleanup | ||
| 384 | +# exit -1 | ||
| 385 | +# fi | ||
| 386 | +# fi | ||
| 128 | 387 | ||
| 129 | } | 388 | } |
| 130 | 389 | ||
| 131 | -TEMPDIR=$(mktemp -d) | ||
| 132 | -ARCHS="x86_32 x86_64" | ||
| 133 | -WINREPO="" | ||
| 134 | -DESTDIR=${HOME}/public_html/win | ||
| 135 | -RUNTIME=0 | ||
| 136 | -COMPLETE=1 | 390 | +# |
| 391 | +# Get sources from GIT | ||
| 392 | +# | ||
| 393 | +mkdir -p ${WORKDIR}/sources | ||
| 137 | 394 | ||
| 138 | -if [ -e ~/.config/pw3270-win.conf ]; then | ||
| 139 | - . ~/.config/pw3270-win.conf | ||
| 140 | -fi | 395 | +for src in lib3270 libv3270 pw3270 pw3270-plugin-hllapi; do |
| 141 | 396 | ||
| 142 | -rm -f ${myDIR}/*.exe \ | ||
| 143 | - ${myDIR}/*.zip | 397 | + echo "Baixando ${src}..." |
| 398 | + echo -e "\e]2;Downloading ${src}\a" | ||
| 144 | 399 | ||
| 145 | -trap cleanup INT | 400 | + git clone https://github.com/PerryWerneck/${src}.git ${WORKDIR}/sources/${src} |
| 401 | + if [ "$?" != "0" ]; then | ||
| 402 | + cleanup | ||
| 403 | + exit -1 | ||
| 404 | + fi | ||
| 146 | 405 | ||
| 147 | -until [ -z "$1" ] | ||
| 148 | -do | ||
| 149 | - if [ ${1:0:2} = '--' ]; then | ||
| 150 | - tmp=${1:2} | ||
| 151 | - parameter=${tmp%%=*} | ||
| 152 | - parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") | 406 | + cd ${WORKDIR}/sources/${src} |
| 153 | 407 | ||
| 154 | - case $parameter in | 408 | + NOCONFIGURE=1 ./autogen.sh |
| 409 | + if [ "$?" != "0" ]; then | ||
| 410 | + cleanup | ||
| 411 | + exit -1 | ||
| 412 | + fi | ||
| 155 | 413 | ||
| 156 | - 32) | ||
| 157 | - ARCHS="x86_32" | ||
| 158 | - ;; | ||
| 159 | 414 | ||
| 160 | - 64) | ||
| 161 | - ARCHS="x86_64" | ||
| 162 | - ;; | 415 | +done |
| 163 | 416 | ||
| 164 | - FULL) | ||
| 165 | - COMPLETE=1 | ||
| 166 | - RUNTIME=1 | ||
| 167 | - ;; | 417 | +# |
| 418 | +# Setup branding | ||
| 419 | +# | ||
| 420 | +echo -e "\e]2;Branding\a" | ||
| 168 | 421 | ||
| 169 | - RT) | ||
| 170 | - COMPLETE=0 | ||
| 171 | - RUNTIME=1 | ||
| 172 | - ;; | 422 | +mkdir -p ${WORKDIR}/branding |
| 173 | 423 | ||
| 174 | - OUT) | ||
| 175 | - DESTDIR=$value | ||
| 176 | - ;; | 424 | +BRANDING_SOURCES=${WORKDIR}/sources/pw3270/branding |
| 177 | 425 | ||
| 178 | - REPO) | ||
| 179 | - WINREPO=$value | ||
| 180 | - ;; | 426 | +cp -rv ${BRANDING_SOURCES}/* ${WORKDIR}/branding |
| 427 | +if [ "$?" != "0" ]; then | ||
| 428 | + cleanup | ||
| 429 | + exit -1 | ||
| 430 | +fi | ||
| 181 | 431 | ||
| 182 | - ARCH) | ||
| 183 | - value=${tmp##*=} | ||
| 184 | - ARCHS=$value | ||
| 185 | - ;; | 432 | +convert -density 384 -background transparent ${BRANDING_SOURCES}/pw3270.svg -define icon:auto-resize -colors 256 ${WORKDIR}/branding/pw3270.ico |
| 433 | +if [ "$?" != "0" ]; then | ||
| 434 | + cleanup | ||
| 435 | + exit -1 | ||
| 436 | +fi | ||
| 186 | 437 | ||
| 187 | - *) | ||
| 188 | - value=${tmp##*=} | ||
| 189 | - eval $parameter=$value | ||
| 190 | - esac | 438 | +convert -background transparent ${BRANDING_SOURCES}/pw3270.svg ${WORKDIR}/branding/pw3270.png |
| 439 | +if [ "$?" != "0" ]; then | ||
| 440 | + cleanup | ||
| 441 | + exit -1 | ||
| 442 | +fi | ||
| 191 | 443 | ||
| 192 | - fi | 444 | +optipng -o7 ${WORKDIR}/branding/pw3270.png |
| 445 | +if [ "$?" != "0" ]; then | ||
| 446 | + cleanup | ||
| 447 | + exit -1 | ||
| 448 | +fi | ||
| 193 | 449 | ||
| 194 | - shift | ||
| 195 | -done | 450 | +convert -background transparent ${BRANDING_SOURCES}/pw3270-logo.svg ${WORKDIR}/branding/pw3270-logo.png |
| 451 | +if [ "$?" != "0" ]; then | ||
| 452 | + cleanup | ||
| 453 | + exit -1 | ||
| 454 | +fi | ||
| 196 | 455 | ||
| 197 | -# Configura | ||
| 198 | -aclocal | 456 | +optipng -o7 ${WORKDIR}/branding/pw3270-logo.png |
| 199 | if [ "$?" != "0" ]; then | 457 | if [ "$?" != "0" ]; then |
| 458 | + cleanup | ||
| 200 | exit -1 | 459 | exit -1 |
| 201 | fi | 460 | fi |
| 202 | 461 | ||
| 203 | -autoconf | 462 | +cp ${WORKDIR}/sources/pw3270/AUTHORS ${WORKDIR}/branding |
| 204 | if [ "$?" != "0" ]; then | 463 | if [ "$?" != "0" ]; then |
| 464 | + cleanup | ||
| 205 | exit -1 | 465 | exit -1 |
| 206 | fi | 466 | fi |
| 207 | 467 | ||
| 208 | -# Gera pacotes | ||
| 209 | -for i in ${ARCHS}; do | ||
| 210 | - build "${i}" | ||
| 211 | -done | 468 | +cp ${WORKDIR}/sources/pw3270/LICENSE ${WORKDIR}/branding |
| 469 | +if [ "$?" != "0" ]; then | ||
| 470 | + cleanup | ||
| 471 | + exit -1 | ||
| 472 | +fi | ||
| 473 | + | ||
| 474 | +cp ${WORKDIR}/sources/pw3270/conf/colors.conf ${WORKDIR}/branding | ||
| 475 | +if [ "$?" != "0" ]; then | ||
| 476 | + cleanup | ||
| 477 | + exit -1 | ||
| 478 | +fi | ||
| 479 | + | ||
| 480 | +cp -rv ${WORKDIR}/sources/pw3270/ui ${WORKDIR}/branding | ||
| 481 | +if [ "$?" != "0" ]; then | ||
| 482 | + cleanup | ||
| 483 | + exit -1 | ||
| 484 | +fi | ||
| 212 | 485 | ||
| 213 | -#if [ "${RUNTIME}" == "1" ]; then | ||
| 214 | -# | ||
| 215 | -# echo -e "\e]2;Baixando runtime\a" | ||
| 216 | -# | ||
| 217 | -# mkdir -p ${TEMPDIR}/runtime | ||
| 218 | -# cd ${TEMPDIR}/runtime | ||
| 219 | -# | ||
| 220 | -# # | ||
| 221 | -# # Puxo scripts de construção do GTK direto da sourceforge. | ||
| 222 | -# # | ||
| 223 | -# git clone http://git.code.sf.net/p/gtk3win/code . | ||
| 224 | -# if [ "$?" != "0" ]; then | ||
| 225 | -# echo "Erro ao baixar fontes do runtime" | ||
| 226 | -# exit -1 | ||
| 227 | -# fi | ||
| 228 | -# | ||
| 229 | -# for i in ${ARCHS}; do | ||
| 230 | -# | ||
| 231 | -# echo -e "\e]2;gtk-runtime-${i}\a" | ||
| 232 | -# | ||
| 233 | -# case ${i} in | ||
| 234 | -# x86_32) | ||
| 235 | -# host_cpu=i686 | ||
| 236 | -# ./win32.sh | ||
| 237 | -# if [ "$?" != "0" ]; then | ||
| 238 | -# exit -1 | ||
| 239 | -# fi | ||
| 240 | -# ;; | ||
| 241 | -# | ||
| 242 | -# x86_64) | ||
| 243 | -# host_cpu=x86_64 | ||
| 244 | -# ./win64.sh | ||
| 245 | -# if [ "$?" != "0" ]; then | ||
| 246 | -# exit -1 | ||
| 247 | -# fi | ||
| 248 | -# ;; | ||
| 249 | -# | ||
| 250 | -# *) | ||
| 251 | -# echo "Arquitetura desconhecida ${i}" | ||
| 252 | -# exit -1 | ||
| 253 | -# | ||
| 254 | -# esac | ||
| 255 | -# | ||
| 256 | -# chmod +x ./win/makeruntime.sh | ||
| 257 | -# | ||
| 258 | -# ./win/makeruntime.sh | ||
| 259 | -# if [ "$?" != "0" ]; then | ||
| 260 | -# exit -1 | ||
| 261 | -# fi | ||
| 262 | -# | ||
| 263 | -# # Copia o pacote gerado | ||
| 264 | -# FILENAME=$(find . -maxdepth 1 -name "gtk-runtime-*-${host_cpu}.exe" | head --lines 1) | ||
| 265 | -# | ||
| 266 | -# mkdir -p ${DESTDIR}/${host_cpu} | ||
| 267 | -# | ||
| 268 | -# mv gtk-runtime-*-${host_cpu}.exe ${DESTDIR}/${host_cpu} | ||
| 269 | -# if [ "$?" != "0" ]; then | ||
| 270 | -# failed "Erro ao copiar instalador" | ||
| 271 | -# fi | ||
| 272 | -# | ||
| 273 | -# ln -sf $(basename ${FILENAME}) "${DESTDIR}/${host_cpu}/gtk-runtime-latest-${host_cpu}.exe" | ||
| 274 | -# if [ "$?" != "0" ]; then | ||
| 275 | -# failed "Erro ao criar o link simbólico" | ||
| 276 | -# fi | ||
| 277 | # | 486 | # |
| 278 | -# done | 487 | +# Create installers |
| 279 | # | 488 | # |
| 280 | -#fi | 489 | +pack x86_32 |
| 490 | +#pack x86_64 | ||
| 491 | + | ||
| 492 | +cleanup | ||
| 493 | + | ||
| 494 | + | ||
| 495 | + | ||
| 496 | + | ||
| 497 | + | ||
| 281 | 498 | ||
| 282 | -cd $(dirname $myDIR) | ||
| 283 | -rm -fr ${TEMPDIR} | ||
| 284 | 499 | ||
| 285 | -# Gera pacotes para envio ao SPB | ||
| 286 | -rm -f ${DESTDIR}/${PACKAGE}-latest.zip | ||
| 287 | 500 | ||
| 288 | -zip -9 -r -j \ | ||
| 289 | - ${DESTDIR}/${PACKAGE}-latest.zip \ | ||
| 290 | - $(readlink -f ${DESTDIR}/${PACKAGE_NAME}/${PACKAGE}-latest-i686.exe) \ | ||
| 291 | - $(readlink -f ${DESTDIR}/${PACKAGE_NAME}/${PACKAGE}-latest-x86_64.exe) | ||
| 292 | 501 | ||
| 293 | -echo -e "\e]2;Success!\a" | ||
| 294 | 502 | ||
| 295 | -# Copia para repositório | ||
| 296 | -if [ "${WINREPO}" != "" ]; then | ||
| 297 | 503 | ||
| 298 | - echo "Copiando arquivos para ${WINREPO}..." | ||
| 299 | 504 | ||
| 300 | - scp $(readlink -f ${DESTDIR}/${PACKAGE_NAME}/${PACKAGE}-latest-i686.exe) ${WINREPO}/x86_32 | ||
| 301 | - if [ "$?" != "0" ]; then | ||
| 302 | - echo "Erro ao copiar versão de 32 bits para o repositório" | ||
| 303 | - exit -1 | ||
| 304 | - fi | ||
| 305 | 505 | ||
| 306 | - scp $(readlink -f ${DESTDIR}/${PACKAGE_NAME}/${PACKAGE}-latest-x86_64.exe) ${WINREPO}/x86_64 | ||
| 307 | - if [ "$?" != "0" ]; then | ||
| 308 | - echo "Erro ao copiar versão de 64 bits para o repositório" | ||
| 309 | - exit -1 | ||
| 310 | - fi | ||
| 311 | 506 | ||
| 312 | -fi | ||
| 313 | 507 | ||
| 314 | 508 |
win/pw3270.nsi.in
| @@ -35,7 +35,7 @@ VIAddVersionKey "LegalCopyright" "GPL-2.0" | @@ -35,7 +35,7 @@ VIAddVersionKey "LegalCopyright" "GPL-2.0" | ||
| 35 | 35 | ||
| 36 | !define MUI_ABORTWARNING | 36 | !define MUI_ABORTWARNING |
| 37 | # !insertmacro MUI_PAGE_WELCOME | 37 | # !insertmacro MUI_PAGE_WELCOME |
| 38 | -!insertmacro MUI_PAGE_LICENSE "../LICENSE" | 38 | +!insertmacro MUI_PAGE_LICENSE "LICENSE" |
| 39 | !insertmacro MUI_PAGE_COMPONENTS | 39 | !insertmacro MUI_PAGE_COMPONENTS |
| 40 | !insertmacro MUI_PAGE_DIRECTORY | 40 | !insertmacro MUI_PAGE_DIRECTORY |
| 41 | !insertmacro MUI_PAGE_INSTFILES | 41 | !insertmacro MUI_PAGE_INSTFILES |
| @@ -67,20 +67,19 @@ SubSection "@PACKAGE@" SecMain | @@ -67,20 +67,19 @@ SubSection "@PACKAGE@" SecMain | ||
| 67 | createShortCut "$DESKTOP\@PACKAGE@.lnk" "$INSTDIR\@PACKAGE@.exe" | 67 | createShortCut "$DESKTOP\@PACKAGE@.lnk" "$INSTDIR\@PACKAGE@.exe" |
| 68 | 68 | ||
| 69 | # Binary files | 69 | # Binary files |
| 70 | - file "/oname=$INSTDIR\@PACKAGE@.exe" "..\.bin\Release\@PACKAGE@.exe" | ||
| 71 | - file "/oname=$INSTDIR\@PACKAGE@.ico" "@PACKAGE@.ico" | ||
| 72 | - file "/oname=$INSTDIR\lib3270.dll.@PACKAGE_VERSION@" "..\.bin\Release\lib3270.dll.@PACKAGE_VERSION@" | ||
| 73 | - file "/oname=$INSTDIR\@PACKAGE@.dll.@PACKAGE_VERSION@" "..\.bin\Release\@PACKAGE@.dll.@PACKAGE_VERSION@" | 70 | + file "/oname=$INSTDIR\@PACKAGE@.exe" "bin\@PACKAGE@.exe" |
| 71 | + file "/oname=$INSTDIR\@PACKAGE@.ico" "@PACKAGE@.ico" | ||
| 72 | + file "/oname=$INSTDIR\lib3270.dll.@PACKAGE_VERSION@" "bin\lib3270.dll.@PACKAGE_VERSION@" | ||
| 73 | + file "/oname=$INSTDIR\@PACKAGE@.dll.@PACKAGE_VERSION@" "bin\@PACKAGE@.dll.@PACKAGE_VERSION@" | ||
| 74 | 74 | ||
| 75 | # Configuration files | 75 | # Configuration files |
| 76 | - file "/oname=$INSTDIR\@PACKAGE@-logo.png" "..\.bin\@PACKAGE@-logo.png" | ||
| 77 | - file "/oname=$INSTDIR\@PACKAGE@.png" "..\.bin\@PACKAGE@.png" | ||
| 78 | - file "/oname=$INSTDIR\colors.conf" "..\conf\colors.conf" | 76 | + file "/oname=$INSTDIR\@PACKAGE@-logo.png" "@PACKAGE@-logo.png" |
| 77 | + file "/oname=$INSTDIR\@PACKAGE@.png" "@PACKAGE@.png" | ||
| 78 | + file "/oname=$INSTDIR\colors.conf" "colors.conf" | ||
| 79 | 79 | ||
| 80 | # Documentation files | 80 | # Documentation files |
| 81 | - #file "/oname=$INSTDIR\ChangeLog" "..\ChangeLog" | ||
| 82 | - file "/oname=$INSTDIR\AUTHORS" "..\AUTHORS" | ||
| 83 | - file "/oname=$INSTDIR\LICENSE" "..\LICENSE" | 81 | + file "/oname=$INSTDIR\AUTHORS" "AUTHORS" |
| 82 | + file "/oname=$INSTDIR\LICENSE" "LICENSE" | ||
| 84 | 83 | ||
| 85 | # Misc folders | 84 | # Misc folders |
| 86 | CreateDirectory "$INSTDIR\certs" | 85 | CreateDirectory "$INSTDIR\certs" |
| @@ -88,15 +87,15 @@ SubSection "@PACKAGE@" SecMain | @@ -88,15 +87,15 @@ SubSection "@PACKAGE@" SecMain | ||
| 88 | 87 | ||
| 89 | # UI definition files | 88 | # UI definition files |
| 90 | CreateDirectory "$INSTDIR\ui" | 89 | CreateDirectory "$INSTDIR\ui" |
| 91 | - file "/oname=$INSTDIR\ui\00default.xml" "..\uiui\00default.xml"0default.xml" | 90 | + file "/oname=$INSTDIR\ui\00default.xml" "uiui\00default.xml"0default.xml" |
| 92 | 91 | ||
| 93 | # Charset definition files | 92 | # Charset definition files |
| 94 | CreateDirectory "$INSTDIR\charsets" | 93 | CreateDirectory "$INSTDIR\charsets" |
| 95 | - file "/oname=$INSTDIR\charsets\bracket.xml.xml" "..\charsets\bracket.xml" | 94 | + file "/oname=$INSTDIR\charsets\bracket.xml" "bracket.xml" |
| 96 | 95 | ||
| 97 | # Locale files | 96 | # Locale files |
| 98 | CreateDirectory "$INSTDIR\locale\pt_BR\LC_MESSAGES" | 97 | CreateDirectory "$INSTDIR\locale\pt_BR\LC_MESSAGES" |
| 99 | - file "/oname=$INSTDIR\locale\pt_BR\LC_MESSAGES\@PACKAGE@.mo" "..\.bin\locale\pt_BR\LC_MESSAGES\@PACKAGE@.mo" | 98 | + file "/oname=$INSTDIR\locale\pt_BR\LC_MESSAGES\@PACKAGE@.mo" "locale\pt_BR\LC_MESSAGES\@PACKAGE@.mo" |
| 100 | 99 | ||
| 101 | # Save DataDir | 100 | # Save DataDir |
| 102 | SetRegView @WINARCH@ | 101 | SetRegView @WINARCH@ |
| @@ -137,10 +136,10 @@ SubSection "@PACKAGE@" SecMain | @@ -137,10 +136,10 @@ SubSection "@PACKAGE@" SecMain | ||
| 137 | 136 | ||
| 138 | ${DisableX64FSRedirection} | 137 | ${DisableX64FSRedirection} |
| 139 | CreateDirectory "$INSTDIR\plugins" | 138 | CreateDirectory "$INSTDIR\plugins" |
| 140 | - file "/oname=$INSTDIR\plugins\hllapi.dll" "..\.bin\Release\plugins\hllapi.dll" | 139 | + file "/oname=$INSTDIR\plugins\ipc3270c.dll" "bin\ipc3270c.dll" |
| 141 | 140 | ||
| 142 | ${EnableX64FSRedirection} | 141 | ${EnableX64FSRedirection} |
| 143 | - file "/oname=$SYSDIR\libhllapi.dll" "..\.bin\Release\libhllapi.dll.@PACKAGE_VERSION@" | 142 | + file "/oname=$SYSDIR\libhllapi.dll" "bin\libhllapi.dll" |
| 144 | 143 | ||
| 145 | sectionEnd | 144 | sectionEnd |
| 146 | 145 | ||
| @@ -150,19 +149,19 @@ SubSection "@PACKAGE@" SecMain | @@ -150,19 +149,19 @@ SubSection "@PACKAGE@" SecMain | ||
| 150 | SubSection "Menus, Keypads & Toolbars" SecMenu | 149 | SubSection "Menus, Keypads & Toolbars" SecMenu |
| 151 | 150 | ||
| 152 | Section "Keypad" KeypadMenu | 151 | Section "Keypad" KeypadMenu |
| 153 | - file "/oname=$INSTDIR\ui\10keypad.xml" "..\ui0keypad.xml" | 152 | + file "/oname=$INSTDIR\ui\10keypad.xml" "ui0keypad.xml" |
| 154 | sectionEnd | 153 | sectionEnd |
| 155 | 154 | ||
| 156 | Section "Functions" FunctionsMenu | 155 | Section "Functions" FunctionsMenu |
| 157 | - file "/oname=$INSTDIR\ui\10functions.xml" "..\ui0functions.xml" | 156 | + file "/oname=$INSTDIR\ui\10functions.xml" "ui0functions.xml" |
| 158 | sectionEnd | 157 | sectionEnd |
| 159 | 158 | ||
| 160 | Section /o "View trace Menu" TraceMenu | 159 | Section /o "View trace Menu" TraceMenu |
| 161 | - file "/oname=$INSTDIR\ui\98trace.xml" "..\ui8trace.xml" | 160 | + file "/oname=$INSTDIR\ui\98trace.xml" "ui8trace.xml" |
| 162 | sectionEnd | 161 | sectionEnd |
| 163 | 162 | ||
| 164 | Section /o "Application debug" DBGMenu | 163 | Section /o "Application debug" DBGMenu |
| 165 | - file "/oname=$INSTDIR\ui\99debug.xml" "..\ui9debug.xml" | 164 | + file "/oname=$INSTDIR\ui\99debug.xml" "ui9debug.xml" |
| 166 | sectionEnd | 165 | sectionEnd |
| 167 | 166 | ||
| 168 | SubSectionEnd | 167 | SubSectionEnd |
| @@ -173,7 +172,7 @@ SubSectionEnd | @@ -173,7 +172,7 @@ SubSectionEnd | ||
| 173 | Section /o "GTK+ Runtime" SecGTK | 172 | Section /o "GTK+ Runtime" SecGTK |
| 174 | 173 | ||
| 175 | setOutPath $INSTDIR | 174 | setOutPath $INSTDIR |
| 176 | - file /r "..\.bin\runtime\*.*" | 175 | + file /r "bin\runtime\*.*" |
| 177 | 176 | ||
| 178 | SectionEnd | 177 | SectionEnd |
| 179 | !endif | 178 | !endif |