- PKGBUILD: builds converge package, uses pre-built binary from build/converge when available (from scripts/build), falls back to stack build from source. Installs binary, systemd user service, example config, and README. - scripts/build: added final step to run makepkg -f on the host (conditional, skipped if makepkg not found). Produces .pkg.tar.zst alongside the binary. - scripts/makepkg: convenience wrapper for standalone makepkg runs.
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
# Maintainer: James Brechtel <james@flipstone.com>
|
||||
# Contributor: James Brechtel <james@flipstone.com>
|
||||
|
||||
pkgname=converge
|
||||
_pkgver=0.1.0.0
|
||||
pkgver=${_pkgver//-/_}
|
||||
pkgrel=1
|
||||
pkgdesc="Auto-sync git repositories by watching for changes, committing, pulling, and pushing"
|
||||
arch=('x86_64')
|
||||
url="https://github.com/jbrechtel/converge"
|
||||
license=('BSD')
|
||||
makedepends=('stack' 'git')
|
||||
depends=('git' 'libnotify' 'gcc-libs')
|
||||
optdepends=('converge-relay: realtime push notifications via SSE relay server')
|
||||
backup=('etc/converge/config.example.yaml')
|
||||
source=(
|
||||
"converge.service"
|
||||
"converge.example.yaml"
|
||||
)
|
||||
md5sums=(
|
||||
'SKIP'
|
||||
'SKIP'
|
||||
)
|
||||
|
||||
build() {
|
||||
cd "$startdir"
|
||||
|
||||
# Use pre-built binary if available (e.g. from scripts/build), otherwise build from source
|
||||
if [[ -x build/converge ]]; then
|
||||
msg "Using pre-built binary from build/converge"
|
||||
install -Dm755 build/converge "$srcdir/bin/converge"
|
||||
else
|
||||
export STACK_ROOT="$srcdir/.stack-root"
|
||||
msg "Building converge with stack (resolver: $(awk '/^resolver:/ {print $2}' stack.yaml))..."
|
||||
stack build \
|
||||
--copy-bins \
|
||||
--local-bin-path "$srcdir/bin" \
|
||||
--ghc-options '-O2'
|
||||
fi
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "$startdir"
|
||||
export STACK_ROOT="$srcdir/.stack-root"
|
||||
msg "Running tests..."
|
||||
stack test
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$startdir"
|
||||
|
||||
# Binary
|
||||
install -Dm755 "$srcdir/bin/converge" \
|
||||
"$pkgdir/usr/bin/converge"
|
||||
|
||||
# User systemd service
|
||||
install -Dm644 converge.service \
|
||||
"$pkgdir/usr/lib/systemd/user/converge.service"
|
||||
|
||||
# Example config
|
||||
install -Dm644 converge.example.yaml \
|
||||
"$pkgdir/etc/converge/config.example.yaml"
|
||||
|
||||
# Documentation
|
||||
install -Dm644 README.md \
|
||||
"$pkgdir/usr/share/doc/converge/README.md"
|
||||
}
|
||||
Reference in New Issue
Block a user