-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-aur.sh
executable file
·73 lines (61 loc) · 1.61 KB
/
release-aur.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash
set -euxo pipefail
RTX_VERSION=$(./scripts/get-version.sh)
SHA512=$(curl -L "https://github.com/jdxcode/rtx/archive/$RTX_VERSION.tar.gz" | sha512sum | awk '{print $1}')
if [ ! -d aur ]; then
git clone ssh://[email protected]/rtx.git aur
fi
git -C aur pull
cat >aur/PKGBUILD <<EOF
# Maintainer: Jeff Dickey <releases at rtx dot pub>
pkgname=rtx
pkgver=${RTX_VERSION#v*}
pkgrel=1
pkgdesc='Polyglot runtime manager'
arch=('x86_64')
url='https://github.com/jdxcode/rtx'
license=('MIT')
makedepends=('cargo')
provides=('rtx')
conflicts=('rtx')
options=('!lto')
source=("\$pkgname-\$pkgver.tar.gz::https://github.com/jdxcode/\$pkgname/archive/v\$pkgver.tar.gz")
sha512sums=('$SHA512')
prepare() {
cd "\$srcdir/\$pkgname-\$pkgver"
cargo fetch --locked --target "\$CARCH-unknown-linux-gnu"
}
build() {
cd "\$srcdir/\$pkgname-\$pkgver"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release
}
package() {
cd "\$srcdir/\$pkgname-\$pkgver"
install -Dm0755 -t "\$pkgdir/usr/bin/" "target/release/\$pkgname"
}
check() {
cd "\$srcdir/\$pkgname-\$pkgver"
./target/release/rtx --version
}
EOF
cat >aur/.SRCINFO <<EOF
pkgbase = rtx
pkgdesc = Polyglot runtime manager
pkgver = ${RTX_VERSION#v*}
pkgrel = 1
url = https://github.com/jdxcode/rtx
arch = x86_64
license = MIT
makedepends = cargo
provides = rtx
conflicts = rtx
source = rtx-${RTX_VERSION#v*}.tar.gz::https://github.com/jdxcode/rtx/archive/$RTX_VERSION.tar.gz
sha512sums = $SHA512
pkgname = rtx
EOF
cd aur
git add .SRCINFO PKGBUILD
git commit -m "rtx ${RTX_VERSION#v}"
git push