From 9543748bda8bfcad015243a9d312cf203431b29f Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Mon, 7 May 2018 00:13:44 +0200 Subject: build: use yatr --- build-aux/build-static.sh | 22 ++++++++++++++++++++++ build-aux/build-windows.sh | 18 ++++++++++++++++++ build-aux/check-make-embedded.sh | 5 +++++ build-aux/clang-analyzer.sh | 30 ++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+) create mode 100755 build-aux/build-static.sh create mode 100755 build-aux/build-windows.sh create mode 100755 build-aux/check-make-embedded.sh create mode 100755 build-aux/clang-analyzer.sh (limited to 'build-aux') diff --git a/build-aux/build-static.sh b/build-aux/build-static.sh new file mode 100755 index 0000000..39d6444 --- /dev/null +++ b/build-aux/build-static.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -ex + +PV="$(grep PACKAGE_VERSION config.h | cut -d\" -f2)" + +${MAKE_CMD:-make} LDFLAGS="-all-static" blogc + +rm -rf root +mkdir -p root + +install -m 755 blogc root/blogc +install -m 644 src/blogc-github-lambda/lambda_function.py root/lambda_function.py +install -m 644 ../LICENSE root/LICENSE +strip root/blogc + +pushd root > /dev/null +zip "../blogc-github-lambda-${PV}.zip" * +popd > /dev/null + +install -m 755 root/blogc "blogc-static-amd64-${PV}" +xz -z "blogc-static-amd64-${PV}" diff --git a/build-aux/build-windows.sh b/build-aux/build-windows.sh new file mode 100755 index 0000000..3ed6b59 --- /dev/null +++ b/build-aux/build-windows.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -ex + +PN="$(grep PACKAGE_TARNAME config.h | cut -d\" -f2)" +PV="$(grep PACKAGE_VERSION config.h | cut -d\" -f2)" +DEST_DIR="${PN}-${TARGET}-${PV}" + +${MAKE_CMD:-make} blogc.exe + +rm -rf "${DEST_DIR}" +mkdir -p "${DEST_DIR}" + +cp .libs/blogc.exe "${DEST_DIR}/" +cp ../LICENSE "${DEST_DIR}/" +cp ../README.md "${DEST_DIR}/" + +zip "${DEST_DIR}.zip" "${DEST_DIR}"/* diff --git a/build-aux/check-make-embedded.sh b/build-aux/check-make-embedded.sh new file mode 100755 index 0000000..d2e5fe4 --- /dev/null +++ b/build-aux/check-make-embedded.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -ex + +${MAKE_CMD:-make} check diff --git a/build-aux/clang-analyzer.sh b/build-aux/clang-analyzer.sh new file mode 100755 index 0000000..1582b10 --- /dev/null +++ b/build-aux/clang-analyzer.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -ex + +PN="$(grep PACKAGE_TARNAME config.h | cut -d\" -f2)" +PV="$(grep PACKAGE_VERSION config.h | cut -d\" -f2)" +P="${PN}-clang-analyzer-${PV}" + +set +e +scan-build \ + --use-cc="${CC:-clang}" \ + -o reports \ + ${MAKE_CMD:-make} +RV=$? +set -e + +NUM_REPORTS=$(ls -1 reports | wc -l) +[[ ${NUM_REPORTS} -eq 0 ]] && exit ${RV} +[[ ${NUM_REPORTS} -eq 1 ]] + +REPORTS="reports/$(ls -1 reports)" +if [[ -d "${REPORTS}" ]]; then + mv "${REPORTS}" clang-analyzer + tar \ + -cvJf "${P}.tar.xz" \ + clang-analyzer + RV=1 +fi + +exit ${RV} -- cgit v1.2.3-18-g5258