Commit 13866a4309f3e107c1658fbf10ccff613cbb03a6

Authored by Perry Werneck
1 parent f5a4e0ac

Working on windows package build.

Showing 1 changed file with 27 additions and 29 deletions   Show diff stats
@@ -36,7 +36,7 @@ PACKAGE_EXTRAS="libhllapi pw3270-keypads" @@ -36,7 +36,7 @@ PACKAGE_EXTRAS="libhllapi pw3270-keypads"
36 TARGET_ARCHS="x86_64" 36 TARGET_ARCHS="x86_64"
37 37
38 GIT_URL="https://github.com/PerryWerneck" 38 GIT_URL="https://github.com/PerryWerneck"
39 -BUILD_UNSTABLE=0 39 +BUILD_BRANCH="master"
40 MAKE_ZIP=0 40 MAKE_ZIP=0
41 CLEAR_TARGET_PATH=0 41 CLEAR_TARGET_PATH=0
42 42
@@ -83,17 +83,16 @@ failed() @@ -83,17 +83,16 @@ failed()
83 # 83 #
84 clone() 84 clone()
85 { 85 {
86 - echo -e "\e]2;Cloning ${1}\a"  
87 86
88 mkdir -p ${WORKDIR}/sources 87 mkdir -p ${WORKDIR}/sources
89 88
90 - if [ "${BUILD_UNSTABLE}" == "1" ]; then  
91 - BRANCH="develop"  
92 - else  
93 - TEMPVAR=$(echo ${1}_branch | sed -e "s@-@@g")  
94 - BRANCH=${!TEMPVAR} 89 + TEMPVAR=$(echo ${1}_branch | sed -e "s@-@@g")
  90 + BRANCH=${!TEMPVAR}
  91 + if [ -z ${BRANCH} ]; then
  92 + BRANCH=${BUILD_BRANCH}
95 fi 93 fi
96 94
  95 + echo -e "\e]2;Cloning ${1} ${BRANCH}\a"
97 echo "Cloning ${1} ${BRANCH}" 96 echo "Cloning ${1} ${BRANCH}"
98 if [ -z ${BRANCH} ]; then 97 if [ -z ${BRANCH} ]; then
99 git clone --quiet ${GIT_URL}/${1}.git ${WORKDIR}/sources/${1} 98 git clone --quiet ${GIT_URL}/${1}.git ${WORKDIR}/sources/${1}
@@ -424,7 +423,7 @@ buildApplication() @@ -424,7 +423,7 @@ buildApplication()
424 fi 423 fi
425 done 424 done
426 425
427 - if [ "${BUILD_UNSTABLE}" == "1" ]; then 426 + if [ "${BUILD_BRANCH}" == "develop" ]; then
428 APP_OPTIONS="--enable-unstable" 427 APP_OPTIONS="--enable-unstable"
429 else 428 else
430 APP_OPTIONS="" 429 APP_OPTIONS=""
@@ -569,13 +568,22 @@ copy_install_file() { @@ -569,13 +568,22 @@ copy_install_file() {
569 failed "Can't copy ${1} to ${FILENAME}" 568 failed "Can't copy ${1} to ${FILENAME}"
570 fi 569 fi
571 570
572 - if [ ${BUILD_UNSTABLE} == "1" ]; then 571 + case ${BUILD_BRANCH} in
  572 + develop)
573 TARGET_PATH="/${PRODUCT_NAME}/unstable/${ARCH}" 573 TARGET_PATH="/${PRODUCT_NAME}/unstable/${ARCH}"
574 FILENAME=${PROJECTDIR}/dist/unstable/${ARCH}/$(basename ${1}) 574 FILENAME=${PROJECTDIR}/dist/unstable/${ARCH}/$(basename ${1})
575 - else 575 + ;;
  576 +
  577 + master)
576 TARGET_PATH="/${PRODUCT_NAME}/stable/${ARCH}" 578 TARGET_PATH="/${PRODUCT_NAME}/stable/${ARCH}"
577 FILENAME=${PROJECTDIR}/dist/stable/${ARCH}/$(basename ${1}) 579 FILENAME=${PROJECTDIR}/dist/stable/${ARCH}/$(basename ${1})
578 - fi 580 + ;;
  581 +
  582 + *)
  583 + TARGET_PATH="/${PRODUCT_NAME}/${BUILD_BRANCH}/${ARCH}"
  584 + FILENAME=${PROJECTDIR}/dist/${BUILD_BRANCH}/${ARCH}/$(basename ${1})
  585 +
  586 + esac
579 587
580 if [ "${CLEAR_TARGET_PATH}" == "1" ]; then 588 if [ "${CLEAR_TARGET_PATH}" == "1" ]; then
581 rm -fr "$(dirname ${FILENAME})/*" 589 rm -fr "$(dirname ${FILENAME})/*"
@@ -798,21 +806,6 @@ do @@ -798,21 +806,6 @@ do
798 806
799 CLEAR) 807 CLEAR)
800 CLEAR_TARGET_PATH=1 808 CLEAR_TARGET_PATH=1
801 -  
802 -# if [ ${BUILD_UNSTABLE} == "1" ]; then  
803 -# CLEAR_TARGET="${PRODUCT_NAME}/unstable"  
804 -# else  
805 -# CLEAR_TARGET="${PRODUCT_NAME}/stable"  
806 -# fi  
807 -#  
808 -# if [ -d ~/public_html/win/${STORAGE_PATH} ]; then  
809 -# echo rm -fr ~/public_html/win/${CLEAR_TARGET}/{x86_32,x86_64}  
810 -# fi  
811 -#  
812 -# if [ ! -z "${XDG_PUBLICSHARE_DIR}" ] && [ -d "${XDG_PUBLICSHARE_DIR}/${CLEAR_TARGET}" ]; then  
813 -# echo rm -fr ${XDG_PUBLICSHARE_DIR}/${CLEAR_TARGET}/{x86_32,x86_64}  
814 -# fi  
815 -  
816 ;; 809 ;;
817 810
818 EXTRA-PACKAGES) 811 EXTRA-PACKAGES)
@@ -836,11 +829,15 @@ do @@ -836,11 +829,15 @@ do
836 ;; 829 ;;
837 830
838 UNSTABLE) 831 UNSTABLE)
839 - BUILD_UNSTABLE=1 832 + BUILD_BRANCH="develop"
840 ;; 833 ;;
841 834
842 DEVELOP) 835 DEVELOP)
843 - BUILD_UNSTABLE=1 836 + BUILD_BRANCH="develop"
  837 + ;;
  838 +
  839 + BRANCH)
  840 + BUILD_BRANCH=${value}
844 ;; 841 ;;
845 842
846 SHELL-ON-ERROR) 843 SHELL-ON-ERROR)
@@ -863,7 +860,8 @@ do @@ -863,7 +860,8 @@ do
863 860
864 echo " --product-name Set the product name (current is ${PRODUCT_NAME})" 861 echo " --product-name Set the product name (current is ${PRODUCT_NAME})"
865 echo " --project-path Set the path for the customization data" 862 echo " --project-path Set the path for the customization data"
866 - echo " --unstable Build unstable version" 863 + echo " --unstable Build unstable version (--branch=develop)"
  864 + echo " --branch Build selected branch (current=${BUILD_BRANCH}"
867 865
868 echo " --target-archs Set the target architectures (current are ${TARGET_ARCHS})" 866 echo " --target-archs Set the target architectures (current are ${TARGET_ARCHS})"
869 echo " --sources-from Base URL of the git server with the sources (current is ${GIT_URL})" 867 echo " --sources-from Base URL of the git server with the sources (current is ${GIT_URL})"