Notes for packaging.

# AUR

- [`dpibreak-git`](https://aur.archlinux.org/packages/dpibreak-git)
- [`dpibreak`](https://aur.archlinux.org/packages/dpibreak) — stable
  release

## Test

Build the Docker image once:

```bash
docker build -t dpibreak-aur pkg/aur/
```

Test a package:

```bash
docker run -it --rm dpibreak-aur bash
git clone https://aur.archlinux.org/dpibreak-git.git
cd dpibreak-git && makepkg -si
```

## Update PKGBUILD

### dpibreak-git

Only update when `PKGBUILD` itself changes (e.g., new dependency, new
install target). `pkgver` is auto-generated by `makepkg`.

```bash
cd pkg/aur/dpibreak-git
# edit PKGBUILD
docker run --rm -v $(pwd):/home/builder/pkg dpibreak-aur bash -c "cd pkg && makepkg --printsrcinfo > .SRCINFO"
git add PKGBUILD .SRCINFO
git commit
git push
```

### dpibreak (stable release)

Update on every new release:

1. Update `pkgver` in `PKGBUILD`
2. Get the new sha256sum:
   ```bash
   curl -sL https://github.com/dilluti0n/dpibreak/archive/refs/tags/vX.Y.Z.tar.gz | sha256sum | awk '{print $1}'
   ```
3. Update `sha256sums` in `PKGBUILD`
4. Regenerate `.SRCINFO` and push:
   ```bash
   docker run --rm -v $(pwd):/home/builder/pkg dpibreak-aur bash -c "cd pkg && makepkg --printsrcinfo > .SRCINFO"
   git add PKGBUILD .SRCINFO
   git commit -m "upgpkg: dpibreak X.Y.Z"
   git push
   ```
