# Maintainer: xengineering pkgname=ceres pkgver=0.5.0 pkgrel=1 pkgdesc="Recipe server for your favorite dishes" arch=('x86_64' 'aarch64') url='https://xengineering.eu/git/ceres' license=('AGPL') makedepends=('coreutils' 'git' 'go') backup=('etc/ceres/config.json') source=("git+https://cgit.xengineering.eu/ceres#tag=v${pkgver}?signed" 'ceres.service' 'sysuser.conf' 'ceres.tmpfile.d' '0001-Disable-logging-time-stamps.patch' '0002-Select-default-storage.patch') sha256sums=('SKIP' '7b9284940f307a63547d2346e53431842d8bb3e37eb87a422948fdddd8e09a12' 'a8c7c3d6af65bd7255b0f693430c6ba53d646123feebec9a1e37f8723c21942b' '5a953a802b1478dd7f7e32dbd8ac8d97946bbef0579e3cce4b87e32151855e51' 'ee87321e1be9aa8c6fbc1f8dc0d704d6ad7de72d28d8de35d360165d9cbcd62f' 'b58224a1fa194320e7da97a8d04f14eac2d67e48314f8ccc9ddff250aa2f40c5') validpgpkeys=( 'A13B258878787F943F6C68F00FD1F84233FA8900' # xengineering ) prepare() { patch "${srcdir}/${pkgname}/main.go" 0001-Disable-logging-time-stamps.patch patch "${srcdir}/${pkgname}/default_config.json" 0002-Select-default-storage.patch cd "${srcdir}/${pkgname}" git submodule init git submodule update } build() { cd "${srcdir}/${pkgname}" export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_LDFLAGS="${LDFLAGS}" export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" go build -o "build/${pkgname}" xengineering.eu/ceres } check() { cd "${srcdir}/${pkgname}" go test ./... } package() { cd "${srcdir}/${pkgname}" install -D -m 755 "${srcdir}/${pkgname}/build/ceres" "${pkgdir}/usr/bin/ceres" install -D -m 644 "${srcdir}/${pkgname}/default_config.json" "${pkgdir}/etc/ceres/config.json" install -D -m 644 "${srcdir}/ceres.service" "${pkgdir}/usr/lib/systemd/system/ceres.service" install -D -m 644 "${srcdir}/sysuser.conf" "${pkgdir}/usr/lib/sysusers.d/ceres.conf" install -D -m 644 "${srcdir}/ceres.tmpfile.d" "${pkgdir}/usr/lib/tmpfiles.d/ceres.conf" }