Automate AUR publishing from tagged releases.
Add an AUR source-package template, a publish script, a tag-driven GitLab CI job, and docs for bootstrap and required secrets. Co-authored-by: Cursor <cursoragent@cursor.com>
@@ -128,3 +128,21 @@ release:gitlab:
128
128
--assets-link "{\"name\":\"Linux .deb (amd64)\",\"url\":\"${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/dist/posprint_${CI_COMMIT_TAG#v}_amd64.deb?job=build%3Alinux-deb\",\"link_type\":\"package\"}" \
129
129
--assets-link "{\"name\":\"Arch Linux .pkg.tar.zst (x86_64)\",\"url\":\"${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/dist/posprint_${CI_COMMIT_TAG#v}-1-x86_64.pkg.tar.zst?job=build%3Alinux-arch\",\"link_type\":\"package\"}" \
130
130
--assets-link "{\"name\":\"Windows .exe\",\"url\":\"${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/dist/posprint.exe?job=build%3Awindows\",\"link_type\":\"package\"}"
131
132
publish:aur:
133
stage: release
134
image: archlinux/archlinux:base-devel
135
rules:
136
- if: $CI_COMMIT_TAG
137
needs:
138
- release:gitlab
139
before_script:
140
- pacman -Syu --noconfirm
141
- pacman -S --noconfirm --needed rust cargo pkgconf openssl libxkbcommon libxcb dbus wayland libx11 fontconfig freetype2 libglvnd git rsync curl openssh
142
- install -d -m 700 ~/.ssh
143
- printf "%s\n" "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
144
- chmod 600 ~/.ssh/id_ed25519
145
- ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
146
script:
147
- chmod +x scripts/publish-aur.sh
148
- ./scripts/publish-aur.sh "$CI_COMMIT_TAG"
@@ -128,3 +128,21 @@ release:gitlab:128
--assets-link "{\"name\":\"Linux .deb (amd64)\",\"url\":\"${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/dist/posprint_${CI_COMMIT_TAG#v}_amd64.deb?job=build%3Alinux-deb\",\"link_type\":\"package\"}" \
128
--assets-link "{\"name\":\"Linux .deb (amd64)\",\"url\":\"${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/dist/posprint_${CI_COMMIT_TAG#v}_amd64.deb?job=build%3Alinux-deb\",\"link_type\":\"package\"}" \
129
--assets-link "{\"name\":\"Arch Linux .pkg.tar.zst (x86_64)\",\"url\":\"${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/dist/posprint_${CI_COMMIT_TAG#v}-1-x86_64.pkg.tar.zst?job=build%3Alinux-arch\",\"link_type\":\"package\"}" \
129
--assets-link "{\"name\":\"Arch Linux .pkg.tar.zst (x86_64)\",\"url\":\"${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/dist/posprint_${CI_COMMIT_TAG#v}-1-x86_64.pkg.tar.zst?job=build%3Alinux-arch\",\"link_type\":\"package\"}" \
130
--assets-link "{\"name\":\"Windows .exe\",\"url\":\"${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/dist/posprint.exe?job=build%3Awindows\",\"link_type\":\"package\"}"
130
--assets-link "{\"name\":\"Windows .exe\",\"url\":\"${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/dist/posprint.exe?job=build%3Awindows\",\"link_type\":\"package\"}"
131
132
publish:aur:
133
stage: release
134
image: archlinux/archlinux:base-devel
135
rules:
136
- if: $CI_COMMIT_TAG
137
needs:
138
- release:gitlab
139
before_script:
140
- pacman -Syu --noconfirm
141
- pacman -S --noconfirm --needed rust cargo pkgconf openssl libxkbcommon libxcb dbus wayland libx11 fontconfig freetype2 libglvnd git rsync curl openssh
142
- install -d -m 700 ~/.ssh
143
- printf "%s\n" "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
144
- chmod 600 ~/.ssh/id_ed25519
145
- ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
146
script:
147
- chmod +x scripts/publish-aur.sh
148
- ./scripts/publish-aur.sh "$CI_COMMIT_TAG"
@@ -46,7 +46,7 @@ All `${Parameters}` must be supplied via `--set NAME=VALUE` or the command fails
46
46
| Linux (Arch) | `.pkg.tar.zst` (x86_64) | `sudo pacman -U posprint_*_x86_64.pkg.tar.zst` |
47
47
| Windows | `posprint.exe` | Download from GitLab release job artifacts |
48
48
49
Tag a version (e.g. `0.4.0`) to trigger release builds.
49
Tag a version (e.g. `0.4.0`) to trigger release builds. If AUR publishing is configured, the same tag pipeline also updates the AUR package.
50
50
51
51
## Features
52
52
@@ -69,6 +69,7 @@ Tag a version (e.g. `0.4.0`) to trigger release builds.
69
69
| [FILE-FORMAT.md](docs/FILE-FORMAT.md) | `.pos` file envelope (metadata + body) |
70
70
| [PRINTING.md](docs/PRINTING.md) | Printer discovery, transport, ESC/POS pipeline |
71
71
| [POSPRINT-URL.md](docs/POSPRINT-URL.md) | `posprint://` deep links and `lib/` helpers |
72
| [AUR.md](docs/AUR.md) | AUR package layout, secrets, and tag-driven publishing |
72
73
| [BUILD.md](docs/BUILD.md) | Local build scripts and Linux package formats |
73
74
74
75
Documentation must stay aligned with the codebase; see `.cursor/rules/documentation.mdc`.
@@ -46,7 +46,7 @@ All `${Parameters}` must be supplied via `--set NAME=VALUE` or the command fails46
| Linux (Arch) | `.pkg.tar.zst` (x86_64) | `sudo pacman -U posprint_*_x86_64.pkg.tar.zst` |46
| Linux (Arch) | `.pkg.tar.zst` (x86_64) | `sudo pacman -U posprint_*_x86_64.pkg.tar.zst` |47
| Windows | `posprint.exe` | Download from GitLab release job artifacts |47
| Windows | `posprint.exe` | Download from GitLab release job artifacts |48
48
49
Tag a version (e.g. `0.4.0`) to trigger release builds.49
Tag a version (e.g. `0.4.0`) to trigger release builds. If AUR publishing is configured, the same tag pipeline also updates the AUR package.50
50
51
## Features51
## Features52
52
@@ -69,6 +69,7 @@ Tag a version (e.g. `0.4.0`) to trigger release builds.69
| [FILE-FORMAT.md](docs/FILE-FORMAT.md) | `.pos` file envelope (metadata + body) |69
| [FILE-FORMAT.md](docs/FILE-FORMAT.md) | `.pos` file envelope (metadata + body) |70
| [PRINTING.md](docs/PRINTING.md) | Printer discovery, transport, ESC/POS pipeline |70
| [PRINTING.md](docs/PRINTING.md) | Printer discovery, transport, ESC/POS pipeline |71
| [POSPRINT-URL.md](docs/POSPRINT-URL.md) | `posprint://` deep links and `lib/` helpers |71
| [POSPRINT-URL.md](docs/POSPRINT-URL.md) | `posprint://` deep links and `lib/` helpers |72
| [AUR.md](docs/AUR.md) | AUR package layout, secrets, and tag-driven publishing |72
| [BUILD.md](docs/BUILD.md) | Local build scripts and Linux package formats |73
| [BUILD.md](docs/BUILD.md) | Local build scripts and Linux package formats |73
74
74
Documentation must stay aligned with the codebase; see `.cursor/rules/documentation.mdc`.75
Documentation must stay aligned with the codebase; see `.cursor/rules/documentation.mdc`.@@ -0,0 +1,115 @@
1
# AUR publishing
2
3
How `posprint` is published to the Arch User Repository (AUR) from GitLab tags.
4
5
## Chosen approach
6
7
This repository keeps **two Arch package definitions**:
8
9
- `packaging/arch/PKGBUILD`: local builds and GitLab artifact builds (`.pkg.tar.zst`)
10
- `packaging/aur/PKGBUILD`: AUR source package, built by the AUR user from the GitLab tag tarball
11
12
The AUR package is **not** `-bin`. It downloads:
13
14
```text
15
https://gitlab.com/Timfa/posprint/-/archive/<version>/posprint-<version>.tar.gz
16
```
17
18
That keeps the AUR package simple, reproducible, and aligned with upstream tags.
19
20
## Files in this repo
21
22
| Path | Purpose |
23
|------|---------|
24
| `packaging/aur/PKGBUILD` | AUR package template |
25
| `packaging/aur/.SRCINFO` | Initial generated metadata |
26
| `scripts/publish-aur.sh` | Clone AUR repo, update `PKGBUILD`/`.SRCINFO`, commit, push |
27
| `.gitlab-ci.yml` | Runs AUR publish on tags |
28
29
## Release flow
30
31
When a Git tag is pushed:
32
33
1. GitLab builds the normal release artifacts.
34
2. GitLab creates the upstream release.
35
3. GitLab runs `scripts/publish-aur.sh "$CI_COMMIT_TAG"`.
36
4. The script:
37
- downloads the tagged source tarball
38
- computes its SHA-256
39
- clones the AUR repo
40
- updates `pkgver`, `pkgrel`, and `sha256sums`
41
- regenerates `.SRCINFO`
42
- commits and pushes to AUR `master`
43
44
## GitLab CI secrets
45
46
Create these **CI/CD variables** in GitLab:
47
48
| Variable | Required | Notes |
49
|----------|----------|-------|
50
| `AUR_SSH_PRIVATE_KEY` | yes | Private SSH key for your AUR account; use **masked** + **protected** |
51
| `AUR_GIT_AUTHOR_NAME` | recommended | Example: `Tim Falken` or `posprint release bot` |
52
| `AUR_GIT_AUTHOR_EMAIL` | recommended | Example: `you@example.com` |
53
| `AUR_PKGBASE` | optional | Defaults to `posprint`; only needed if the AUR repo name differs |
54
55
Recommended GitLab settings:
56
57
- mark the variables as **Protected**
58
- mark `AUR_SSH_PRIVATE_KEY` as **Masked**
59
- only allow the release/tag pipeline on protected tags
60
61
## How to create the AUR repository
62
63
If you have an AUR account but no package yet:
64
65
1. Make sure your **SSH public key** is added to your AUR account profile.
66
2. On an Arch machine (or any machine with `git` + `makepkg`), create a working directory:
67
68
```bash
69
mkdir ~/posprint-aur
70
cd ~/posprint-aur
71
git init
72
git remote add origin ssh://aur@aur.archlinux.org/posprint.git
73
```
74
75
3. Copy in the initial metadata from this repo:
76
77
```bash
78
cp /path/to/posprint/packaging/aur/PKGBUILD .
79
cp /path/to/posprint/packaging/aur/.SRCINFO .
80
```
81
82
4. Commit and push:
83
84
```bash
85
git checkout -b master
86
git add PKGBUILD .SRCINFO
87
git commit -m "initial import"
88
git push origin master
89
```
90
91
After the first push, the AUR package page exists and later tag pipelines can update it.
92
93
## Bootstrapping manually
94
95
Before enabling CI automation, test one update locally:
96
97
```bash
98
cd /path/to/posprint
99
./scripts/publish-aur.sh 0.4.0
100
```
101
102
Requirements on that machine:
103
104
- `git`
105
- `curl`
106
- `sha256sum`
107
- `makepkg`
108
- SSH access to `aur@aur.archlinux.org`
109
110
## Notes
111
112
- `pkgrel` resets to `1` for every new upstream release.
113
- If you need an AUR-only packaging fix without a new upstream release, bump `pkgrel` in the AUR repo manually.
114
- `.SRCINFO` must always be committed together with `PKGBUILD`.
115
- The AUR only accepts pushes to the `master` branch.
@@ -0,0 +1,115 @@1
# AUR publishing2
3
How `posprint` is published to the Arch User Repository (AUR) from GitLab tags.4
5
## Chosen approach6
7
This repository keeps **two Arch package definitions**:8
9
- `packaging/arch/PKGBUILD`: local builds and GitLab artifact builds (`.pkg.tar.zst`)10
- `packaging/aur/PKGBUILD`: AUR source package, built by the AUR user from the GitLab tag tarball11
12
The AUR package is **not** `-bin`. It downloads:13
14
```text15
https://gitlab.com/Timfa/posprint/-/archive/<version>/posprint-<version>.tar.gz16
```17
18
That keeps the AUR package simple, reproducible, and aligned with upstream tags.19
20
## Files in this repo21
22
| Path | Purpose |23
|------|---------|24
| `packaging/aur/PKGBUILD` | AUR package template |25
| `packaging/aur/.SRCINFO` | Initial generated metadata |26
| `scripts/publish-aur.sh` | Clone AUR repo, update `PKGBUILD`/`.SRCINFO`, commit, push |27
| `.gitlab-ci.yml` | Runs AUR publish on tags |28
29
## Release flow30
31
When a Git tag is pushed:32
33
1. GitLab builds the normal release artifacts.34
2. GitLab creates the upstream release.35
3. GitLab runs `scripts/publish-aur.sh "$CI_COMMIT_TAG"`.36
4. The script:37
- downloads the tagged source tarball38
- computes its SHA-25639
- clones the AUR repo40
- updates `pkgver`, `pkgrel`, and `sha256sums`41
- regenerates `.SRCINFO`42
- commits and pushes to AUR `master`43
44
## GitLab CI secrets45
46
Create these **CI/CD variables** in GitLab:47
48
| Variable | Required | Notes |49
|----------|----------|-------|50
| `AUR_SSH_PRIVATE_KEY` | yes | Private SSH key for your AUR account; use **masked** + **protected** |51
| `AUR_GIT_AUTHOR_NAME` | recommended | Example: `Tim Falken` or `posprint release bot` |52
| `AUR_GIT_AUTHOR_EMAIL` | recommended | Example: `you@example.com` |53
| `AUR_PKGBASE` | optional | Defaults to `posprint`; only needed if the AUR repo name differs |54
55
Recommended GitLab settings:56
57
- mark the variables as **Protected**58
- mark `AUR_SSH_PRIVATE_KEY` as **Masked**59
- only allow the release/tag pipeline on protected tags60
61
## How to create the AUR repository62
63
If you have an AUR account but no package yet:64
65
1. Make sure your **SSH public key** is added to your AUR account profile.66
2. On an Arch machine (or any machine with `git` + `makepkg`), create a working directory:67
68
```bash69
mkdir ~/posprint-aur70
cd ~/posprint-aur71
git init72
git remote add origin ssh://aur@aur.archlinux.org/posprint.git73
```74
75
3. Copy in the initial metadata from this repo:76
77
```bash78
cp /path/to/posprint/packaging/aur/PKGBUILD .79
cp /path/to/posprint/packaging/aur/.SRCINFO .80
```81
82
4. Commit and push:83
84
```bash85
git checkout -b master86
git add PKGBUILD .SRCINFO87
git commit -m "initial import"88
git push origin master89
```90
91
After the first push, the AUR package page exists and later tag pipelines can update it.92
93
## Bootstrapping manually94
95
Before enabling CI automation, test one update locally:96
97
```bash98
cd /path/to/posprint99
./scripts/publish-aur.sh 0.4.0100
```101
102
Requirements on that machine:103
104
- `git`105
- `curl`106
- `sha256sum`107
- `makepkg`108
- SSH access to `aur@aur.archlinux.org`109
110
## Notes111
112
- `pkgrel` resets to `1` for every new upstream release.113
- If you need an AUR-only packaging fix without a new upstream release, bump `pkgrel` in the AUR repo manually.114
- `.SRCINFO` must always be committed together with `PKGBUILD`.115
- The AUR only accepts pushes to the `master` branch.@@ -101,6 +101,20 @@ sudo pacman -S --needed base-devel rust pkgconf openssl libxkbcommon libxcb dbus
101
101
wayland libx11 fontconfig freetype2 libglvnd git rsync
102
102
```
103
103
104
### AUR publishing
105
106
Normal local Arch packaging uses `packaging/arch/PKGBUILD`.
107
108
Automated AUR publishing uses:
109
110
- `packaging/aur/PKGBUILD`
111
- `packaging/aur/.SRCINFO`
112
- `scripts/publish-aur.sh`
113
114
That AUR package builds from the GitLab tag tarball, not from a prebuilt binary.
115
116
Setup and required GitLab secrets are documented in [AUR.md](AUR.md).
117
104
118
### File association (`.pos` → posprint)
105
119
106
120
The package installs:
@@ -101,6 +101,20 @@ sudo pacman -S --needed base-devel rust pkgconf openssl libxkbcommon libxcb dbus101
wayland libx11 fontconfig freetype2 libglvnd git rsync101
wayland libx11 fontconfig freetype2 libglvnd git rsync102
```102
```103
103
104
### AUR publishing105
106
Normal local Arch packaging uses `packaging/arch/PKGBUILD`.107
108
Automated AUR publishing uses:109
110
- `packaging/aur/PKGBUILD`111
- `packaging/aur/.SRCINFO`112
- `scripts/publish-aur.sh`113
114
That AUR package builds from the GitLab tag tarball, not from a prebuilt binary.115
116
Setup and required GitLab secrets are documented in [AUR.md](AUR.md).117
104
### File association (`.pos` → posprint)118
### File association (`.pos` → posprint)105
119
106
The package installs:120
The package installs:@@ -0,0 +1,54 @@
1
pkgbase = posprint
2
pkgdesc = Designer for POS-print documents with live preview and USB ESC/POS printing
3
pkgver = 0.4.0
4
pkgrel = 1
5
url = https://gitlab.com/Timfa/posprint
6
arch = x86_64
7
license = MIT
8
makedepends = rust
9
makedepends = cargo
10
makedepends = pkgconf
11
makedepends = git
12
makedepends = rsync
13
depends = gcc-libs
14
depends = libxkbcommon
15
depends = libxcb
16
depends = openssl
17
depends = dbus
18
depends = wayland
19
depends = libx11
20
depends = fontconfig
21
depends = freetype2
22
depends = libglvnd
23
options = !lto
24
source = https://gitlab.com/Timfa/posprint/-/archive/0.4.0/posprint-0.4.0.tar.gz
25
sha256sums = b54a73c38deb9c57388039b00fd451038264b6fa3694348456108fb3c117f923
26
27
pkgname = posprint
28
pkgbase = posprint
29
pkgdesc = Designer for POS-print documents with live preview and USB ESC/POS printing
30
pkgver = 0.4.0
31
pkgrel = 1
32
url = https://gitlab.com/Timfa/posprint
33
arch = x86_64
34
license = MIT
35
makedepends = rust
36
makedepends = cargo
37
makedepends = pkgconf
38
makedepends = git
39
makedepends = rsync
40
depends = gcc-libs
41
depends = libxkbcommon
42
depends = libxcb
43
depends = openssl
44
depends = dbus
45
depends = wayland
46
depends = libx11
47
depends = fontconfig
48
depends = freetype2
49
depends = libglvnd
50
options = !lto
51
source = https://gitlab.com/Timfa/posprint/-/archive/0.4.0/posprint-0.4.0.tar.gz
52
sha256sums = b54a73c38deb9c57388039b00fd451038264b6fa3694348456108fb3c117f923
53
54
pkgname = posprint
@@ -0,0 +1,54 @@1
pkgbase = posprint2
pkgdesc = Designer for POS-print documents with live preview and USB ESC/POS printing3
pkgver = 0.4.04
pkgrel = 15
url = https://gitlab.com/Timfa/posprint6
arch = x86_647
license = MIT8
makedepends = rust9
makedepends = cargo10
makedepends = pkgconf11
makedepends = git12
makedepends = rsync13
depends = gcc-libs14
depends = libxkbcommon15
depends = libxcb16
depends = openssl17
depends = dbus18
depends = wayland19
depends = libx1120
depends = fontconfig21
depends = freetype222
depends = libglvnd23
options = !lto24
source = https://gitlab.com/Timfa/posprint/-/archive/0.4.0/posprint-0.4.0.tar.gz25
sha256sums = b54a73c38deb9c57388039b00fd451038264b6fa3694348456108fb3c117f92326
27
pkgname = posprint28
pkgbase = posprint29
pkgdesc = Designer for POS-print documents with live preview and USB ESC/POS printing30
pkgver = 0.4.031
pkgrel = 132
url = https://gitlab.com/Timfa/posprint33
arch = x86_6434
license = MIT35
makedepends = rust36
makedepends = cargo37
makedepends = pkgconf38
makedepends = git39
makedepends = rsync40
depends = gcc-libs41
depends = libxkbcommon42
depends = libxcb43
depends = openssl44
depends = dbus45
depends = wayland46
depends = libx1147
depends = fontconfig48
depends = freetype249
depends = libglvnd50
options = !lto51
source = https://gitlab.com/Timfa/posprint/-/archive/0.4.0/posprint-0.4.0.tar.gz52
sha256sums = b54a73c38deb9c57388039b00fd451038264b6fa3694348456108fb3c117f92353
54
pkgname = posprint@@ -0,0 +1,42 @@
1
# Maintainer: posprint contributors
2
pkgname=posprint
3
pkgver=0.4.0
4
pkgrel=1
5
pkgdesc="Designer for POS-print documents with live preview and USB ESC/POS printing"
6
arch=('x86_64')
7
url="https://gitlab.com/Timfa/posprint"
8
license=('MIT')
9
depends=(
10
'gcc-libs'
11
'libxkbcommon'
12
'libxcb'
13
'openssl'
14
'dbus'
15
'wayland'
16
'libx11'
17
'fontconfig'
18
'freetype2'
19
'libglvnd'
20
)
21
makedepends=('rust' 'cargo' 'pkgconf' 'git' 'rsync')
22
options=('!lto')
23
source=("https://gitlab.com/Timfa/posprint/-/archive/${pkgver}/posprint-${pkgver}.tar.gz")
24
sha256sums=('b54a73c38deb9c57388039b00fd451038264b6fa3694348456108fb3c117f923')
25
26
build() {
27
cd "$srcdir/$pkgname-$pkgver"
28
cargo build --release --locked
29
}
30
31
package() {
32
cd "$srcdir/$pkgname-$pkgver"
33
install -Dm755 target/release/posprint "$pkgdir/usr/bin/posprint"
34
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
35
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
36
install -Dm644 packaging/posprint.desktop "$pkgdir/usr/share/applications/posprint.desktop"
37
install -Dm644 packaging/posprint-url.desktop "$pkgdir/usr/share/applications/posprint-url.desktop"
38
install -Dm644 packaging/mime/posprint.xml "$pkgdir/usr/share/mime/packages/posprint.xml"
39
install -Dm644 packaging/linux/posprint-print.desktop "$pkgdir/usr/share/kio/servicemenus/posprint-print.desktop"
40
install -Dm644 packaging/linux/posprint-print-thunar.xml "$pkgdir/usr/share/thunar/uca/posprint-print.xml"
41
install -Dm644 pos-logo.png "$pkgdir/usr/share/pixmaps/posprint.png"
42
}
@@ -0,0 +1,42 @@1
# Maintainer: posprint contributors2
pkgname=posprint3
pkgver=0.4.04
pkgrel=15
pkgdesc="Designer for POS-print documents with live preview and USB ESC/POS printing"6
arch=('x86_64')7
url="https://gitlab.com/Timfa/posprint"8
license=('MIT')9
depends=(10
'gcc-libs'11
'libxkbcommon'12
'libxcb'13
'openssl'14
'dbus'15
'wayland'16
'libx11'17
'fontconfig'18
'freetype2'19
'libglvnd'20
)21
makedepends=('rust' 'cargo' 'pkgconf' 'git' 'rsync')22
options=('!lto')23
source=("https://gitlab.com/Timfa/posprint/-/archive/${pkgver}/posprint-${pkgver}.tar.gz")24
sha256sums=('b54a73c38deb9c57388039b00fd451038264b6fa3694348456108fb3c117f923')25
26
build() {27
cd "$srcdir/$pkgname-$pkgver"28
cargo build --release --locked29
}30
31
package() {32
cd "$srcdir/$pkgname-$pkgver"33
install -Dm755 target/release/posprint "$pkgdir/usr/bin/posprint"34
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"35
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"36
install -Dm644 packaging/posprint.desktop "$pkgdir/usr/share/applications/posprint.desktop"37
install -Dm644 packaging/posprint-url.desktop "$pkgdir/usr/share/applications/posprint-url.desktop"38
install -Dm644 packaging/mime/posprint.xml "$pkgdir/usr/share/mime/packages/posprint.xml"39
install -Dm644 packaging/linux/posprint-print.desktop "$pkgdir/usr/share/kio/servicemenus/posprint-print.desktop"40
install -Dm644 packaging/linux/posprint-print-thunar.xml "$pkgdir/usr/share/thunar/uca/posprint-print.xml"41
install -Dm644 pos-logo.png "$pkgdir/usr/share/pixmaps/posprint.png"42
}@@ -0,0 +1,58 @@
1
#!/usr/bin/env bash
2
set -euo pipefail
3
4
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5
PKGBASE="${AUR_PKGBASE:-posprint}"
6
AUR_REMOTE="ssh://aur@aur.archlinux.org/${PKGBASE}.git"
7
VERSION="${1:-}"
8
TMPDIR="${TMPDIR:-/tmp}"
9
WORKDIR="$(mktemp -d "$TMPDIR/${PKGBASE}-aur-XXXXXX")"
10
cleanup() { rm -rf "$WORKDIR"; }
11
trap cleanup EXIT
12
13
cd "$ROOT"
14
15
if [[ -z "$VERSION" ]]; then
16
VERSION="$(grep '^version = ' Cargo.toml | sed -E 's/.*"([^"]+)"/\1/')"
17
fi
18
19
for cmd in git makepkg sed sha256sum curl; do
20
command -v "$cmd" >/dev/null || { echo "Missing command: $cmd" >&2; exit 1; }
21
done
22
23
if [[ ! -f packaging/aur/PKGBUILD ]]; then
24
echo "Missing packaging/aur/PKGBUILD template" >&2
25
exit 1
26
fi
27
28
ARCHIVE_URL="https://gitlab.com/Timfa/posprint/-/archive/${VERSION}/posprint-${VERSION}.tar.gz"
29
30
echo "Checking source tarball: $ARCHIVE_URL"
31
TMP_TARBALL="$WORKDIR/source.tar.gz"
32
curl -fsSL "$ARCHIVE_URL" -o "$TMP_TARBALL"
33
ARCHIVE_SHA="$(sha256sum "$TMP_TARBALL" | awk '{print $1}')"
34
35
echo "Cloning AUR repo: $AUR_REMOTE"
36
git clone "$AUR_REMOTE" "$WORKDIR/repo"
37
cd "$WORKDIR/repo"
38
39
git config user.name "${AUR_GIT_AUTHOR_NAME:-posprint release bot}"
40
git config user.email "${AUR_GIT_AUTHOR_EMAIL:-noreply@example.invalid}"
41
42
cp "$ROOT/packaging/aur/PKGBUILD" PKGBUILD
43
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD
44
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
45
sed -i "s|^sha256sums=.*|sha256sums=('${ARCHIVE_SHA}')|" PKGBUILD
46
47
makepkg --printsrcinfo > .SRCINFO
48
49
if git diff --quiet -- PKGBUILD .SRCINFO; then
50
echo "AUR repo already up to date for ${VERSION}"
51
exit 0
52
fi
53
54
git add PKGBUILD .SRCINFO
55
git commit -m "upstream release ${VERSION}"
56
git push origin master
57
58
echo "AUR updated: ${PKGBASE} ${VERSION}"
@@ -0,0 +1,58 @@1
#!/usr/bin/env bash2
set -euo pipefail3
4
ROOT="$(cd "$(dirname "$0")/.." && pwd)"5
PKGBASE="${AUR_PKGBASE:-posprint}"6
AUR_REMOTE="ssh://aur@aur.archlinux.org/${PKGBASE}.git"7
VERSION="${1:-}"8
TMPDIR="${TMPDIR:-/tmp}"9
WORKDIR="$(mktemp -d "$TMPDIR/${PKGBASE}-aur-XXXXXX")"10
cleanup() { rm -rf "$WORKDIR"; }11
trap cleanup EXIT12
13
cd "$ROOT"14
15
if [[ -z "$VERSION" ]]; then16
VERSION="$(grep '^version = ' Cargo.toml | sed -E 's/.*"([^"]+)"/\1/')"17
fi18
19
for cmd in git makepkg sed sha256sum curl; do20
command -v "$cmd" >/dev/null || { echo "Missing command: $cmd" >&2; exit 1; }21
done22
23
if [[ ! -f packaging/aur/PKGBUILD ]]; then24
echo "Missing packaging/aur/PKGBUILD template" >&225
exit 126
fi27
28
ARCHIVE_URL="https://gitlab.com/Timfa/posprint/-/archive/${VERSION}/posprint-${VERSION}.tar.gz"29
30
echo "Checking source tarball: $ARCHIVE_URL"31
TMP_TARBALL="$WORKDIR/source.tar.gz"32
curl -fsSL "$ARCHIVE_URL" -o "$TMP_TARBALL"33
ARCHIVE_SHA="$(sha256sum "$TMP_TARBALL" | awk '{print $1}')"34
35
echo "Cloning AUR repo: $AUR_REMOTE"36
git clone "$AUR_REMOTE" "$WORKDIR/repo"37
cd "$WORKDIR/repo"38
39
git config user.name "${AUR_GIT_AUTHOR_NAME:-posprint release bot}"40
git config user.email "${AUR_GIT_AUTHOR_EMAIL:-noreply@example.invalid}"41
42
cp "$ROOT/packaging/aur/PKGBUILD" PKGBUILD43
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD44
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD45
sed -i "s|^sha256sums=.*|sha256sums=('${ARCHIVE_SHA}')|" PKGBUILD46
47
makepkg --printsrcinfo > .SRCINFO48
49
if git diff --quiet -- PKGBUILD .SRCINFO; then50
echo "AUR repo already up to date for ${VERSION}"51
exit 052
fi53
54
git add PKGBUILD .SRCINFO55
git commit -m "upstream release ${VERSION}"56
git push origin master57
58
echo "AUR updated: ${PKGBASE} ${VERSION}"