This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository buildscripts. from 725783c bin/{{s,}build-deb-package,build-{nsis,rpm}-package}: do not *ever* make local copies of git repositories with hardlinks in them. new fcadf15 bin: copy sbuild-deb-package as build-osx-package and create build+upload and upload symlinks. new 3eb67fa bin/build-osx-package: rewrite for the OS X builder. new 78ee006 home/.buildscripts/x2go.conf: add OS X-specific variables. new 992236e bin/common.sh: add formerly SUSE-specific version fetching functions. new 67414a2 bin/build-rpm-package: remove SUSE-specific version fetching functions and use the new generic ones in bin/common.sh new c548b92 bin/signtarballs: let script take a parameter which is the dir containing tarballs/binaries. new b523803 bin/sbuild-deb-package: backport arch variable rename. new 9028f70 bin/sbuild-deb-package: backport comment changes. new 23e9b89 bin/build-rpm-package: backport comment changes. new ebd334e bin/build-nsis-package.sh: sanitize some ssh calls. new 15df6c1 bin/build-rpm-package: sanitize SSH calls. new 02e8f45 bin/build-rpm-package: use more quoting when applying quilt patches. The 12 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: bin/build+upload-osx-package | 1 + bin/build-nsis-package.sh | 4 +- bin/build-osx-package | 344 +++++++++++++++++++++++++++++++++++++++++++ bin/build-rpm-package | 74 ++-------- bin/common.sh | 42 ++++++ bin/sbuild-deb-package | 22 +-- bin/signtarballs | 12 +- bin/upload-osx-package | 1 + home/.buildscripts/x2go.conf | 3 + 9 files changed, 432 insertions(+), 71 deletions(-) create mode 120000 bin/build+upload-osx-package create mode 100755 bin/build-osx-package create mode 120000 bin/upload-osx-package -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 3eb67fa4028787c6bad2ffce4c227df6307712a2 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 6 08:23:50 2017 +0200 bin/build-osx-package: rewrite for the OS X builder. --- bin/build-osx-package | 325 +++++++++++++++++++------------------------------- 1 file changed, 121 insertions(+), 204 deletions(-) diff --git a/bin/build-osx-package b/bin/build-osx-package index ccb4b86..096db91 100755 --- a/bin/build-osx-package +++ b/bin/build-osx-package @@ -26,10 +26,8 @@ GIT_HOSTNAME="git.mydomain.org" DEBEMAIL="firstname.lastname@mydomain.org" DEBFULLNAME="Firstname Lastname" GPG_KEY="" -DEB_DISTS_SUPPORTED="debian ubuntu raspbian" -DEBIAN_DISTROS="lenny,squeeze,wheezy,jessie,stretch,sid" -RASPBIAN_DISTROS="jessie" -UBUNTU_DISTROS="lucid,precise,trusty,xenial,yakkety" +OSX_DISTROS="10.10,10.12" +OSX_REPOS_BASE="/var/www/" COMPONENT_RELEASE="main" COMPONENT_NIGHTLY="nightly" @@ -53,11 +51,11 @@ test -f "${HOME}/.buildscripts/${PREFIX}.conf" && . "${HOME}/.buildscripts/${PRE : ${NO_DELAY:="no"} : ${FORCE_BUILD:="no"} -: ${DEB_BUILD_FOR:="debian:${DEBIAN_DISTROS} ubuntu:${UBUNTU_DISTROS} raspbian:${RASPBIAN_DISTROS}"} -: ${FLAVOR:="native"} +: ${OSX_BUILD_FOR:="${OSX_DISTROS}"} # These parts are not user-serviceable. typeset -ag temp_cleanup="" +typeset -g upstream_version="" # End of non-user-serviceable part. set -ex @@ -77,7 +75,6 @@ cleanup () { trap cleanup ERR EXIT SIGTERM SIGINT SIGHUP SIGPIPE SIGALRM SIGUSR1 SIGUSR2 set_vars() { - SBUILD="sbuild" TEMP_BASE="${HOME}/tmp/" mkdir -p -- "${TEMP_BASE}" chmod 2770 -- "${TEMP_BASE}" @@ -86,7 +83,6 @@ set_vars() { PROJECT_PATH="${1}" PROJECT_PATH="${PROJECT_PATH/%.git/}" PROJECT="$(basename "${PROJECT_PATH}")" - DEBSRCPKG="${PROJECT}" # grab repository component area from command line (2nd argv) or guess it ARGV2_COMPONENT="$(cut -d"/" -f1 <<< "${2}/")" @@ -117,18 +113,10 @@ set_vars() { mkdir -p -- "${PROJECT_DIR}" mkdir -p -- "${PKGDIST}" - # by default we build for all current debian versions + # by default we build for all current OS X versions if [ "x${ARGV2_CODENAME}" != "x" ]; then - if [[ "$FLAVOR" = "raspbian" ]]; then - if grep -qs "${ARGV2_CODENAME}" <<< "${RASPBIAN_DISTROS}"; then - DEB_BUILD_FOR="raspbian:${ARGV2_CODENAME}" - fi - else - if grep -qs "${ARGV2_CODENAME}" <<< "${DEBIAN_DISTROS}"; then - DEB_BUILD_FOR="debian:${ARGV2_CODENAME}" - elif grep -qs "${ARGV2_CODENAME}" <<< "${UBUNTU_DISTROS}"; then - DEB_BUILD_FOR="ubuntu:${ARGV2_CODENAME}" - fi + if grep -qs "${ARGV2_CODENAME}" <<< "${OSX_DISTROS}"; then + OSX_BUILD_FOR="${ARGV2_CODENAME}" fi fi @@ -168,232 +156,161 @@ prepare_workspace() { GIT_OBJECT_ID="$(git rev-parse --verify HEAD)" cd "${PROJECT_DIR}" - # extract Debian source package name from debian/changelog - if [ -e debian/changelog ]; then - DEBSRCPKG="$(dpkg-parsechangelog -S Source)" - fi - return 0 } +# Cleans up the pkgdist directory used for building packages. +# Does not take parameters. +# Does not "return" anything. clear_pkgdist() { - # pkgdist directory cleanup - # Do NOT spawn a subshell here. # Allow changing global variables in the main process. - typeset -a deb_build_for_arr + typeset -a osx_build_for_arr typeset OLDIFS="${IFS}" IFS=" " - read -a deb_build_for_arr <<< "${DEB_BUILD_FOR}" + read -a osx_build_for_arr <<< "${OSX_BUILD_FOR}" IFS="${OLDIFS}" typeset line="" - for line in "${deb_build_for_arr[@]}"; do - l_DIST="$(cut -d":" -f1 <<< "${line/: /:}" | tr [:upper:] [:lower:])" - l_CODENAMES="${CODENAMES:-$(cut -d":" -f2- <<< "${line/: /:}" | sed -e 's/,/ /g' | tr [:upper:] [:lower:])}" - grep -qs "${l_DIST}" <<< "${DEB_DISTS_SUPPORTED}" && { - for l_CODENAME in ${l_CODENAMES}; do - - # in case we build a special CODENAME (squeeze, wheezy, lucid, ...) do skip - # the wrong distribution here... - test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break - - typeset arch="amd64 i386" - - [ "${l_DIST}" = "raspbian" ] && arch="armhf" - - for l_ARCH in ${arch}; do - [ "x${SKIP_ARCH}" != "x${l_ARCH}" ] && { - mkdir -p -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/dupload.conf" - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*_*.changes - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*_*.upload - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*_*.build - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*_*.dsc - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*_*.tar.gz - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*.deb - } - done - done - } + for line in "${osx_build_for_arr[@]}"; do + l_CODENAMES="${CODENAMES:-$(sed -e 's/,/ /g' <<< "${line}" | tr [:upper:] [:lower:])}" + for l_CODENAME in ${l_CODENAMES}; do + + # in case we build a special CODENAME (squeeze, wheezy, lucid, ...) do skip + # the wrong distribution here... + test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break + + mkdir -p -- "${PKGDIST}/${l_CODENAME}/" + rm -f -- "${PKGDIST}/${l_CODENAME}/"*.dmg + rm -f -- "${PKGDIST}/${l_CODENAME}/"*.dmg.git.txt + done done return 0 } build_packages() { - # use pbuilder for building all variants of this package - # Do NOT spawn a subshell here. # Allow changing global variables in the main process. - typeset -a deb_build_for_arr + typeset -a osx_build_for_arr typeset OLDIFS="${IFS}" IFS=" " - read -a deb_build_for_arr <<< "${DEB_BUILD_FOR}" + read -a osx_build_for_arr <<< "${OSX_BUILD_FOR}" IFS="${OLDIFS}" typeset line="" - for line in "${deb_build_for_arr[@]}"; do - l_DIST="$(cut -d":" -f1 <<< "${line/: /:}" | tr [:upper:] [:lower:])" - l_CODENAMES="${CODENAMES:-$(cut -d":" -f2- <<< "${line/: /:}" | sed -e 's/,/ /g' | tr [:upper:] [:lower:])}" - grep -qs "${l_DIST}" <<< "${DEB_DISTS_SUPPORTED}" && { - for l_CODENAME in ${l_CODENAMES}; do - - # in case we build a special CODENAME (squeeze, wheezy, lucid, ...) do skip - # the wrong distribution here... - test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break - - TEMP_DIR="$(mktemp -d --tmpdir="${TEMP_BASE}" "tmp.$(repeat_str "X" "24")")" - temp_cleanup+=("${TEMP_DIR}") - mkdir -p -- "${TEMP_DIR}/${PROJECT}" - chmod 2770 -Rf -- "${TEMP_DIR}" - - cd "${PROJECT_DIR}" - git clone --no-hardlinks --no-local "${PROJECT_DIR}" "${TEMP_DIR}/${PROJECT}/" - cd "${TEMP_DIR}/${PROJECT}" - git checkout "${CHECKOUT}" || git checkout master - find "${PROJECT_DIR}/../" -maxdepth 0 -mindepth 0 -type f | grep -qs "${PROJECT}_"*.orig.tar.gz && cp -- "${PROJECT_DIR}/../${PROJECT}_"*.orig.tar.gz .. - GITREV="$(gitrevno)" - - # we always build native packages for our repos - SA_OPTION="" - test -f "debian/source/format" && grep -Eqs '^3.0.*\(quilt\)$' "debian/source/format" && { - git fetch origin upstream:upstream - UPSTREAM_VERSION="$(dpkg-parsechangelog | grep "Version:" | cut -d " " -f2 | sed -e 's/-.*//' -e 's/^.*://')" - REVISION="$(dpkg-parsechangelog | grep "Version:" | cut -d " " -f2 | sed -e 's/.*-//')" - git archive --prefix="${PROJECT}-${UPSTREAM_VERSION}/" -o "../${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" "upstream/${UPSTREAM_VERSION}" && { - SA_OPTION="--debbuildopts=-sa" - } || echo "1.0" > "debian/source/format" - } - - # for Ubuntu version is the codename of the distribution release - if [ -n "${BASH_VERSINFO[0]}" ] && [ "${BASH_VERSINFO[0]}" -gt 3 ]; then - typeset -l codename="${l_CODENAME}" - else - typeset codename="$(tr '[:upper:]' '[:lower:]' <<< "${l_CODENAME}")" - fi - - # translate the version name for Debian releases - [ "x${l_CODENAME}" = "xsid" ] && codename="unstable" - #[ "x$l_CODENAME" = "xjessie" ] && codename=testing - #[ "x$l_CODENAME" = "xwheezy" ] && codename=stable - #[ "x$l_CODENAME" = "xoldstable" ] && codename=oldstable - - typeset numerical_version="" - typeset -i tmp_ret="1" - typeset pretty_dist="" - - if [ -n "${l_DIST}" ] && [ "${l_DIST}" = "debian" ] || [ "${l_DIST}" = "raspbian" ]; then - pretty_dist="Debian" - numerical_version="$("debian-codename-to-version.sh" "${codename}")" - tmp_ret="${?}" - fi - - if [ -n "${l_DIST}" ] && [ "${l_DIST}" = "ubuntu" ]; then - pretty_dist="Ubuntu" - numerical_version="$("ubuntu-codename-to-version.sh" "${codename}")" - tmp_ret="${?}" - fi - - if [ "${tmp_ret}" -ne "0" ] || [ -z "${numerical_version}" ]; then - echo "Error: unable to map code name \"${codename}\" to Debian or Ubuntu numerical versions. Unknown code name or not applicable to distribution \"${pretty_dist}\"? Aborting." >&2 - exit 1 - fi - - # modify the section for non-release package builds - [ "x${COMPONENT}" != "x${COMPONENT_RELEASE}" ] && { - mv -- "debian/control" "debian/control.tmp" - sed "s,Section:[\ ]*\(.*\),Section: ${COMPONENT}/\1,g" debian/control.tmp > debian/control - } - - # modify changelog for this build - if [ "${COMPONENT}" != "${COMPONENT_NIGHTLY}" ]; then - dch --distribution "${codename}" --force-distribution -l "+git${DATE}.${GITREV}+${numerical_version}.${COMPONENT}." "Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." - else - dch --distribution "${codename}" --force-distribution -l "~git${DATE}.${GITREV}+${numerical_version}.${COMPONENT}." "Development-Snapshot!!! Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." - fi - [ "${l_DIST}" = "raspbian" ] && mkdir -p -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/armhf" || mkdir -p -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/"{amd64,i386} - OTHERMIRROR="" - if [ "x${COMPONENT}" = "x${COMPONENT_NIGHTLY}" ]; then - grep -qs "${PROJECT}" <<< "${PACKAGE_WITHOUT_OTHERMIRROR}" || OTHERMIRROR="deb http://${REPOS_SERVER}/${l_DIST} ${l_CODENAME} ${COMPONENT_RELEASE} ${COMPONENT}" - else - grep "${PROJECT}" <<< "${PACKAGE_WITHOUT_OTHERMIRROR}" || OTHERMIRROR="deb http://${REPOS_SERVER}/${l_DIST} ${l_CODENAME} ${COMPONENT}" - fi - if [ "${PROJECT}" = "x2gomatebindings" ] && [ "${codename}" = "wheezy" ]; then - OTHERMIRROR="deb http://httpredir.debian.org/debian ${codename}-backports main" - fi - - # create git changelog immediately prior to building the package - git --no-pager log --since "2 years ago" --format="%ai %aN (%h) %n%n%x09*%w(68,0,10) %s%d%n" > ChangeLog.gitlog - - typeset -a sbuild_options - sbuild_options=("-n" "--jobs=2" "-sA" "--dist=${codename}" "--keyid=${GPG_KEY}" "--build-dep-resolver=aptitude") - - if [ -n "${SA_OPTION}" ]; then - sbuild_options+=("${SA_OPTION}") - fi - - if [ -n "${OTHERMIRROR}" ]; then - sbuild_options+=("--extra-repository=${OTHERMIRROR}") - fi - - typeset -a sbuild_options_64 sbuild_options_32 sbuild_options_armhf - sbuild_options_64=("${sbuild_options[@]}") - sbuild_options_32=("${sbuild_options[@]}" "--arch=i386" "--debbuildopts=-B") - sbuild_options_armhf=("${sbuild_options[@]}" "--arch=armhf" "--chroot=${codename}-armhf-raspbian-sbuild") - - if [ "${l_DIST}" = "raspbian" ]; then - [ "${SKIP_ARCH}" != "armhf" ] && grep -Eqs 'Architecture.*(all|any|armhf)' "${TEMP_DIR}/${PROJECT}/debian/control" && { - cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/armhf" - nice ${SBUILD} "${sbuild_options_armhf[@]}" "${TEMP_DIR}/${PROJECT}" - } - else - [ "x${SKIP_ARCH}" != "xamd64" ] && grep -Eqs 'Architecture.*(all|any|amd64)' "${TEMP_DIR}/${PROJECT}/debian/control" && { - cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/amd64" - nice ${SBUILD} "${sbuild_options_64[@]}" "${TEMP_DIR}/${PROJECT}" - } - [ "x${SKIP_ARCH}" != "xi386" ] && grep -Eqs 'Architecture.*(any|i386)' "${TEMP_DIR}/${PROJECT}/debian/control" && { - cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/i386" - nice ${SBUILD} "${sbuild_options_32[@]}" "${TEMP_DIR}/${PROJECT}" - } - fi - done - } + for line in "${osx_build_for_arr[@]}"; do + l_CODENAMES="${CODENAMES:-$(sed -e 's/,/ /g' <<< "${line}" | tr [:upper:] [:lower:])}" + for l_CODENAME in ${l_CODENAMES}; do + + # in case we build a special CODENAME (squeeze, wheezy, lucid, ...) do skip + # the wrong distribution here... + test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break + + typeset temp_dir="$(mktemp -d "${TEMP_BASE}/tmp.$(repeat_str "X" "24")")" + temp_cleanup+=("${temp_dir}") + mkdir -p -- "${temp_dir}/${PROJECT}" + chmod 2770 -Rf -- "${temp_dir}" + + cd "${PROJECT_DIR}" + git clone --no-hardlinks --no-local "${PROJECT_DIR}" "${temp_dir}/${PROJECT}/" + cd "${temp_dir}/${PROJECT}" + git checkout "${CHECKOUT}" || git checkout master + find "${PROJECT_DIR}/../" -maxdepth 0 -mindepth 0 -type f | grep -qs "${PROJECT}_"*.orig.tar.gz && cp -- "${PROJECT_DIR}/../${PROJECT}_"*.orig.tar.gz .. + typeset gitrev="$(gitrevno)" + + # create git changelog immediately prior to building the package + git --no-pager log --since "2 years ago" --format="%ai %aN (%h) %n%n%x09*%w(68,0,10) %s%d%n" > ChangeLog.gitlog + + upstream_version="$(cat VERSION)" + + typeset is_release="1" + if [ "${COMPONENT}" = "${COMPONENT_NIGHTLY}" ]; then + is_release="0" + fi + + # apply patches from debian/patches/* if necessary + if [ -f "${PROJECT}/debian/patches/series" ]; then + ( cd "${PROJECT}" && QUILT_PATCHES="debian/patches" quilt push -a && rm -Rf -- ".pc/"; ) + fi + + # Make qt4 tools available. + export PATH="${PATH}:/opt/local/libexec/qt4/bin/" + + typeset -a macbuild_env + macbuild_env=("BUNDLE=1" "UNIVERSAL=0") + [ "${is_release}" -eq "0" ] && macbuild_env+=("DEBUG=1") || macbuild_env+=("DEBUG=0") + + "${macbuild_env[@]}" "./macbuild.sh" + + typeset -i os_major="0" + typeset -i os_minor="0" + os_major="$(get_generic_major_version "${l_CODENAME}")" + + if [ "${?}" -ne "0" ]; then + echo "Unable to extract major OS X version." + exit "1" + fi + + os_minor="$(get_generic_minor_version "${l_CODENAME}")" + + if [ "${?}" -ne "0" ] || [ "${os_minor}" -lt "0" ]; then + echo "Unable to extract minor OS X version." + exit "1" + fi + + # FIXME: this is not generic at all. + typeset top_commit_id="$(git rev-parse --no-flags "HEAD^{commit}")" + typeset base_name="${PROJECT}-${UPSTREAM_VERSION}." + if [ "${is_release}" -eq "0" ]; then + base_name="${base_name}git${DATE}.${GITREV}.${COMPONENT}." + else + base_name="${base_name}${DATE}." + fi + base_name="${base_name}OSX_${os_major}_${os_minor}.dmg" + mv "client_build/${PROJECT}.dmg" "${PKGDIST}/${l_CODENAME}/${base_name}" + echo 'https://code.x2go.org/gitweb?p=x2goclient.git;a=commit;h='"${top_commit_id}" > "${PKG_DIST}/${l_CODENAME}/${base_name}.git.txt" + done done return 0 } +# Uploads the built packages. +# Has no parameters. +# Does not "return" any value. upload_packages() { - # dupload the new packages to the reprepro repository - # Do NOT spawn a subshell here. # Allow changing global variables in the main process. - typeset -a deb_build_for_arr + + if [ -z "${upstream_version}" ]; then + echo '${upstream_version} must be set (automatically determined via top-level VERSION file in build phase)' >&2 + exit 1 + fi + + typeset -a osx_build_for_arr typeset OLDIFS="${IFS}" IFS=" " - read -a deb_build_for_arr <<< "${DEB_BUILD_FOR}" + read -a osx_build_for_arr <<< "${OSX_BUILD_FOR}" IFS="${OLDIFS}" typeset line="" - for line in "${deb_build_for_arr[@]}"; do - l_DIST="$(cut -d":" -f1 <<< "${line/: /:}" | tr [:upper:] [:lower:])" - l_CODENAMES="${CODENAMES:-$(cut -d":" -f2- <<< "${line/: /:}" | sed -e 's/,/ /g' | tr [:upper:] [:lower:])}" + for line in "${osx_build_for_arr[@]}"; do + l_CODENAMES="${CODENAMES:-$(sed -e 's/,/ /g' <<< "${line}" | tr [:upper:] [:lower:])}" for l_CODENAME in ${l_CODENAMES}; do # in case we build a special CODENAME (squeeze, wheezy, lucid, ...) do skip # the wrong distribution here... test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break - typeset arch="amd64 i386" + cd "${PKGDIST}/${l_CODENAME}/" + 0</dev/null ssh -- "${REPOS_SERVER}" "mkdir -p '${OSX_REPOS_BASE}/${PROJECT}/${COMPONENT}/${upstream_version}'" + + # Remove packages that are older than 30 days, if building nightlies. + [ "${COMPONENT}" = "${COMPONENT_NIGHTLY}" ] && 0</dev/null ssh -- "${REPOS_SERVER}" "find '${OSX_REPOS_BASE}/${PROJECT}/${COMPONENT}/${upstream_version}/' -mtime +30 -name '*.dmg' -exec rm -f '{}' ';'" || true - [ "${l_DIST}" = "raspbian" ] && arch="armhf" + scp *.dmg "${REPOS_SERVER}:'${OSX_REPOS_BASE}/${PROJECT}/${COMPONENT}/${upstream_version}/'" || true - for l_ARCH in ${arch}; do - [ "x${SKIP_ARCH}" != "x${l_ARCH}" ] && { - cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" - test -f "./dupload.conf" || ln -s -- "${HOME}/.dupload.conf.${PREFIX}" "./dupload.conf" - ls -- "${DEBSRCPKG}_"*.changes >/dev/null 2>&1 && dupload -c --to "${PREFIX}-${l_DIST}-${l_CODENAME}" "${DEBSRCPKG}_"*.changes 0<&- - } - done + # Generate checksums. + 0</dev/null ssh -- "${REPOS_SERVER}" "sudo -u x2go-admin -- x2go-signtarballs '${OSX_REPOS_BASE}/${PROJECT}/${COMPONENT}/${upstream_version}'" done done return 0 @@ -402,7 +319,7 @@ upload_packages() { ### MAIN ### set_vars "${@}" && { - if [ "x$(basename "${0}")" = "x${PREFIX}-sbuild-deb-package" ] || [ "x$(basename "${0}")" = "x${PREFIX}-sbuild+upload-deb-package" ]; then + if [ "x$(basename "${0}")" = "x${PREFIX}-build-osx-package" ] || [ "x$(basename "${0}")" = "x${PREFIX}-build+upload-osx-package" ]; then FORCE_BUILD="$(make_boolean "${FORCE_BUILD}")" NO_DELAY="$(make_boolean "${NO_DELAY}")" @@ -421,7 +338,7 @@ set_vars "${@}" && { unlock_workspace "${LOCK_FILE}" } fi - if [ "x$(basename "${0}")" = "x${PREFIX}-upload-deb-package" ] || [ "x$(basename "${0}")" = "x${PREFIX}-sbuild+upload-deb-package" ]; then + if [ "x$(basename "${0}")" = "x${PREFIX}-upload-osx-package" ] || [ "x$(basename "${0}")" = "x${PREFIX}-build+upload-osx-package" ]; then upload_packages fi } -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit fcadf1529d919f2744790ae519747b567ed86791 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 5 11:02:48 2017 +0200 bin: copy sbuild-deb-package as build-osx-package and create build+upload and upload symlinks. --- bin/build+upload-osx-package | 1 + bin/build-osx-package | 427 +++++++++++++++++++++++++++++++++++++++++++ bin/upload-osx-package | 1 + 3 files changed, 429 insertions(+) diff --git a/bin/build+upload-osx-package b/bin/build+upload-osx-package new file mode 120000 index 0000000..566f5c0 --- /dev/null +++ b/bin/build+upload-osx-package @@ -0,0 +1 @@ +build-osx-package \ No newline at end of file diff --git a/bin/build-osx-package b/bin/build-osx-package new file mode 100755 index 0000000..ccb4b86 --- /dev/null +++ b/bin/build-osx-package @@ -0,0 +1,427 @@ +#!/bin/bash + +# Copyright (C) 2011-2015 by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +# Copyright (C) 2016 by Mihai Moldovan <ionic@ionic.de> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +typeset script_path="$(dirname "$(readlink -e "${BASH_SOURCE}")")" + +. "${script_path}/common.sh" + +GIT_USER="gituser" +GIT_HOSTNAME="git.mydomain.org" + +DEBEMAIL="firstname.lastname@mydomain.org" +DEBFULLNAME="Firstname Lastname" +GPG_KEY="" +DEB_DISTS_SUPPORTED="debian ubuntu raspbian" +DEBIAN_DISTROS="lenny,squeeze,wheezy,jessie,stretch,sid" +RASPBIAN_DISTROS="jessie" +UBUNTU_DISTROS="lucid,precise,trusty,xenial,yakkety" + +COMPONENT_RELEASE="main" +COMPONENT_NIGHTLY="nightly" +COMPONENT_BUNDLES="bundle-release1 bundle-release2" +REPOS_SERVER="packages.mydomain.org" +PACKAGES_WITHOUT_OTHERMIRROR="keyring" +GNUPGHOME="${HOME}/.gnupg" + +test -z "${1}" && { + exec >&2 + echo "usage: $(basename "${0}") [<subpath>/]<git-project> {main,main/<codename>,nightly,nightly/<codename>} [<git-checkout>]" + exit 1 +} + +PREFIX="$(cut -d"-" -f1 <<< "$(basename "${0}")")" +test -f "${HOME}/.buildscripts/${PREFIX}.conf" && . "${HOME}/.buildscripts/${PREFIX}.conf" || { + exec >&2 + echo "${0} has no valid context prefix..." + exit 1; +} + +: ${NO_DELAY:="no"} +: ${FORCE_BUILD:="no"} +: ${DEB_BUILD_FOR:="debian:${DEBIAN_DISTROS} ubuntu:${UBUNTU_DISTROS} raspbian:${RASPBIAN_DISTROS}"} +: ${FLAVOR:="native"} + +# These parts are not user-serviceable. +typeset -ag temp_cleanup="" +# End of non-user-serviceable part. + +set -ex + +# Cleans up temporary directories and files. +# RFC SHOULD be called by trap handlers. +cleanup () { + typeset temp_dir="" + for temp_dir in "${temp_cleanup[@]}"; do + if [ -n "${temp_dir}" ] && [ -d "${temp_dir}" ]; then + rm -Rf -- "${temp_dir}" + fi + done +} + +# Run cleanup() automatically. +trap cleanup ERR EXIT SIGTERM SIGINT SIGHUP SIGPIPE SIGALRM SIGUSR1 SIGUSR2 + +set_vars() { + SBUILD="sbuild" + TEMP_BASE="${HOME}/tmp/" + mkdir -p -- "${TEMP_BASE}" + chmod 2770 -- "${TEMP_BASE}" + + # first argv is the name of the Git project + PROJECT_PATH="${1}" + PROJECT_PATH="${PROJECT_PATH/%.git/}" + PROJECT="$(basename "${PROJECT_PATH}")" + DEBSRCPKG="${PROJECT}" + + # grab repository component area from command line (2nd argv) or guess it + ARGV2_COMPONENT="$(cut -d"/" -f1 <<< "${2}/")" + ARGV2_CODENAME="$(cut -d"/" -f2 <<< "${2}/")" + COMPONENT="${ARGV2_COMPONENT:-${COMPONENT:-$COMPONENT_NIGHTLY}}" + CODENAMES="${ARGV2_CODENAME:-${CODENAMES}}" + [ -n "${ARGV2_CODENAME}" ] && FORCE_BUILD="yes" || true + DATE="${DATE:-$(date +%Y%m%d)}" + if [ "x${COMPONENT}" = "x${COMPONENT_RELEASE}" ] || [ "x${COMPONENT}" = "x${COMPONENT_RELEASE}-test" ] || grep -qs "$COMPONENT" <<< "${COMPONENT_RELEASES}"; then + CHECKOUT="${3:-build-${COMPONENT}}" + elif [ "x${COMPONENT}" = "x${COMPONENT_NIGHTLY}" ]; then + CHECKOUT="${3:-master}" + else + echo "error: no such package component area for this Git project. Aborting..." + exit 1 + fi + # the DATE might be given as ,,today'' from the command line + [ "x${DATE}" = "xtoday" ] && DATE="$(date +%Y%m%d)" + + # setting paths + PROJECT_DIR="${HOME}/build/${COMPONENT}/${PROJECT}" + PKGDIST="${HOME}/pkg-dist/${COMPONENT}/${PROJECT}" + + # lock file + LOCK_FILE="${PROJECT_DIR}/../.${PROJECT}.lock" + + # creating paths + mkdir -p -- "${PROJECT_DIR}" + mkdir -p -- "${PKGDIST}" + + # by default we build for all current debian versions + if [ "x${ARGV2_CODENAME}" != "x" ]; then + if [[ "$FLAVOR" = "raspbian" ]]; then + if grep -qs "${ARGV2_CODENAME}" <<< "${RASPBIAN_DISTROS}"; then + DEB_BUILD_FOR="raspbian:${ARGV2_CODENAME}" + fi + else + if grep -qs "${ARGV2_CODENAME}" <<< "${DEBIAN_DISTROS}"; then + DEB_BUILD_FOR="debian:${ARGV2_CODENAME}" + elif grep -qs "${ARGV2_CODENAME}" <<< "${UBUNTU_DISTROS}"; then + DEB_BUILD_FOR="ubuntu:${ARGV2_CODENAME}" + fi + fi + fi + + return 0 +} + +prepare_workspace() { + # make sure our local working copy is up to date... + if [ -d "${PROJECT_DIR}/.git" ]; then + cd "${PROJECT_DIR}" && { + git reset --hard + git checkout --force "${CHECKOUT}" || git checkout --force -b "${CHECKOUT}" + git pull origin "${CHECKOUT}" + git fetch origin upstream:upstream || true + git fetch origin pristine-tar:pristine-tar || true + # and again, get the ${CHECKOUT} refspec in pure state + git reset --hard + git clean -df + } || { + echo "Unable to switch to project directory \"${PROJECT_DIR}\". Check the permissions." >&2 + exit 1 + } + else + cd "$(dirname "${PROJECT_DIR}")" && { + git clone "git://${GIT_HOSTNAME}/${PROJECT_PATH}.git" + cd "${PROJECT}" + git checkout --force "${CHECKOUT}" || git checkout --force -b "${CHECKOUT}" + git fetch origin upstream:upstream + git fetch origin pristine-tar:pristine-tar || true + git clean -df + } || { + echo "Unable to switch to project directory \"$(dirname "${PROJECT_DIR}")\". Does it exist? Check the permissions." >&2 + exit 1 + } + fi + + GIT_OBJECT_ID="$(git rev-parse --verify HEAD)" + cd "${PROJECT_DIR}" + + # extract Debian source package name from debian/changelog + if [ -e debian/changelog ]; then + DEBSRCPKG="$(dpkg-parsechangelog -S Source)" + fi + + return 0 +} + +clear_pkgdist() { + # pkgdist directory cleanup + + # Do NOT spawn a subshell here. + # Allow changing global variables in the main process. + typeset -a deb_build_for_arr + typeset OLDIFS="${IFS}" + IFS=" " + read -a deb_build_for_arr <<< "${DEB_BUILD_FOR}" + IFS="${OLDIFS}" + + typeset line="" + for line in "${deb_build_for_arr[@]}"; do + l_DIST="$(cut -d":" -f1 <<< "${line/: /:}" | tr [:upper:] [:lower:])" + l_CODENAMES="${CODENAMES:-$(cut -d":" -f2- <<< "${line/: /:}" | sed -e 's/,/ /g' | tr [:upper:] [:lower:])}" + grep -qs "${l_DIST}" <<< "${DEB_DISTS_SUPPORTED}" && { + for l_CODENAME in ${l_CODENAMES}; do + + # in case we build a special CODENAME (squeeze, wheezy, lucid, ...) do skip + # the wrong distribution here... + test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break + + typeset arch="amd64 i386" + + [ "${l_DIST}" = "raspbian" ] && arch="armhf" + + for l_ARCH in ${arch}; do + [ "x${SKIP_ARCH}" != "x${l_ARCH}" ] && { + mkdir -p -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/dupload.conf" + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*_*.changes + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*_*.upload + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*_*.build + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*_*.dsc + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*_*.tar.gz + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*.deb + } + done + done + } + done + return 0 +} + +build_packages() { + # use pbuilder for building all variants of this package + + # Do NOT spawn a subshell here. + # Allow changing global variables in the main process. + typeset -a deb_build_for_arr + typeset OLDIFS="${IFS}" + IFS=" " + read -a deb_build_for_arr <<< "${DEB_BUILD_FOR}" + IFS="${OLDIFS}" + + typeset line="" + for line in "${deb_build_for_arr[@]}"; do + l_DIST="$(cut -d":" -f1 <<< "${line/: /:}" | tr [:upper:] [:lower:])" + l_CODENAMES="${CODENAMES:-$(cut -d":" -f2- <<< "${line/: /:}" | sed -e 's/,/ /g' | tr [:upper:] [:lower:])}" + grep -qs "${l_DIST}" <<< "${DEB_DISTS_SUPPORTED}" && { + for l_CODENAME in ${l_CODENAMES}; do + + # in case we build a special CODENAME (squeeze, wheezy, lucid, ...) do skip + # the wrong distribution here... + test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break + + TEMP_DIR="$(mktemp -d --tmpdir="${TEMP_BASE}" "tmp.$(repeat_str "X" "24")")" + temp_cleanup+=("${TEMP_DIR}") + mkdir -p -- "${TEMP_DIR}/${PROJECT}" + chmod 2770 -Rf -- "${TEMP_DIR}" + + cd "${PROJECT_DIR}" + git clone --no-hardlinks --no-local "${PROJECT_DIR}" "${TEMP_DIR}/${PROJECT}/" + cd "${TEMP_DIR}/${PROJECT}" + git checkout "${CHECKOUT}" || git checkout master + find "${PROJECT_DIR}/../" -maxdepth 0 -mindepth 0 -type f | grep -qs "${PROJECT}_"*.orig.tar.gz && cp -- "${PROJECT_DIR}/../${PROJECT}_"*.orig.tar.gz .. + GITREV="$(gitrevno)" + + # we always build native packages for our repos + SA_OPTION="" + test -f "debian/source/format" && grep -Eqs '^3.0.*\(quilt\)$' "debian/source/format" && { + git fetch origin upstream:upstream + UPSTREAM_VERSION="$(dpkg-parsechangelog | grep "Version:" | cut -d " " -f2 | sed -e 's/-.*//' -e 's/^.*://')" + REVISION="$(dpkg-parsechangelog | grep "Version:" | cut -d " " -f2 | sed -e 's/.*-//')" + git archive --prefix="${PROJECT}-${UPSTREAM_VERSION}/" -o "../${PROJECT}_${UPSTREAM_VERSION}.orig.tar.gz" "upstream/${UPSTREAM_VERSION}" && { + SA_OPTION="--debbuildopts=-sa" + } || echo "1.0" > "debian/source/format" + } + + # for Ubuntu version is the codename of the distribution release + if [ -n "${BASH_VERSINFO[0]}" ] && [ "${BASH_VERSINFO[0]}" -gt 3 ]; then + typeset -l codename="${l_CODENAME}" + else + typeset codename="$(tr '[:upper:]' '[:lower:]' <<< "${l_CODENAME}")" + fi + + # translate the version name for Debian releases + [ "x${l_CODENAME}" = "xsid" ] && codename="unstable" + #[ "x$l_CODENAME" = "xjessie" ] && codename=testing + #[ "x$l_CODENAME" = "xwheezy" ] && codename=stable + #[ "x$l_CODENAME" = "xoldstable" ] && codename=oldstable + + typeset numerical_version="" + typeset -i tmp_ret="1" + typeset pretty_dist="" + + if [ -n "${l_DIST}" ] && [ "${l_DIST}" = "debian" ] || [ "${l_DIST}" = "raspbian" ]; then + pretty_dist="Debian" + numerical_version="$("debian-codename-to-version.sh" "${codename}")" + tmp_ret="${?}" + fi + + if [ -n "${l_DIST}" ] && [ "${l_DIST}" = "ubuntu" ]; then + pretty_dist="Ubuntu" + numerical_version="$("ubuntu-codename-to-version.sh" "${codename}")" + tmp_ret="${?}" + fi + + if [ "${tmp_ret}" -ne "0" ] || [ -z "${numerical_version}" ]; then + echo "Error: unable to map code name \"${codename}\" to Debian or Ubuntu numerical versions. Unknown code name or not applicable to distribution \"${pretty_dist}\"? Aborting." >&2 + exit 1 + fi + + # modify the section for non-release package builds + [ "x${COMPONENT}" != "x${COMPONENT_RELEASE}" ] && { + mv -- "debian/control" "debian/control.tmp" + sed "s,Section:[\ ]*\(.*\),Section: ${COMPONENT}/\1,g" debian/control.tmp > debian/control + } + + # modify changelog for this build + if [ "${COMPONENT}" != "${COMPONENT_NIGHTLY}" ]; then + dch --distribution "${codename}" --force-distribution -l "+git${DATE}.${GITREV}+${numerical_version}.${COMPONENT}." "Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." + else + dch --distribution "${codename}" --force-distribution -l "~git${DATE}.${GITREV}+${numerical_version}.${COMPONENT}." "Development-Snapshot!!! Auto-built ${pretty_dist} ${l_CODENAME} (${numerical_version}) package for ${REPOS_SERVER} repository (Git commit: ${GIT_OBJECT_ID})." + fi + [ "${l_DIST}" = "raspbian" ] && mkdir -p -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/armhf" || mkdir -p -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/"{amd64,i386} + OTHERMIRROR="" + if [ "x${COMPONENT}" = "x${COMPONENT_NIGHTLY}" ]; then + grep -qs "${PROJECT}" <<< "${PACKAGE_WITHOUT_OTHERMIRROR}" || OTHERMIRROR="deb http://${REPOS_SERVER}/${l_DIST} ${l_CODENAME} ${COMPONENT_RELEASE} ${COMPONENT}" + else + grep "${PROJECT}" <<< "${PACKAGE_WITHOUT_OTHERMIRROR}" || OTHERMIRROR="deb http://${REPOS_SERVER}/${l_DIST} ${l_CODENAME} ${COMPONENT}" + fi + if [ "${PROJECT}" = "x2gomatebindings" ] && [ "${codename}" = "wheezy" ]; then + OTHERMIRROR="deb http://httpredir.debian.org/debian ${codename}-backports main" + fi + + # create git changelog immediately prior to building the package + git --no-pager log --since "2 years ago" --format="%ai %aN (%h) %n%n%x09*%w(68,0,10) %s%d%n" > ChangeLog.gitlog + + typeset -a sbuild_options + sbuild_options=("-n" "--jobs=2" "-sA" "--dist=${codename}" "--keyid=${GPG_KEY}" "--build-dep-resolver=aptitude") + + if [ -n "${SA_OPTION}" ]; then + sbuild_options+=("${SA_OPTION}") + fi + + if [ -n "${OTHERMIRROR}" ]; then + sbuild_options+=("--extra-repository=${OTHERMIRROR}") + fi + + typeset -a sbuild_options_64 sbuild_options_32 sbuild_options_armhf + sbuild_options_64=("${sbuild_options[@]}") + sbuild_options_32=("${sbuild_options[@]}" "--arch=i386" "--debbuildopts=-B") + sbuild_options_armhf=("${sbuild_options[@]}" "--arch=armhf" "--chroot=${codename}-armhf-raspbian-sbuild") + + if [ "${l_DIST}" = "raspbian" ]; then + [ "${SKIP_ARCH}" != "armhf" ] && grep -Eqs 'Architecture.*(all|any|armhf)' "${TEMP_DIR}/${PROJECT}/debian/control" && { + cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/armhf" + nice ${SBUILD} "${sbuild_options_armhf[@]}" "${TEMP_DIR}/${PROJECT}" + } + else + [ "x${SKIP_ARCH}" != "xamd64" ] && grep -Eqs 'Architecture.*(all|any|amd64)' "${TEMP_DIR}/${PROJECT}/debian/control" && { + cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/amd64" + nice ${SBUILD} "${sbuild_options_64[@]}" "${TEMP_DIR}/${PROJECT}" + } + [ "x${SKIP_ARCH}" != "xi386" ] && grep -Eqs 'Architecture.*(any|i386)' "${TEMP_DIR}/${PROJECT}/debian/control" && { + cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/i386" + nice ${SBUILD} "${sbuild_options_32[@]}" "${TEMP_DIR}/${PROJECT}" + } + fi + done + } + done + return 0 +} + +upload_packages() { + # dupload the new packages to the reprepro repository + + # Do NOT spawn a subshell here. + # Allow changing global variables in the main process. + typeset -a deb_build_for_arr + typeset OLDIFS="${IFS}" + IFS=" " + read -a deb_build_for_arr <<< "${DEB_BUILD_FOR}" + IFS="${OLDIFS}" + + typeset line="" + for line in "${deb_build_for_arr[@]}"; do + l_DIST="$(cut -d":" -f1 <<< "${line/: /:}" | tr [:upper:] [:lower:])" + l_CODENAMES="${CODENAMES:-$(cut -d":" -f2- <<< "${line/: /:}" | sed -e 's/,/ /g' | tr [:upper:] [:lower:])}" + for l_CODENAME in ${l_CODENAMES}; do + + # in case we build a special CODENAME (squeeze, wheezy, lucid, ...) do skip + # the wrong distribution here... + test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break + + typeset arch="amd64 i386" + + [ "${l_DIST}" = "raspbian" ] && arch="armhf" + + for l_ARCH in ${arch}; do + [ "x${SKIP_ARCH}" != "x${l_ARCH}" ] && { + cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" + test -f "./dupload.conf" || ln -s -- "${HOME}/.dupload.conf.${PREFIX}" "./dupload.conf" + ls -- "${DEBSRCPKG}_"*.changes >/dev/null 2>&1 && dupload -c --to "${PREFIX}-${l_DIST}-${l_CODENAME}" "${DEBSRCPKG}_"*.changes 0<&- + } + done + done + done + return 0 +} + + +### MAIN ### +set_vars "${@}" && { + if [ "x$(basename "${0}")" = "x${PREFIX}-sbuild-deb-package" ] || [ "x$(basename "${0}")" = "x${PREFIX}-sbuild+upload-deb-package" ]; then + FORCE_BUILD="$(make_boolean "${FORCE_BUILD}")" + NO_DELAY="$(make_boolean "${NO_DELAY}")" + + cd "${PROJECT_DIR}" && { + pkgneedsbuild "${CHECKOUT}" || [ "${FORCE_BUILD}" -eq "1" ] + } && { + if [ "${FORCE_BUILD}" -eq "1" ] && [ "${NO_DELAY}" -eq "0" ]; then + delay_build + fi + lock_workspace "${LOCK_FILE}" + prepare_workspace && { + unlock_workspace "${LOCK_FILE}" + clear_pkgdist + build_packages + } + unlock_workspace "${LOCK_FILE}" + } + fi + if [ "x$(basename "${0}")" = "x${PREFIX}-upload-deb-package" ] || [ "x$(basename "${0}")" = "x${PREFIX}-sbuild+upload-deb-package" ]; then + upload_packages + fi +} diff --git a/bin/upload-osx-package b/bin/upload-osx-package new file mode 120000 index 0000000..566f5c0 --- /dev/null +++ b/bin/upload-osx-package @@ -0,0 +1 @@ +build-osx-package \ No newline at end of file -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 67414a20a45485727f0893c2dfe24c3850d76bee Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 6 08:27:52 2017 +0200 bin/build-rpm-package: remove SUSE-specific version fetching functions and use the new generic ones in bin/common.sh --- bin/build-rpm-package | 52 +++++---------------------------------------------- 1 file changed, 5 insertions(+), 47 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index a3dc549..09301de 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -567,48 +567,6 @@ get_extra_repository () { return 0 } -# Fetches major version out of a SUSE version string. -# The format is expected to be "X.Y" with X and Y being positive integers. -# The return code is either 0 or 1, with 0 meaning success and 1 failure. -# The detected major version is written to STDOUT. -get_suse_major_version () { - typeset suse_version="${1}" - typeset -i ret="0" - - if [ -z "${suse_version}" ]; then - ret="1" - else - typeset -i tmp_suse_major_version="0" - tmp_suse_major_version="$(sed -e '/^\([0-9][0-9]*\)\.[0-9][0-9]*$/!d;s//\1/' <<< "${suse_version}")" - - if [ "${tmp_suse_major_version}" -ne "0" ]; then - echo "${tmp_suse_major_version}" - fi - fi - - return "${ret}" -} - -# Fetches minor version out of a SUSE version string. -# The format is expected to be "X.Y" with X and Y being positive integers. -# The return code is either 0 or 1, with 0 meaning success and 1 failure. -# The detected minor version is written to STDOUT. -get_suse_minor_version () { - typeset suse_version="${1}" - typeset -i ret="0" - - if [ -z "${suse_version}" ]; then - ret="1" - else - typeset -i tmp_suse_minor_version="-1" - tmp_suse_minor_version="$(sed -e '/^[0-9][0-9]*\.\([0-9][0-9]*\)$/!d;s//\1/' <<< "${suse_version}")" - - echo "${tmp_suse_minor_version}" - fi - - return "${ret}" -} - prepare_workspace() { # make sure our local working copy is up to date... if [ -d "${PROJECT_DIR}/.git" ]; then @@ -794,7 +752,7 @@ build_packages() { BUILD_RESULT="/home/abuild/rpmbuild/" typeset -i tmp_suse_major_version="0" - tmp_suse_major_version="$(get_suse_major_version "${l_CODENAME}")" + tmp_suse_major_version="$(get_generic_major_version "${l_CODENAME}")" if [ "${?}" -ne "0" ]; then echo "Unable to extract SUSE version." @@ -845,7 +803,7 @@ build_packages() { done typeset -i tmp_suse_major_version="0" - tmp_suse_major_version="$(get_suse_major_version "${l_CODENAME}")" + tmp_suse_major_version="$(get_generic_major_version "${l_CODENAME}")" if [ "${?}" -ne "0" ]; then echo "Unable to extract SUSE version." @@ -932,7 +890,7 @@ build_packages() { done typeset -i tmp_suse_major_version="0" - tmp_suse_major_version="$(get_suse_major_version "${l_CODENAME}")" + tmp_suse_major_version="$(get_generic_major_version "${l_CODENAME}")" if [ "${?}" -ne "0" ]; then echo "Unable to extract SUSE version." @@ -1078,14 +1036,14 @@ upload_packages() { typeset -i tmp_suse_major_version="0" typeset -i tmp_suse_minor_version="0" - tmp_suse_major_version="$(get_suse_major_version "${l_CODENAME}")" + tmp_suse_major_version="$(get_generic_major_version "${l_CODENAME}")" if [ "${?}" -ne "0" ]; then echo "Unable to extract major SUSE version." exit "1" fi - tmp_suse_minor_version="$(get_suse_minor_version "${l_CODENAME}")" + tmp_suse_minor_version="$(get_generic_minor_version "${l_CODENAME}")" if [ "${?}" -ne "0" ]; then echo "Unable to extract minor SUSE version." -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit c548b92dbfcacc70c95ad7f6f0ed6a2c23b601ff Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 6 08:28:32 2017 +0200 bin/signtarballs: let script take a parameter which is the dir containing tarballs/binaries. --- bin/signtarballs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/signtarballs b/bin/signtarballs index e7f50ce..5c305bc 100755 --- a/bin/signtarballs +++ b/bin/signtarballs @@ -1,6 +1,16 @@ #!/bin/bash -test -d _releases_ && cd _releases_ || test -d ../_releases_ && cd ../_releases_ || exit 1 +typeset to_dir="${1}" + +if [ -z "${to_dir}" ] && [ -d "${to_dir}" ]; then + cd "${to_dir}" +elif [ -d "_releases_" ]; then + cd "_releases" +elif [ -d "../_releases_" ]; then + cd "../_releases" +else + exit 1 +fi find * -type f | egrep ".*(\.zip|\.tar\.gz|\.exe|\.dmg)$" | while read tarball; do test -f "${tarball}.md5" || { printf "md5: "; md5sum "${tarball}" | tee "${tarball}.md5"; } -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 9028f70e204f5c80709173be074e71c6fa6241f4 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 6 08:31:42 2017 +0200 bin/sbuild-deb-package: backport comment changes. --- bin/sbuild-deb-package | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/sbuild-deb-package b/bin/sbuild-deb-package index 9f6f1a8..1ce5ef5 100755 --- a/bin/sbuild-deb-package +++ b/bin/sbuild-deb-package @@ -176,6 +176,9 @@ prepare_workspace() { return 0 } +# Cleans up the pkgdist directory used for building packages. +# Does not take parameters. +# Does not "return" anything. clear_pkgdist() { # pkgdist directory cleanup @@ -221,8 +224,6 @@ clear_pkgdist() { } build_packages() { - # use pbuilder for building all variants of this package - # Do NOT spawn a subshell here. # Allow changing global variables in the main process. typeset -a deb_build_for_arr @@ -362,9 +363,10 @@ build_packages() { return 0 } +# (d)uploads the built packages to the reprepro repository. +# Has no parameters. +# Does not "return" any value. upload_packages() { - # dupload the new packages to the reprepro repository - # Do NOT spawn a subshell here. # Allow changing global variables in the main process. typeset -a deb_build_for_arr -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit b523803e53401bcb88bce320e18b758a0aa3298a Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 6 08:31:18 2017 +0200 bin/sbuild-deb-package: backport arch variable rename. --- bin/sbuild-deb-package | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/sbuild-deb-package b/bin/sbuild-deb-package index ccb4b86..9f6f1a8 100755 --- a/bin/sbuild-deb-package +++ b/bin/sbuild-deb-package @@ -198,11 +198,11 @@ clear_pkgdist() { # the wrong distribution here... test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break - typeset arch="amd64 i386" + typeset arches="amd64 i386" - [ "${l_DIST}" = "raspbian" ] && arch="armhf" + [ "${l_DIST}" = "raspbian" ] && arches="armhf" - for l_ARCH in ${arch}; do + for l_ARCH in ${arches}; do [ "x${SKIP_ARCH}" != "x${l_ARCH}" ] && { mkdir -p -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/dupload.conf" @@ -383,11 +383,11 @@ upload_packages() { # the wrong distribution here... test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break - typeset arch="amd64 i386" + typeset arches="amd64 i386" - [ "${l_DIST}" = "raspbian" ] && arch="armhf" + [ "${l_DIST}" = "raspbian" ] && arches="armhf" - for l_ARCH in ${arch}; do + for l_ARCH in ${arches}; do [ "x${SKIP_ARCH}" != "x${l_ARCH}" ] && { cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" test -f "./dupload.conf" || ln -s -- "${HOME}/.dupload.conf.${PREFIX}" "./dupload.conf" -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 78ee006425a7fbed0a61a3cf26cf3dc0a9de4c1c Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 6 08:25:13 2017 +0200 home/.buildscripts/x2go.conf: add OS X-specific variables. --- home/.buildscripts/x2go.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/home/.buildscripts/x2go.conf b/home/.buildscripts/x2go.conf index 5a3dcf1..6fd2abb 100644 --- a/home/.buildscripts/x2go.conf +++ b/home/.buildscripts/x2go.conf @@ -22,6 +22,9 @@ RPM_WANT_EXTRA_REPOS="1" RPM_MOCK_CONFIG_DIR="/etc/mock/" RPM_EXTRA_REPO_MOCK_CONFIG_BASE="x2go" +OSX_DISTROS="10.10 10.12" +OSX_REPOS_BASE="/srv/sites/x2go.org/code/releases/binary-macosx/" + COMPONENT_MAIN="main" COMPONENT_NIGHTLY="heuler" COMPONENT_RELEASES="testmain baikal" -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 992236e7f5646f102ae86bb7e6a4b1e80c3a462c Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 6 08:26:05 2017 +0200 bin/common.sh: add formerly SUSE-specific version fetching functions. --- bin/common.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/bin/common.sh b/bin/common.sh index 4ea5345..7308857 100644 --- a/bin/common.sh +++ b/bin/common.sh @@ -100,3 +100,45 @@ unlock_workspace () { delay_build () { sleep "$(((${RANDOM} % 100) + 1))s" } + +# Fetches major version out of a generic version string. +# The format is expected to be "X.Y" with X and Y being positive integers. +# The return code is either 0 or 1, with 0 meaning success and 1 failure. +# The detected major version is written to STDOUT. +get_generic_major_version () { + typeset version="${1}" + typeset -i ret="0" + + if [ -z "${version}" ]; then + ret="1" + else + typeset -i tmp_major_version="0" + tmp_major_version="$(sed -e '/^\([0-9][0-9]*\)\.[0-9][0-9]*$/!d;s//\1/' <<< "${version}")" + + if [ "${tmp_major_version}" -ne "0" ]; then + echo "${tmp_major_version}" + fi + fi + + return "${ret}" +} + +# Fetches minor version out of a generic version string. +# The format is expected to be "X.Y" with X and Y being positive integers. +# The return code is either 0 or 1, with 0 meaning success and 1 failure. +# The detected minor version is written to STDOUT. +get_generic_minor_version () { + typeset version="${1}" + typeset -i ret="0" + + if [ -z "${version}" ]; then + ret="1" + else + typeset -i tmp_minor_version="-1" + tmp_minor_version="$(sed -e '/^[0-9][0-9]*\.\([0-9][0-9]*\)$/!d;s//\1/' <<< "${version}")" + + echo "${tmp_minor_version}" + fi + + return "${ret}" +} -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 15df6c1e677b8b7b2122a74c66971f99bbf344c4 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 6 08:33:39 2017 +0200 bin/build-rpm-package: sanitize SSH calls. --- bin/build-rpm-package | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index db584a8..a2a1328 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -991,10 +991,10 @@ upload_packages() { fi # create remote directories in archive - 0</dev/null ssh "${REPOS_SERVER}" "mkdir -p -- '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/${PROJECT}'" + 0</dev/null ssh -- "${REPOS_SERVER}" "mkdir -p -- '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/${PROJECT}'" # remove rpm packages of the same name (pattern) - 0</dev/null ssh "${REPOS_SERVER}" "rm -f -- '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/${PROJECT}/'*.rpm" + 0</dev/null ssh -- "${REPOS_SERVER}" "rm -f -- '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/${PROJECT}/'*.rpm" # copy (s)rpms into repo cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" @@ -1002,11 +1002,11 @@ upload_packages() { else # create remote directories in archive - 0</dev/null ssh "${REPOS_SERVER}" "mkdir -p -- '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/rpms/${PROJECT}'" - 0</dev/null ssh "${REPOS_SERVER}" "mkdir -p -- '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/repodata'" + 0</dev/null ssh -- "${REPOS_SERVER}" "mkdir -p -- '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/rpms/${PROJECT}'" + 0</dev/null ssh -- "${REPOS_SERVER}" "mkdir -p -- '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/repodata'" # remove rpm packages of the same name (pattern) - 0</dev/null ssh "${REPOS_SERVER}" "rm -f -- '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/rpms/${PROJECT}/'*.rpm" + 0</dev/null ssh -- "${REPOS_SERVER}" "rm -f -- '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/rpms/${PROJECT}/'*.rpm" # copy (s)rpms into repo cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" @@ -1018,10 +1018,10 @@ upload_packages() { createrepo_opts="-s sha" gpg_sign_with="${GPG_KEY_EPEL5}" fi - 0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/' && createrepo ${createrepo_opts} '.'" + 0</dev/null ssh -- "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/' && createrepo ${createrepo_opts} '.'" - 0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/repodata' && rm -f -- 'repomd.xml.asc' && gpg -a -u '${gpg_sign_with}' --detach-sign 'repomd.xml'" 1>/dev/null 2>/dev/null - 0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/repodata' && test -e 'repomd.xml.key' || gpg -a --output 'repomd.xml.key' --export '${gpg_sign_with}'" + 0</dev/null ssh -- "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/repodata' && rm -f -- 'repomd.xml.asc' && gpg -a -u '${gpg_sign_with}' --detach-sign 'repomd.xml'" 1>/dev/null 2>/dev/null + 0</dev/null ssh -- "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/repodata' && test -e 'repomd.xml.key' || gpg -a --output 'repomd.xml.key' --export '${gpg_sign_with}'" fi fi done @@ -1097,7 +1097,7 @@ upload_packages() { [ "${major}" -lt 12 ] && gpg_sign_with="${GPG_KEY_EPEL5}" fi - 0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/' && ~/bin/createsusetagsrepo '.' '${distro_string}' '${COMPONENT}' '${gpg_sign_with}' '${use_sha256}'" + 0</dev/null ssh -- "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/' && ~/bin/createsusetagsrepo '.' '${distro_string}' '${COMPONENT}' '${gpg_sign_with}' '${use_sha256}'" fi done done -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit ebd334e14d6828742736031703bd8572c2a2a8e7 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 6 08:33:13 2017 +0200 bin/build-nsis-package.sh: sanitize some ssh calls. --- bin/build-nsis-package.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/build-nsis-package.sh b/bin/build-nsis-package.sh index a386fe3..2b5935d 100755 --- a/bin/build-nsis-package.sh +++ b/bin/build-nsis-package.sh @@ -249,10 +249,10 @@ upload_packages() { MINGW_REPOS_BASE="/srv/sites/x2go.org/code/releases/binary-win32/x2goclient/heuler/" # create remote directories in archive - 0</dev/null ssh "${REPOS_SERVER}" mkdir -p "${MINGW_REPOS_BASE}/${l_DIST}/${l_CODENAME}/" + 0</dev/null ssh -- "${REPOS_SERVER}" "mkdir -p -- '${MINGW_REPOS_BASE}/${l_DIST}/${l_CODENAME}/'" # remove installer packages that are older than 30 days - 0</dev/null ssh "${REPOS_SERVER}" "find \"${MINGW_REPOS_BASE}/${l_DIST}/${l_CODENAME}/\" -mtime +30 -name \"x2goclient-*-setup.exe\" -exec rm -f \"{}\" \";\"" + 0</dev/null ssh -- "${REPOS_SERVER}" "find '${MINGW_REPOS_BASE}/${l_DIST}/${l_CODENAME}/' -mtime +30 -name 'x2goclient-*-setup.exe' -exec rm -f '{}' ';'" || true # Ensure that the package is world-readable before being uploaded to an HTTP/HTTPS server. # Otherwise, sometimes cygwin sftp/scp uploads files with 000 permissions. -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 02e8f45ce05f40264882ccd3c8b121b8cde65257 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 6 08:33:54 2017 +0200 bin/build-rpm-package: use more quoting when applying quilt patches. --- bin/build-rpm-package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index a2a1328..3d5a48c 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -705,7 +705,7 @@ build_packages() { # apply patches from debian/patches/* so that they end up in the tarball # ... esp. relevant for NX (redistributed) if [ -f "${PROJECT}/debian/patches/series" ]; then - ( cd "${PROJECT}" && QUILT_PATCHES=debian/patches quilt push -a && rm -Rf -- .pc/; ) + ( cd "${PROJECT}" && QUILT_PATCHES="debian/patches" quilt push -a && rm -Rf -- ".pc/"; ) fi grep -E "^Source[1-9]+:.*" "${PROJECT}.spec" | sed "s/%{name}/${PROJECT}/" | awk '{ print $2 }' | while read source_file; do -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 23e9b89bb6e3514b3238dae8ae8ed1b83e737098 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 6 08:32:04 2017 +0200 bin/build-rpm-package: backport comment changes. --- bin/build-rpm-package | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 09301de..db584a8 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -961,7 +961,7 @@ build_packages() { return 0 } -# Uploads the build packages. +# Uploads the built packages. # Has no parameters. # Does not "return" any value. upload_packages() { -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git