diff options
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | .travis.yml | 15 | ||||
-rw-r--r-- | Makefile.am | 1 | ||||
-rwxr-xr-x | build-aux/build-windows.sh | 48 | ||||
-rwxr-xr-x | build-aux/travis-build.sh (renamed from build-aux/build-travis.sh) | 8 | ||||
-rwxr-xr-x | build-aux/travis-deploy.sh | 59 |
6 files changed, 82 insertions, 55 deletions
@@ -32,9 +32,9 @@ Makefile.in /stamp-h1 .dirstamp /build-aux/* -!/build-aux/build-travis.sh -!/build-aux/build-windows.sh !/build-aux/git-version-gen +!/build-aux/travis-build.sh +!/build-aux/travis-deploy.sh # installed .m4 files /m4/*.m4 @@ -67,3 +67,5 @@ blogc-*.rpm # git-version-gen /.version + +/build/ diff --git a/.travis.yml b/.travis.yml index a32e4e1..9645b60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,11 @@ env: - TARGET=w32 - TARGET=w64 +global: + - secure: JCF5qRCiY+z7jwfCamG3v5xgQZ82MVvQPee6E3zhxMa6psp1wtPRJNx9MvXQxtjAvnOdHav5Ivo29JYFtxVdrzEM/J/R3FKRmgZ71nCw9Mf/iVjIrRHwW3ofQJ9sCwbWZi1tha7yD12qGlxDKA0cAwVuRpHy/MQDiBAmZxN7XCw= + - secure: YBCsXkVyv43DadU2xiplVPFZBRb4HXpb815he6672ESuoh5VAtIrRH7UlI5z/7BLtSv0Isb2X5rBlTWAzNM8y/Ec0cYlBlmMIBWdl2CvQQSZ8x+kIK0hkADzQboU0E7ZUw13xca1R3C88UpSKH69M8AUJpj+VPgEOT1NE+M9pfw= + - secure: Ct5BdBhRsa3cjJnPUQ48NdJR6Ih2GIJiUdJFhLxxRX4nEudVDfqFB1OOwTtbPO3/RBtPDEL8BzdnZzs7BDOOJKTpoljY4GyC7LsknNVAztWrIV9vh3K6c3UijPzIcoOxGFIPPvzAm37zyS4kzMP2+7r2mZjvr1TvmXlSL59Rruw= + matrix: exclude: - compiler: clang @@ -35,4 +40,12 @@ install: gem install ronn before_script: ./autogen.sh -script: ./build-aux/build-travis.sh +script: ./build-aux/travis-build.sh + +deploy: + provider: script + script: ./build-aux/travis-deploy.sh + skip_cleanup: true + on: + repo: blogc/blogc + branch: master diff --git a/Makefile.am b/Makefile.am index 1c5388d..9554599 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,6 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \ ## File listings EXTRA_DIST = \ - build-aux/build-windows.sh \ build-aux/git-version-gen \ $(top_srcdir)/.version \ autogen.sh \ diff --git a/build-aux/build-windows.sh b/build-aux/build-windows.sh deleted file mode 100755 index bdecc8b..0000000 --- a/build-aux/build-windows.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# This script builds windows binaries, given a source tarball. -# It was designed to work on Fedora, and requires the following packages: -# -# mingw32-gcc mingw64-gcc zip -# -# This script must be called with the xz source tarball and the target version -# as arguments. - - -set -ex - -[[ $# -eq 2 ]] - - -build() { - local version=${2} - local arch=${3} - local build_dir="/tmp/blogc_build_${version}_${arch}" - local dest_dir="/tmp/blogc-${version}-w${arch}" - - rm -rf "${build_dir}" - mkdir -p "${build_dir}" - tar -xvf "${1}" -C "${build_dir}" - - pushd "${build_dir}/blogc-${version}" &> /dev/null - "mingw${arch}-configure" - make - popd &> /dev/null - - rm -rf "${dest_dir}" - mkdir -p "${dest_dir}" - cp "${build_dir}/blogc-${version}/.libs/blogc.exe" "${dest_dir}/" - cp "${build_dir}/blogc-${version}/LICENSE" "${dest_dir}/" - cp "${build_dir}/blogc-${version}/README.md" "${dest_dir}/" - - pushd "$(dirname ${dest_dir})" &> /dev/null - zip "$(basename ${dest_dir}).zip" "$(basename ${dest_dir})"/* - popd &> /dev/null - - mv "${dest_dir}.zip" . -} - - -for arch in 32 64; do - build "$1" "$2" "${arch}" -done diff --git a/build-aux/build-travis.sh b/build-aux/travis-build.sh index d400494..d03cafd 100755 --- a/build-aux/build-travis.sh +++ b/build-aux/travis-build.sh @@ -11,7 +11,7 @@ if [[ "x${TARGET}" = xw* ]]; then unset CC export CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4" export CHOST="x86_64-w64-mingw32" - test "x${TARGET}" = "xw32" && export CHOST="i686-w64-mingw32" + [[ "x${TARGET}" = "xw32" ]] && export CHOST="i686-w64-mingw32" MAKE_TARGET="all" else export CFLAGS="-Wall -g" @@ -23,6 +23,7 @@ pushd build > /dev/null ../configure \ ${CHOST:+--host=${CHOST} --target=${CHOST}} \ --enable-ronn \ + --with-squareball=internal \ --disable-silent-rules \ ${CONFIGURE_ARGS} @@ -31,8 +32,9 @@ popd > /dev/null make -C build "${MAKE_TARGET}" if [[ "x${TARGET}" = xw* ]]; then + TARNAME="$(grep PACKAGE_TARNAME build/config.h | cut -d\" -f2)" VERSION="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)" - DEST_DIR="blogc-${VERSION}-${TARGET}" + DEST_DIR="${TARNAME}-${VERSION}-${TARGET}" rm -rf "${DEST_DIR}" mkdir -p "${DEST_DIR}" @@ -41,5 +43,5 @@ if [[ "x${TARGET}" = xw* ]]; then cp LICENSE "${DEST_DIR}/" cp README.md "${DEST_DIR}/" - zip "${DEST_DIR}.zip" "${DEST_DIR}"/* + zip "build/${DEST_DIR}.zip" "${DEST_DIR}"/* fi diff --git a/build-aux/travis-deploy.sh b/build-aux/travis-deploy.sh new file mode 100755 index 0000000..267c8d5 --- /dev/null +++ b/build-aux/travis-deploy.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +set -e + +if [[ "x${TARGET}" != xw* ]] && [[ "x${TARGET}" != xdist* ]]; then + echo "Nothing to deploy." + exit 0 +fi + +if [[ ! -d build ]]; then + echo "Build directory not found." + exit 1 +fi + +if [[ "x${TARGET}" = xw* ]]; then + FILES=( build/*.zip ) +elif [[ "x${TARGET}" = "xdist-srpm" ]]; then + FILES=( build/*.src.rpm ) +else + FILES=( build/*.{*.tar.{gz,bz2,xz},zip} ) +fi + +TARNAME="$(grep PACKAGE_TARNAME build/config.h | cut -d\" -f2)" +VERSION="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)" + +do_curl() { + curl \ + --silent \ + --ftp-create-dirs \ + --upload-file "${1}" \ + --user "${FTP_USER}:${FTP_PASSWORD}" \ + "ftp://${FTP_HOST}/public_html/${TARNAME}/${TARNAME}-${VERSION}/$(basename ${1})" +} + +echo " * Found files:" +for f in "${FILES[@]}"; do + echo " $(basename ${f})" +done +echo + +for f in "${FILES[@]}"; do + echo " * Processing file: $(basename ${f}):" + + echo -n " Generating SHA512 checksum ... " + pushd build > /dev/null + sha512sum "$(basename ${f})" > "$(basename ${f}).sha512" + popd > /dev/null + echo "done" + + echo -n " Uploading file ... " + do_curl "${f}" + echo "done" + + echo -n " Uploading SHA512 checksum ... " + do_curl "${f}.sha512" + echo "done" + + echo +done |