aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/build-windows.sh48
-rwxr-xr-xbuild-aux/travis-build.sh21
-rwxr-xr-xbuild-aux/travis-deploy.sh67
3 files changed, 88 insertions, 48 deletions
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/travis-build.sh b/build-aux/travis-build.sh
new file mode 100755
index 0000000..53cf589
--- /dev/null
+++ b/build-aux/travis-build.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -ex
+
+rm -rf build
+mkdir -p build
+
+pushd build > /dev/null
+
+../configure \
+ CFLAGS="-Wall -g" \
+ --enable-ronn \
+ --disable-silent-rules \
+ --enable-tests \
+ --enable-valgrind \
+ --enable-git-receiver \
+ --enable-runserver
+
+popd > /dev/null
+
+make -C build "${TARGET}"
diff --git a/build-aux/travis-deploy.sh b/build-aux/travis-deploy.sh
new file mode 100755
index 0000000..51aac3e
--- /dev/null
+++ b/build-aux/travis-deploy.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+set -e
+
+if [[ "x${TRAVIS_PULL_REQUEST}" != "xfalse" ]]; then
+ echo "This is a pull request. skipping deploy ..."
+ exit 0
+fi
+
+if [[ "x${TRAVIS_BRANCH}" != "xmaster" ]] && [[ "x${TRAVIS_TAG}" != xv* ]]; then
+ echo "This isn't master branch nor a valid tag. skipping deploy ..."
+ exit 0
+fi
+
+if [[ "x${CC}" != "xgcc" ]] || [[ "x${TARGET}" = "xvalgrind" ]]; then
+ echo "Invalid target for deploy. skipping ..."
+ exit 0
+fi
+
+if [[ ! -d build ]]; then
+ echo "Build directory not found."
+ exit 1
+fi
+
+if [[ "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