blob: e663793606000677140cd97cfc08786c1f0b2836 (
plain)
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
|
# Maintainer: Kief Studio <packages@kief.studio>
pkgname=aur-scanner
pkgver=2.0.0
pkgrel=1
pkgdesc="Security scanner for Arch Linux AUR packages - detect malicious PKGBUILDs before installation"
arch=('x86_64' 'aarch64')
url="https://github.com/KiefStudioMA/ks-aur-scanner"
license=('GPL-3.0-or-later')
depends=('gcc-libs' 'openssl')
makedepends=('cargo' 'clang' 'git')
provides=('aur-scan')
conflicts=('aur-scanner-git' 'ks-aur-scanner')
options=('!debug')
# Source is the GPG-signed release tag, verified against our signing key.
# Integrity comes from git + the tag signature (validpgpkeys), which is stronger
# than hashing a GitHub-generated tarball -- so sha256sums is intentionally SKIP.
# Import the key first if makepkg can't find it:
# gpg --recv-keys 25631EAE3F43999050B7D7021132BF893C33FB51
source=("git+https://github.com/KiefStudioMA/ks-aur-scanner.git#tag=v$pkgver?signed")
validpgpkeys=('25631EAE3F43999050B7D7021132BF893C33FB51') # gitleaks:allow (public GPG key fingerprint, not a secret)
sha256sums=('SKIP')
prepare() {
cd "ks-aur-scanner"
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cd "ks-aur-scanner"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --release --all --locked
}
check() {
cd "ks-aur-scanner"
export RUSTUP_TOOLCHAIN=stable
cargo test --release --all --locked
}
package() {
cd "ks-aur-scanner"
# Binaries
install -Dm755 "target/release/aur-scan" "$pkgdir/usr/bin/aur-scan"
install -Dm755 "target/release/aur-scan-wrap" "$pkgdir/usr/bin/aur-scan-wrap"
install -Dm755 "target/release/aur-scan-hook" "$pkgdir/usr/bin/aur-scan-hook"
# Shell integration -- the recommended gate. Source it from your shell rc to
# scan AUR packages BEFORE makepkg builds them.
install -Dm644 "install/integration.bash" "$pkgdir/usr/share/aur-scan/integration.bash"
install -Dm644 "install/integration.zsh" "$pkgdir/usr/share/aur-scan/integration.zsh"
install -Dm644 "install/integration.fish" "$pkgdir/usr/share/aur-scan/integration.fish"
install -Dm644 "install/integration.nu" "$pkgdir/usr/share/aur-scan/integration.nu"
# Community rules example
install -Dm644 "install/rules.d/example.toml" "$pkgdir/usr/share/aur-scanner/rules.d/example.toml"
# pacman hook, shipped as an opt-in example (NOT auto-enabled). It runs after
# makepkg has already built the package -- prefer the shell integration above.
install -Dm644 "install/aur-scan.hook" "$pkgdir/usr/share/aur-scan/aur-scan.hook.example"
# License + docs
install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 "README.md" "$pkgdir/usr/share/doc/$pkgname/README.md"
}
|