| 1 | #!/bin/sh |
| 2 | # Installeert BlueGit op Arch zonder makepkg. |
| 3 | # Gebruik: sudo packaging/install.sh |
| 4 | set -eu |
| 5 | root=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd) |
| 6 | cd "$root" |
| 7 | export CGO_ENABLED=0 |
| 8 | go build -trimpath -ldflags='-s -w' -o bluegit ./cmd/bluegit |
| 9 | install -Dm755 bluegit /usr/bin/bluegit |
| 10 | install -Dm644 packaging/bluegit.service /usr/lib/systemd/system/bluegit.service |
| 11 | install -Dm644 packaging/sysusers.conf /usr/lib/sysusers.d/bluegit.conf |
| 12 | install -Dm644 packaging/tmpfiles.conf /usr/lib/tmpfiles.d/bluegit.conf |
| 13 | install -Dm644 packaging/storage.conf /usr/share/bluegit/storage.conf.example |
| 14 | if [ ! -f /etc/bluegit/config.yml ]; then |
| 15 | install -Dm640 packaging/bluegit.yml /etc/bluegit/config.yml |
| 16 | fi |
| 17 | systemd-sysusers bluegit.conf || true |
| 18 | systemd-tmpfiles --create bluegit.conf || true |
| 19 | systemctl daemon-reload |
| 20 | echo "Klaar. Vul /etc/bluegit/client_secret." |
| 21 | echo "Maak de map op de 4 TB-schijf, en kopieer /usr/share/bluegit/storage.conf.example naar /etc/systemd/system/bluegit.service.d/storage.conf (pas het pad aan)." |
| 22 | echo "Daarna: systemctl daemon-reload && systemctl enable --now bluegit" |