From b320fb602717513f28fcd7f52281f41f8f0220fa Mon Sep 17 00:00:00 2001 From: John Date: Tue, 26 Dec 2023 12:00:57 +0100 Subject: [PATCH] fix helper script, add helper scripts for checking the build --- contrib/alpine/APKBUILD.git | 39 ++++++++++++++++++++++++++++++++++ contrib/alpine/build-git.sh | 3 +++ contrib/alpine/build.sh | 4 ++-- contrib/archlinux/build-git.sh | 3 +++ contrib/archlinux/build.sh | 3 +++ 5 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 contrib/alpine/APKBUILD.git create mode 100644 contrib/alpine/build-git.sh create mode 100644 contrib/archlinux/build-git.sh create mode 100644 contrib/archlinux/build.sh diff --git a/contrib/alpine/APKBUILD.git b/contrib/alpine/APKBUILD.git new file mode 100644 index 00000000..49b42a9f --- /dev/null +++ b/contrib/alpine/APKBUILD.git @@ -0,0 +1,39 @@ +# Maintainer: John +pkgname=ebusd-git +_gitname=ebusd +pkgver=23.2 +pkgrel=0 +pkgdesc="Daemon for communication with eBUS heating systems" +url="https://github.com/john30/ebusd" +# Upstream only supports these archs. +arch="x86 x86_64 aarch64 armhf armv7" +license="GPL-3.0-only" +makedepends="cmake mosquitto-dev openssl-dev" +source="$pkgname-$pkgver.tar.gz::https://codeload.github.com/john30/${_gitname}/legacy.tar.gz/refs/heads/master" + +unpack() { + mkdir -p "$srcdir" + msg "Unpacking $s..." + tar -C "$srcdir" -zxf "$SRCDEST/$(filename_from_uri $source)" --strip-components=1 || return 1 +} + +build() { + cmake -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DBUILD_TESTING=ON \ + "$srcdir" + cmake --build build +} + +check() { + ctest --output-on-failure --test-dir build +} + +package() { + DESTDIR="$pkgdir" cmake --install build +} + +sha512sums=" +REPLACED ${pkgname}-${pkgver}.tar.gz +" \ No newline at end of file diff --git a/contrib/alpine/build-git.sh b/contrib/alpine/build-git.sh new file mode 100644 index 00000000..bb09aaf7 --- /dev/null +++ b/contrib/alpine/build-git.sh @@ -0,0 +1,3 @@ +#!/bin/bash +# helper script to check the build from git master is fine +docker run -it --rm -v $PWD:/build -w /build/contrib/alpine alpine sh -c 'apk add --upgrade abuild && adduser -D test && addgroup test abuild && su test -c "abuild-keygen -a && mkdir git && cd git && cp ../APKBUILD.git APKBUILD && abuild -r checksum && abuild -r"' \ No newline at end of file diff --git a/contrib/alpine/build.sh b/contrib/alpine/build.sh index 9ddf0e31..068b92e5 100644 --- a/contrib/alpine/build.sh +++ b/contrib/alpine/build.sh @@ -1,3 +1,3 @@ #!/bin/bash -# helper script to check the build is fine -docker run -it --rm -v $PWD:/build -w /build/contrib/alpine alpine sh -c 'apk add --upgrade abuild && adduser -D test && addgroup test abuild && su test -c "abuild-keygen && abuild -r"' \ No newline at end of file +# helper script to check the release build is fine +docker run -it --rm -v $PWD:/build -w /build/contrib/alpine alpine sh -c 'apk add --upgrade abuild && adduser -D test && addgroup test abuild && su test -c "abuild-keygen -a && abuild -r"' \ No newline at end of file diff --git a/contrib/archlinux/build-git.sh b/contrib/archlinux/build-git.sh new file mode 100644 index 00000000..7c9aac70 --- /dev/null +++ b/contrib/archlinux/build-git.sh @@ -0,0 +1,3 @@ +#!/bin/bash +# helper script to check the build from git master is fine +docker run -it --rm -v $PWD:/build -w /build/contrib/archlinux archlinux sh -c 'pacman -Sy && pacman -Sq fakeroot binutils mosquitto autoconf automake make gcc git && useradd test && su test -c "makepkg -p PKGBUILD.git"' \ No newline at end of file diff --git a/contrib/archlinux/build.sh b/contrib/archlinux/build.sh new file mode 100644 index 00000000..50bf85e3 --- /dev/null +++ b/contrib/archlinux/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash +# helper script to check the release build is fine +docker run -it --rm -v $PWD:/build -w /build/contrib/archlinux archlinux sh -c 'pacman -Sy && pacman -Sq fakeroot binutils mosquitto autoconf automake make gcc && useradd test && su test -c "makepkg"' \ No newline at end of file