# Build scripts

Local release builds for Windows and Linux.

## Windows

```powershell
.\scripts\build-windows.ps1
```

Output: `target\release\posprint.exe`

Options:

```powershell
.\scripts\build-windows.ps1 -Deb:$false   # exe only (default)
```

## Linux

```bash
chmod +x scripts/build-linux.sh
./scripts/build-linux.sh          # release binary
./scripts/build-linux.sh --deb    # binary + .deb package
```

Outputs:

| Artifact | Path |
|----------|------|
| Binary | `target/release/posprint` |
| Debian package | `target/debian/*.deb` |

### Linux targets we support

| Format | Distros | Notes |
|--------|---------|-------|
| **`.deb`** | Debian, Ubuntu, Mint, Pop!_OS, etc. | **Recommended** for apt-based systems; produced by `cargo-deb` |
| **Raw binary** | Any x86_64 Linux | Copy `target/release/posprint`; needs X11/Wayland libs at runtime |
| **`.rpm`** | Fedora, RHEL, openSUSE | Not automated yet; build binary and wrap with `fpm` if needed |
| **AppImage** | Universal | Not automated yet; good for portable distribution |

**Architecture:** `x86_64` (amd64) only in CI and build scripts today.

### Linux build dependencies (Debian/Ubuntu)

```bash
sudo apt-get install -y build-essential pkg-config \
  libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev
```

For `.deb`:

```bash
cargo install cargo-deb --locked
```

## Tests before release

```bash
cargo test --release
```
