diff --git a/win/hllapipacket.sh b/win/hllapipacket.sh deleted file mode 100755 index 2b7dc2c..0000000 --- a/win/hllapipacket.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash - - -# -# Gera binários windows -# -# $1 = Arquitetura (x86_32/x86_64) -# -build() -{ - echo -e "\e]2;${PACKAGE_NAME}-${1}\a" - - case ${1} in - x86_32) - host=i686-w64-mingw32 - host_cpu=i686 - prefix=/usr/i686-w64-mingw32/sys-root/mingw - tools=i686-w64-mingw32 - ;; - - x86_64) - host=x86_64-w64-mingw32 - host_cpu=x86_64 - prefix=/usr/x86_64-w64-mingw32/sys-root/mingw - tools=x86_64-w64-mingw32 - ;; - - - *) - failed "Arquitetura desconhecida: ${1}" - - esac - - # Detecto argumentos - ARGS="" - - ./configure \ - --cache-file=.${1}.cache \ - --host=${host} \ - --prefix=${prefix} \ - --disable-rexx - --disable-java \ - --disable-office - - if [ "$?" != "0" ]; then - failed "Erro ao configurar" - fi - - make clean - rm -f *.exe - - make Release - if [ "$?" != "0" ]; then - failed "Erro ao compilar fontes" - fi - - mkdir -p ${TEMPDIR}/package/${host_cpu} - - cp -v .bin/Release/hllapi.dll* ${TEMPDIR}/package/${host_cpu} - if [ "$?" != "0" ]; then - failed "Erro ao copiar pacotes" - fi - - make clean - rm -f *.exe - -} - -myDIR=$(readlink -f $(dirname $0)) -TEMPDIR=$(mktemp -d) -DESTDIR=${HOME}/public_html/win -RUNTIMEDIR=$(mktemp -d) -ARCHS="x86_32 x86_64" -RUNTIME=1 -COMPLETE=1 - -trap cleanup INT - -until [ -z "$1" ] -do - if [ ${1:0:2} = '--' ]; then - tmp=${1:2} - parameter=${tmp%%=*} - parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") - - case $parameter in - - 32) - ARCHS="x86_32" - ;; - - 64) - ARCHS="x86_64" - ;; - - OUT) - DESTDIR=$value - ;; - - ARCH) - value=${tmp##*=} - ARCHS=$value - ;; - - *) - value=${tmp##*=} - eval $parameter=$value - esac - - fi - - shift -done - -# Configura -aclocal -if [ "$?" != "0" ]; then - exit -1 -fi - -autoconf -if [ "$?" != "0" ]; then - exit -1 -fi - -# Gera pacotes -for i in ${ARCHS}; do - - build "${i}" - -done - -cd ${TEMPDIR}/package - -zip -9 -m -r ~/public_html/win/hllapi_$(date "+%Y%m%d").zip . - diff --git a/win/makegtkruntime.sh.in b/win/makegtkruntime.sh.in deleted file mode 100644 index 8125026..0000000 --- a/win/makegtkruntime.sh.in +++ /dev/null @@ -1,352 +0,0 @@ -#!/bin/bash -PKG_CONFIG="@PKG_CONFIG@" -GTK_VERSION="gtk+-@GTK_VERSION@" - -GTK_PREFIX=$($PKG_CONFIG --variable=prefix $GTK_VERSION) -TARGET_PATH=".bin/gtkruntime" - -# Clean target folder -rm -fr "$TARGET_PATH/*" -mkdir -p "$TARGET_PATH" - -copyFile() { - - GTKPATH=$(find "$GTK_PREFIX/bin" -name "$1") - SYSPATH=$(find "/bin" -name "$1") - - if [ ! -z "$GTKPATH" ]; then - echo "$GTKPATH ..." - cp $GTKPATH "$TARGET_PATH" - if [ "$?" != "0" ]; then - echo "Can´t copy $GTKPATH" - return 1 - fi - elif [ ! -z "$SYSPATH" ]; then - echo "$SYSPATH ..." - cp $SYSPATH "$TARGET_PATH" - if [ "$?" != "0" ]; then - echo "Can´t copy $SYSPATH" - return 1 - fi - - else - echo "Can´t find ${GTK_PREFIX}/bin/${1}" - return 1 - fi - - return 0 -} - -copyFiles() { - - while read FILE - do - copyFile "$FILE" - if [ "$?" != "0" ]; then - exit -1 - fi - done < $1 - rm -f $1 - -} - -copy_locale() { - - rm -fr $TARGET_PATH/share/locale/pt_BR/LC_MESSAGES - mkdir -p $TARGET_PATH/share/locale/pt_BR/LC_MESSAGES - - while read FILE - do - echo "$GTK_PREFIX/share/locale/pt_BR/LC_MESSAGES/$FILE ..." - - if [ -e "$GTK_PREFIX/share/locale/pt_BR/LC_MESSAGES/$FILE" ]; then - cp "$GTK_PREFIX/share/locale/pt_BR/LC_MESSAGES/$FILE" "$TARGET_PATH/share/locale/pt_BR/LC_MESSAGES" - if [ "$?" != "0" ]; then - echo "Can´t copy $FILE" - exit -1 - fi - fi - - done < $1 - rm -f $1 -} - -CopyGTK3Theme() { - - mkdir -p ${TARGET_PATH}/share/icons - if [ "$?" != 0 ]; then - echo "Can´t create icons folder" - exit -1 - fi - - cp -rv /usr/share/icons/${1} ${TARGET_PATH}/share/icons - if [ "$?" != 0 ]; then - echo "Can´t copy ${1} icons" - exit -1 - fi - - mkdir -p ${TARGET_PATH}/share/themes - if [ "$?" != 0 ]; then - echo "Can´t create themes folder" - exit -1 - fi - - cp -rv /usr/share/themes/${1} ${TARGET_PATH}/share/themes - if [ "$?" != 0 ]; then - echo "Can´t copy ${1} theme" - exit -1 - fi - - -} - - -gtk3() { - -TEMPFILE="temp1.tmp" -cat > $TEMPFILE << EOF -libglib-*.dll -libintl*.dll -libgmodule*.dll -libgobject*.dll -libffi*.dll -libgtk-*.dll -libgdk-*.dll -libcairo-gobject*.dll -libcairo-2*.dll -libfontconfig-1*.dll -libfreetype-6*.dll -zlib1.dll -libxml2-*.dll -libpixman-1*.dll -libpng*.dll -libgdk_pixbuf*.dll -libgio-*.dll -libjasper-*.dll -libjpeg-8*.dll -libtiff-5*.dll -liblzma-5*.dll -libpango-1*.dll -libpangocairo-1*.dll -libpangoft2-1*.dll -libpangowin32-1*.dll -libatk-*.dll -libcrypto-*.dll -libssl-*.dll -libharfbuzz-0.dll -libstdc++-6.dll -librsvg-*.dll -libepoxy-*.dll -gspawn-win*-helper-console.exe -gspawn-win*-helper.exe -gdk-pixbuf-query-loaders.exe -EOF -copyFiles $TEMPFILE - - -# Copy loaders -GDK_LOADERS=$(${PKG_CONFIG} --variable=gdk_pixbuf_binarydir gdk-pixbuf-2.0)/loaders -GDK_PREFIX=$(${PKG_CONFIG} --variable=prefix gdk-pixbuf-2.0) -GDK_TARGET=$(echo ${GDK_LOADERS}/ | sed -e "s@${GDK_PREFIX}@@g") - -mkdir -p ${TARGET_PATH}/${GDK_TARGET} - -cp -v ${GDK_LOADERS}/* ${TARGET_PATH}/${GDK_TARGET} -if [ "$?" != 0 ]; then - echo "Can´t copy loaders" - exit -1 -fi - - -# Copy optional files -copyFile libgcc_s_sjlj-1.dll -copyFile libgcc_s_seh-1.dll - -# Build locale dirs -cat > $TEMPFILE << EOF -atk10.mo -gdk-pixbuf.mo -glib20.mo -gtk30-properties.mo -EOF - -copy_locale $TEMPFILE - -mkdir -p $TARGET_PATH/share/glib-2.0/schemas -if [ "$?" != 0 ]; then - echo "Can´t create schemas folder" - exit -1 -fi - -#if [ ! -e $GTK_PREFIX/share/glib-2.0/schemas/gschemas.compiled ]; then -# glib-compile-schemas $GTK_PREFIX/share/glib-2.0/schemas -#fi - -#cp $GTK_PREFIX/share/glib-2.0/schemas/gschemas.compiled $TARGET_PATH/share/glib-2.0/schemas/gschemas.compiled -#if [ "$?" != 0 ]; then -# echo "Can´t copy gshemas.compiled" -# exit -1 -#fi - -# Copia Adwaita -CopyGTK3Theme "Adwaita" - -#mkdir -p $TARGET_PATH/share/icons/Adwaita -#if [ "$?" != 0 ]; then -# echo "Can´t create icons folder" -# exit -1 -#fi -# -#cp -rv /usr/share/icons/Adwaita $TARGET_PATH/share/icons/Adwaita -#if [ "$?" != 0 ]; then -# echo "Can´t copy icons" -# exit -1 -#fi -# -#mkdir -p $TARGET_PATH/share/themes/Adwaita -#if [ "$?" != 0 ]; then -# echo "Can´t create Adwaita theme" -# exit -1 -#fi -# -#cp -rv /usr/share/themes/Adwaita $TARGET_PATH/share/themes/Adwaita -#if [ "$?" != 0 ]; then -# echo "Can´t copy Adwaita theme" -# exit -1 -#fi - - -# Copia gnome -#mkdir -p $TARGET_PATH/share/icons/gnome -#if [ "$?" != 0 ]; then -# echo "Can´t create icons folder" -# exit -1 -#fi -# -#cp -rv $GTK_PREFIX/share/icons/gnome $TARGET_PATH/share/icons/gnome -#if [ "$?" != 0 ]; then -# echo "Can´t copy icons" -# exit -1 -#fi - -mkdir -p $TARGET_PATH/etc -cp -rv $GTK_PREFIX/etc/gtk-3.0 $TARGET_PATH/etc/gtk-3.0 -if [ "$?" != 0 ]; then - echo "Can´t copy theme" - exit -1 -fi - -cat > $TARGET_PATH/etc/gtk-3.0/settings.ini << EOF -[Settings] -gtk-theme-name = Adwaita -gtk-icon-theme-name = Adwaita -gtk-fallback-icon-theme = Adwaita -gtk-font-name = Sans 10 -gtk-button-images = 1 -EOF -} - -gtk2() { - -# Build DLL list -TEMPFILE="temp1.tmp" -cat > $TEMPFILE << EOF -intl.dll -libatk-1.0-0.dll -libcairo-2.dll -libgailutil-18.dll -libgdk_pixbuf-2.0-0.dll -libgdk-win32-2.0-0.dll -libgettextlib-0-*.dll -libgettextpo*.dll -libgettextsrc*.dll -libgio-2.0-0.dll -libglib-2.0-0.dll -libgmodule-2.0-0.dll -libgobject-2.0-0.dll -libgthread-2.0-0.dll -libgtk-win32-2.0-0.dll -libpango-1.0-0.dll -libpangocairo-1.0-0.dll -libpangoft2-1.0-0.dll -libpangowin32-1.0-0.dll -zlib1.dll -libpng*.dll -libfontconfig*.dll -libasprintf*.dll -libgettextlib*.dll -libexpat*.dll -freetype*.dll -gspawn-win32-helper-console.exe -gspawn-win32-helper.exe -gdk-pixbuf-query-loaders.exe -EOF - -# jpeg62.dll -# libtiff*.dll -copyFiles $TEMPFILE - -# Build locale dirs -cat > $TEMPFILE << EOF -atk10.mo -gdk-pixbuf.mo -gettext-runtime.mo -gettext-tools.mo -glib20.mo -gtk20-properties.mo -gtk20.mo -libiconv.mo -EOF - -copy_locale $TEMPFILE - -# Copy default theme -THEME_PATH="themes/MS-Windows/gtk-2.0" -rm -fr "$TARGET_PATH/$THEME_PATH" -mkdir -p "$TARGET_PATH/share/$THEME_PATH" - -echo "$GTK_PREFIX/share/$THEME_PATH/gtkrc ..." -cp "$GTK_PREFIX/share/$THEME_PATH/gtkrc" "$TARGET_PATH/share/$THEME_PATH/gtkrc" -if [ "$?" != "0" ]; then - echo "Can´t copy default theme" - exit -1 -fi - -cat > $TEMPFILE << EOF -engines -loaders -EOF - -rm -fr $TARGET_PATH/lib/gtk-2.0/$GTK_RUNTIME_VERSION/ -mkdir -p $TARGET_PATH/lib/gtk-2.0/$GTK_RUNTIME_VERSION/ -while read DIRNAME -do - if [ -d "$GTK_PREFIX/lib/gtk-2.0/$GTK_RUNTIME_VERSION/$DIRNAME" ]; then - echo "$GTK_PREFIX/lib/gtk-2.0/$GTK_RUNTIME_VERSION/$DIRNAME ..." - mkdir -p "$TARGET_PATH/lib/gtk-2.0/$GTK_RUNTIME_VERSION/$DIRNAME" - cp -r "$GTK_PREFIX/lib/gtk-2.0/$GTK_RUNTIME_VERSION/$DIRNAME" "$TARGET_PATH/lib/gtk-2.0/$GTK_RUNTIME_VERSION" - if [ "$?" != "0" ]; then - echo "Can´t copy $DIRNAME" - exit -1 - fi - fi -done < $TEMPFILE -rm -f $TEMPFILE - -mkdir -p $TARGET_PATH/etc/gtk-2.0/ -echo "gtk-theme-name = \"MS-Windows\"" > $TARGET_PATH/etc/gtk-2.0/gtkrc -if [ "$?" != "0" ]; then - echo "Can´t set theme name" - exit -1 -fi - -} - -if [ "$GTK_VERSION" == "gtk+-3.0" ]; then - gtk3 -else - gtk2 -fi - -echo $0 Complete - diff --git a/win/pack.sh b/win/pack.sh index 2467132..f1211f4 100755 --- a/win/pack.sh +++ b/win/pack.sh @@ -1,33 +1,99 @@ #!/bin/bash -myDIR=$(dirname $(readlink -f $0)) -cleanup() +PROJECTDIR=$(dirname $(dirname $(readlink -f ${0}))) +WORKDIR=$(mktemp -d) + +if [ -e /etc/os-release ]; then + . /etc/os-release +fi + +# +# Limpa diretório temporário +# +cleanup() { - # - # Apaga diretorio temporário caso o script seja interrompido - # - cd ${myDIR} - rm -fr ${TEMPDIR} - exit -1 + rm -fr ${WORKDIR} } -failed() +# +# Monta projeto no diretório corrente. +# +build() { - echo -e "\e]2;Failed!\a" - echo $1 - cleanup + make clean + + make all + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + cp -rv .bin/Release/* ${WORKDIR}/build/bin + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + make DESTDIR=${WORKDIR}/build install + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + } +build_plugin() +{ + + echo -e "\e]2;${2}-${1}\a" + + cd ${WORKDIR}/sources/pw3270-plugin-${2} + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + export cache=${WORKDIR}/cache/pw3270-plugin-${2}.cache + + ./configure \ + CFLAGS=${CFLAGS} \ + LDFLAGS=${LDFLAGS} \ + LIB3270_CFLAGS="${LIB3270_CFLAGS}" \ + LIB3270_LIBS="${LIB3270_LIBS}" \ + LIBV3270_CFLAGS="${LIBV3270_CFLAGS}" \ + LIBV3270_LIBS="${LIBV3270_LIBS}" \ + --host=${host} \ + --prefix=${prefix} \ + --libdir=${prefix}/lib + + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + make all + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + cp -rv .bin/Release/* ${WORKDIR}/build/bin + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + +} # -# Gera pacote windows +# Monta binários # # $1 = Arquitetura (x86_32/x86_64) # -build() +pack() { - cd $(dirname $myDIR) - echo -e "\e]2;${1}\a" + + echo -e "\e]2;pw3270-${1}\a" case ${1} in x86_32) @@ -35,6 +101,8 @@ build() host_cpu=i686 prefix=/usr/i686-w64-mingw32/sys-root/mingw tools=i686-w64-mingw32 + pkg_config=/usr/bin/i686-w64-mingw32-pkg-config + mingw_name=mingw32 ;; x86_64) @@ -42,6 +110,8 @@ build() host_cpu=x86_64 prefix=/usr/x86_64-w64-mingw32/sys-root/mingw tools=x86_64-w64-mingw32 + pkg_config=/usr/bin/x86_64-w64-mingw32-pkg-config + mingw_name=mingw64 ;; *) @@ -49,266 +119,390 @@ build() esac +# sudo zypper \ +# --non-interactive \ +# in \ +# ${mingw_name}-libcurl-devel \ +# ${mingw_name}-curl \ +# ${mingw_name}-libopenssl-devel \ +# ${mingw_name}-libintl-devel \ +# ${mingw_name}-atk-devel \ +# ${mingw_name}-pango-devel \ +# ${mingw_name}-win_iconv-devel \ +# ${mingw_name}-pixman-devel \ +# ${mingw_name}-glib2-devel \ +# ${mingw_name}-cairo-devel \ +# ${mingw_name}-freetype-devel \ +# ${mingw_name}-winpthreads-devel \ +# ${mingw_name}-gtk3-devel \ +# ${mingw_name}-cross-gcc-c++ \ +# ${mingw_name}-cross-pkg-config \ +# ${mingw_name}-cross-cpp \ +# ${mingw_name}-cross-binutils \ +# ${mingw_name}-cross-nsis + + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + export HOST_CC=/usr/bin/gcc - export cache=${1}.cache + + rm -fr ${WORKDIR}/cache + mkdir -p ${WORKDIR}/cache + + rm -fr ${WORKDIR}/build + mkdir -p ${WORKDIR}/build/src/include + mkdir -p ${WORKDIR}/build/.bin/Release + + # + # Setup Target dir + # + mkdir -p ${WORKDIR}/build/bin + + export CFLAGS=-I${WORKDIR}/build/${prefix}/include -DWIN32 -D_WIN32 + export LDFLAGS=-L${WORKDIR}/build/bin + export PKG_CONFIG_PATH=${WORKDIR}/build/${prefix}/lib/pkgconfig + + # + # Build lib3270 + # + echo -e "\e]2;lib3270-${1}\a" + + cd ${WORKDIR}/sources/lib3270 + export cache=${WORKDIR}/cache/lib3270.cache ./configure \ - --with-inet-ntop \ + --host=${host} \ + --prefix=${prefix} \ + --libdir=${prefix}/lib \ + --enable-self-signed-cert-check \ + --enable-ssl-crl-check \ + --enable-crl-expiration-check \ + --disable-ldap \ + --enable-curl \ + --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" \ + --with-default-host="tn3270s://3270.df.bb:9023" + + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + build + + export LIB3270_CFLAGS="-DLIB3270_NAME=3270" + export LIB3270_LIBS="-l3270" + + # + # Build libv3270 + # + echo -e "\e]2;libv3270-${1}\a" + + cd ${WORKDIR}/sources/libv3270 + export cache=${WORKDIR}/cache/libv3270.cache + + ./configure \ + CFLAGS=${CFLAGS} \ + LDFLAGS=${LDFLAGS} \ + LIB3270_CFLAGS="${LIB3270_CFLAGS}" \ + LIB3270_LIBS="${LIB3270_LIBS}" \ --host=${host} \ --prefix=${prefix} \ --libdir=${prefix}/lib if [ "$?" != "0" ]; then - failed "Erro ao configurar" + cleanup + exit -1 fi - . ./versions - echo -e "\e]2;${PACKAGE_NAME} - ${1}\a" - - make clean - rm -f *.exe + build + + export LIBV3270_CFLAGS="-DLIBV3270_MODE=3270" + export LIBV3270_LIBS="-lv3270" + + # + # Build main application + # + echo -e "\e]2;pw3270-${1}\a" + + cd ${WORKDIR}/sources/pw3270 + export cache=${WORKDIR}/cache/application.cache + + ./configure \ + CFLAGS=${CFLAGS} \ + LDFLAGS=${LDFLAGS} \ + LIB3270_CFLAGS="${LIB3270_CFLAGS}" \ + LIB3270_LIBS="${LIB3270_LIBS}" \ + LIBV3270_CFLAGS="${LIBV3270_CFLAGS}" \ + LIBV3270_LIBS="${LIBV3270_LIBS}" \ + --host=${host} \ + --prefix=${prefix} \ + --libdir=${prefix}/lib \ + --with-source-locales=${WORKDIR}/locale - make all if [ "$?" != "0" ]; then - failed "Erro ao compilar fontes" + cleanup + exit -1 fi - rm -f ./win/*.exe + mkdir -p ${WORKDIR}/locale - if [ -e branding/${PACKAGE_TARNAME}.svg ]; then - rm -f win/${PACKAGE_TARNAME}.ico - convert -density 384 -background transparent branding/${PACKAGE_TARNAME}.svg -define icon:auto-resize -colors 256 win/${PACKAGE_TARNAME}.ico + cp ${WORKDIR}/sources/lib3270/.pot/*.pot ${WORKDIR}/locale + if [ "$?" != "0" ]; then + cleanup + exit -1 fi - mkdir -p ${DESTDIR}/${PACKAGE_NAME}/${1} + cp ${WORKDIR}/sources/libv3270/.pot/*.pot ${WORKDIR}/locale + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi - if [ "${RUNTIME}" == "1" ]; then + build - makensis ./win/${PACKAGE}.nsi - if [ "$?" != "0" ]; then - failed "Erro ao gerar instalador sem gtk" - fi - - mv -f ./win/${PACKAGE}-${PACKAGE_VERSION}-requires-gtk-${GTK_MODVERSION}-${host_cpu}.exe \ - ${DESTDIR}/${PACKAGE_NAME}/${1} + # + # Build plugins + # + build_plugin ${1} hllapi - if [ "$?" != "0" ]; then - failed "Erro ao copiar instalador sem gtk para ${1}" - fi + # + # Install data & icons + # + echo -e "\e]2;pw3270-icons-${1}\a" + + cd ${WORKDIR}/sources/pw3270 + + make -C ${WORKDIR}/sources/pw3270 locale + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + cp -rv .bin/locale ${WORKDIR}/build + if [ "$?" != "0" ]; then + cleanup + exit -1 fi - if [ "${COMPLETE}" == "1" ]; then + mkdir -p ${WORKDIR}/build/win - chmod +x ./win/makeruntime.sh - ./win/makeruntime.sh + mkdir -p ${WORKDIR}/sources/pw3270/.bin/Release + cp -rv ${WORKDIR}/build/bin/* ${WORKDIR}/sources/pw3270/.bin/Release - makensis -DWITHGTK ./win/${PACKAGE}.nsi - if [ "$?" != "0" ]; then - failed "Erro ao gerar instalador com runtime" - fi + chmod +x ${WORKDIR}/sources/pw3270/win/makeruntime.sh + ${WORKDIR}/sources/pw3270/win/makeruntime.sh + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi - mv -f ./win/${PACKAGE}-${PACKAGE_VERSION}-gtk-${GTK_MODVERSION}-${host_cpu}.exe \ - ${DESTDIR}/${PACKAGE_NAME}/${1} + mkdir -p ${WORKDIR}/build/bin + cp -rv ${WORKDIR}/sources/pw3270/.bin/runtime ${WORKDIR}/build/bin + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi - if [ "$?" != "0" ]; then - failed "Erro ao copiar instalador completo para ${1}" - fi + # + # Copy branding + # + cp ${WORKDIR}/branding/*.ico ${WORKDIR}/build + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + cp ${WORKDIR}/branding/*.png ${WORKDIR}/build + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + cp ${WORKDIR}/branding/AUTHORS ${WORKDIR}/build + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + cp ${WORKDIR}/branding/LICENSE ${WORKDIR}/build + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + cp -rv ${WORKDIR}/branding/ui ${WORKDIR}/build + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + # + # Create installation package + # + echo -e "\e]2;pw3270-package-${1}\a" + + cd ${WORKDIR}/build + + cp ${WORKDIR}/sources/pw3270/win/pw3270.nsi ./pw3270.nsi + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + + echo "------------------------------------------------------" + echo makensis -DWITHGTK pw3270.nsi + + /bin/bash + + makensis -DWITHGTK pw3270.nsi + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi - ln -sf ${1}/${PACKAGE}-${PACKAGE_VERSION}-gtk-${GTK_MODVERSION}-${host_cpu}.exe \ - ${DESTDIR}/${PACKAGE_NAME}/${PACKAGE}-latest-${host_cpu}.exe + cp -v ./win/*.exe ${PROJECTDIR} + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi + if [ -d ~/public_html ]; then + mkdir -p ~/public_html/win/pw3270/${1} + cp -v ./win/*.exe ~/public_html/win/pw3270/${1} if [ "$?" != "0" ]; then - failed "Erro ao criar link para ${1}" + cleanup + exit -1 fi fi - make clean - rm -fr .bin +# if [ ! -z ${WIN_PACKAGE_SERVER} ]; then +# scp ./win/*.exe ${WIN_PACKAGE_SERVER}/pw3270 +# if [ "$?" != "0" ]; then +# cleanup +# exit -1 +# fi +# fi } -TEMPDIR=$(mktemp -d) -ARCHS="x86_32 x86_64" -WINREPO="" -DESTDIR=${HOME}/public_html/win -RUNTIME=0 -COMPLETE=1 +# +# Get sources from GIT +# +mkdir -p ${WORKDIR}/sources -if [ -e ~/.config/pw3270-win.conf ]; then - . ~/.config/pw3270-win.conf -fi +for src in lib3270 libv3270 pw3270 pw3270-plugin-hllapi; do -rm -f ${myDIR}/*.exe \ - ${myDIR}/*.zip + echo "Baixando ${src}..." + echo -e "\e]2;Downloading ${src}\a" -trap cleanup INT + git clone https://github.com/PerryWerneck/${src}.git ${WORKDIR}/sources/${src} + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi -until [ -z "$1" ] -do - if [ ${1:0:2} = '--' ]; then - tmp=${1:2} - parameter=${tmp%%=*} - parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") + cd ${WORKDIR}/sources/${src} - case $parameter in + NOCONFIGURE=1 ./autogen.sh + if [ "$?" != "0" ]; then + cleanup + exit -1 + fi - 32) - ARCHS="x86_32" - ;; - 64) - ARCHS="x86_64" - ;; +done - FULL) - COMPLETE=1 - RUNTIME=1 - ;; +# +# Setup branding +# +echo -e "\e]2;Branding\a" - RT) - COMPLETE=0 - RUNTIME=1 - ;; +mkdir -p ${WORKDIR}/branding - OUT) - DESTDIR=$value - ;; +BRANDING_SOURCES=${WORKDIR}/sources/pw3270/branding - REPO) - WINREPO=$value - ;; +cp -rv ${BRANDING_SOURCES}/* ${WORKDIR}/branding +if [ "$?" != "0" ]; then + cleanup + exit -1 +fi - ARCH) - value=${tmp##*=} - ARCHS=$value - ;; +convert -density 384 -background transparent ${BRANDING_SOURCES}/pw3270.svg -define icon:auto-resize -colors 256 ${WORKDIR}/branding/pw3270.ico +if [ "$?" != "0" ]; then + cleanup + exit -1 +fi - *) - value=${tmp##*=} - eval $parameter=$value - esac +convert -background transparent ${BRANDING_SOURCES}/pw3270.svg ${WORKDIR}/branding/pw3270.png +if [ "$?" != "0" ]; then + cleanup + exit -1 +fi - fi +optipng -o7 ${WORKDIR}/branding/pw3270.png +if [ "$?" != "0" ]; then + cleanup + exit -1 +fi - shift -done +convert -background transparent ${BRANDING_SOURCES}/pw3270-logo.svg ${WORKDIR}/branding/pw3270-logo.png +if [ "$?" != "0" ]; then + cleanup + exit -1 +fi -# Configura -aclocal +optipng -o7 ${WORKDIR}/branding/pw3270-logo.png if [ "$?" != "0" ]; then + cleanup exit -1 fi -autoconf +cp ${WORKDIR}/sources/pw3270/AUTHORS ${WORKDIR}/branding if [ "$?" != "0" ]; then + cleanup exit -1 fi -# Gera pacotes -for i in ${ARCHS}; do - build "${i}" -done +cp ${WORKDIR}/sources/pw3270/LICENSE ${WORKDIR}/branding +if [ "$?" != "0" ]; then + cleanup + exit -1 +fi + +cp ${WORKDIR}/sources/pw3270/conf/colors.conf ${WORKDIR}/branding +if [ "$?" != "0" ]; then + cleanup + exit -1 +fi + +cp -rv ${WORKDIR}/sources/pw3270/ui ${WORKDIR}/branding +if [ "$?" != "0" ]; then + cleanup + exit -1 +fi -#if [ "${RUNTIME}" == "1" ]; then -# -# echo -e "\e]2;Baixando runtime\a" -# -# mkdir -p ${TEMPDIR}/runtime -# cd ${TEMPDIR}/runtime -# -# # -# # Puxo scripts de construção do GTK direto da sourceforge. -# # -# git clone http://git.code.sf.net/p/gtk3win/code . -# if [ "$?" != "0" ]; then -# echo "Erro ao baixar fontes do runtime" -# exit -1 -# fi -# -# for i in ${ARCHS}; do -# -# echo -e "\e]2;gtk-runtime-${i}\a" -# -# case ${i} in -# x86_32) -# host_cpu=i686 -# ./win32.sh -# if [ "$?" != "0" ]; then -# exit -1 -# fi -# ;; -# -# x86_64) -# host_cpu=x86_64 -# ./win64.sh -# if [ "$?" != "0" ]; then -# exit -1 -# fi -# ;; -# -# *) -# echo "Arquitetura desconhecida ${i}" -# exit -1 -# -# esac -# -# chmod +x ./win/makeruntime.sh -# -# ./win/makeruntime.sh -# if [ "$?" != "0" ]; then -# exit -1 -# fi -# -# # Copia o pacote gerado -# FILENAME=$(find . -maxdepth 1 -name "gtk-runtime-*-${host_cpu}.exe" | head --lines 1) -# -# mkdir -p ${DESTDIR}/${host_cpu} -# -# mv gtk-runtime-*-${host_cpu}.exe ${DESTDIR}/${host_cpu} -# if [ "$?" != "0" ]; then -# failed "Erro ao copiar instalador" -# fi -# -# ln -sf $(basename ${FILENAME}) "${DESTDIR}/${host_cpu}/gtk-runtime-latest-${host_cpu}.exe" -# if [ "$?" != "0" ]; then -# failed "Erro ao criar o link simbólico" -# fi # -# done +# Create installers # -#fi +pack x86_32 +#pack x86_64 + +cleanup + + + + + -cd $(dirname $myDIR) -rm -fr ${TEMPDIR} -# Gera pacotes para envio ao SPB -rm -f ${DESTDIR}/${PACKAGE}-latest.zip -zip -9 -r -j \ - ${DESTDIR}/${PACKAGE}-latest.zip \ - $(readlink -f ${DESTDIR}/${PACKAGE_NAME}/${PACKAGE}-latest-i686.exe) \ - $(readlink -f ${DESTDIR}/${PACKAGE_NAME}/${PACKAGE}-latest-x86_64.exe) -echo -e "\e]2;Success!\a" -# Copia para repositório -if [ "${WINREPO}" != "" ]; then - echo "Copiando arquivos para ${WINREPO}..." - scp $(readlink -f ${DESTDIR}/${PACKAGE_NAME}/${PACKAGE}-latest-i686.exe) ${WINREPO}/x86_32 - if [ "$?" != "0" ]; then - echo "Erro ao copiar versão de 32 bits para o repositório" - exit -1 - fi - scp $(readlink -f ${DESTDIR}/${PACKAGE_NAME}/${PACKAGE}-latest-x86_64.exe) ${WINREPO}/x86_64 - if [ "$?" != "0" ]; then - echo "Erro ao copiar versão de 64 bits para o repositório" - exit -1 - fi -fi diff --git a/win/pw3270.nsi.in b/win/pw3270.nsi.in index bb6dbb3..1edfbd9 100644 --- a/win/pw3270.nsi.in +++ b/win/pw3270.nsi.in @@ -35,7 +35,7 @@ VIAddVersionKey "LegalCopyright" "GPL-2.0" !define MUI_ABORTWARNING # !insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "../LICENSE" +!insertmacro MUI_PAGE_LICENSE "LICENSE" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES @@ -67,20 +67,19 @@ SubSection "@PACKAGE@" SecMain createShortCut "$DESKTOP\@PACKAGE@.lnk" "$INSTDIR\@PACKAGE@.exe" # Binary files - file "/oname=$INSTDIR\@PACKAGE@.exe" "..\.bin\Release\@PACKAGE@.exe" - file "/oname=$INSTDIR\@PACKAGE@.ico" "@PACKAGE@.ico" - file "/oname=$INSTDIR\lib3270.dll.@PACKAGE_VERSION@" "..\.bin\Release\lib3270.dll.@PACKAGE_VERSION@" - file "/oname=$INSTDIR\@PACKAGE@.dll.@PACKAGE_VERSION@" "..\.bin\Release\@PACKAGE@.dll.@PACKAGE_VERSION@" + file "/oname=$INSTDIR\@PACKAGE@.exe" "bin\@PACKAGE@.exe" + file "/oname=$INSTDIR\@PACKAGE@.ico" "@PACKAGE@.ico" + file "/oname=$INSTDIR\lib3270.dll.@PACKAGE_VERSION@" "bin\lib3270.dll.@PACKAGE_VERSION@" + file "/oname=$INSTDIR\@PACKAGE@.dll.@PACKAGE_VERSION@" "bin\@PACKAGE@.dll.@PACKAGE_VERSION@" # Configuration files - file "/oname=$INSTDIR\@PACKAGE@-logo.png" "..\.bin\@PACKAGE@-logo.png" - file "/oname=$INSTDIR\@PACKAGE@.png" "..\.bin\@PACKAGE@.png" - file "/oname=$INSTDIR\colors.conf" "..\conf\colors.conf" + file "/oname=$INSTDIR\@PACKAGE@-logo.png" "@PACKAGE@-logo.png" + file "/oname=$INSTDIR\@PACKAGE@.png" "@PACKAGE@.png" + file "/oname=$INSTDIR\colors.conf" "colors.conf" # Documentation files - #file "/oname=$INSTDIR\ChangeLog" "..\ChangeLog" - file "/oname=$INSTDIR\AUTHORS" "..\AUTHORS" - file "/oname=$INSTDIR\LICENSE" "..\LICENSE" + file "/oname=$INSTDIR\AUTHORS" "AUTHORS" + file "/oname=$INSTDIR\LICENSE" "LICENSE" # Misc folders CreateDirectory "$INSTDIR\certs" @@ -88,15 +87,15 @@ SubSection "@PACKAGE@" SecMain # UI definition files CreateDirectory "$INSTDIR\ui" - file "/oname=$INSTDIR\ui\00default.xml" "..\ui\00default.xml" + file "/oname=$INSTDIR\ui\00default.xml" "ui\00default.xml" # Charset definition files CreateDirectory "$INSTDIR\charsets" - file "/oname=$INSTDIR\charsets\bracket.xml.xml" "..\charsets\bracket.xml" + file "/oname=$INSTDIR\charsets\bracket.xml" "bracket.xml" # Locale files CreateDirectory "$INSTDIR\locale\pt_BR\LC_MESSAGES" - file "/oname=$INSTDIR\locale\pt_BR\LC_MESSAGES\@PACKAGE@.mo" "..\.bin\locale\pt_BR\LC_MESSAGES\@PACKAGE@.mo" + file "/oname=$INSTDIR\locale\pt_BR\LC_MESSAGES\@PACKAGE@.mo" "locale\pt_BR\LC_MESSAGES\@PACKAGE@.mo" # Save DataDir SetRegView @WINARCH@ @@ -137,10 +136,10 @@ SubSection "@PACKAGE@" SecMain ${DisableX64FSRedirection} CreateDirectory "$INSTDIR\plugins" - file "/oname=$INSTDIR\plugins\hllapi.dll" "..\.bin\Release\plugins\hllapi.dll" + file "/oname=$INSTDIR\plugins\ipc3270c.dll" "bin\ipc3270c.dll" ${EnableX64FSRedirection} - file "/oname=$SYSDIR\libhllapi.dll" "..\.bin\Release\libhllapi.dll.@PACKAGE_VERSION@" + file "/oname=$SYSDIR\libhllapi.dll" "bin\libhllapi.dll" sectionEnd @@ -150,19 +149,19 @@ SubSection "@PACKAGE@" SecMain SubSection "Menus, Keypads & Toolbars" SecMenu Section "Keypad" KeypadMenu - file "/oname=$INSTDIR\ui\10keypad.xml" "..\ui\10keypad.xml" + file "/oname=$INSTDIR\ui\10keypad.xml" "ui\10keypad.xml" sectionEnd Section "Functions" FunctionsMenu - file "/oname=$INSTDIR\ui\10functions.xml" "..\ui\10functions.xml" + file "/oname=$INSTDIR\ui\10functions.xml" "ui\10functions.xml" sectionEnd Section /o "View trace Menu" TraceMenu - file "/oname=$INSTDIR\ui\98trace.xml" "..\ui\98trace.xml" + file "/oname=$INSTDIR\ui\98trace.xml" "ui\98trace.xml" sectionEnd Section /o "Application debug" DBGMenu - file "/oname=$INSTDIR\ui\99debug.xml" "..\ui\99debug.xml" + file "/oname=$INSTDIR\ui\99debug.xml" "ui\99debug.xml" sectionEnd SubSectionEnd @@ -173,7 +172,7 @@ SubSectionEnd Section /o "GTK+ Runtime" SecGTK setOutPath $INSTDIR - file /r "..\.bin\runtime\*.*" + file /r "bin\runtime\*.*" SectionEnd !endif -- libgit2 0.21.2