f546ee450e
Build / build (push) Failing after 12m9s
Creates a oneshot user service (converge-wake.service) that runs converge --sync after the network is online, and a systemd-sleep hook (/usr/lib/systemd/system-sleep/converge-wake) that triggers the service for each logged-in user on resume. Uses After=network-online.target for proper network timing on NetworkManager/systemd-networkd setups, with a 5-second ExecStartPre delay as a safety net for netctl and other environments where network-online.target may not gate on resume. Updated PKGBUILD and AGENTS.md accordingly.
79 lines
2.2 KiB
Bash
79 lines
2.2 KiB
Bash
# Maintainer: James Brechtel <james@leonard-brechtel.com.com>
|
|
# Contributor: James Brechtel <james@leonard-brechtel.com.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-wake.service"
|
|
"converge.example.yaml"
|
|
"src/system-sleep/converge-wake"
|
|
)
|
|
md5sums=(
|
|
'SKIP'
|
|
'SKIP'
|
|
'SKIP'
|
|
'SKIP'
|
|
)
|
|
|
|
build() {
|
|
cd "$startdir"
|
|
echo "$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 services
|
|
install -Dm644 converge.service \
|
|
"$pkgdir/usr/lib/systemd/user/converge.service"
|
|
install -Dm644 converge-wake.service \
|
|
"$pkgdir/usr/lib/systemd/user/converge-wake.service"
|
|
|
|
# Sleep hook (runs converge --sync for all logged-in users after resume)
|
|
install -Dm755 src/system-sleep/converge-wake \
|
|
"$pkgdir/usr/lib/systemd/system-sleep/converge-wake"
|
|
|
|
# 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"
|
|
}
|