-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathPKGBUILD
More file actions
58 lines (53 loc) · 2.38 KB
/
PKGBUILD
File metadata and controls
58 lines (53 loc) · 2.38 KB
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
# This PKGBUILD is not a full PKGBUILD
# pkgname, pkgver, source, and sha1sums are to be generated
pkgdesc='Summarize disk usage of the set of files, recursively for directories.'
pkgrel=1
arch=(x86_64)
license=(Apache-2.0)
url='https://github.com/KSXGitHub/parallel-disk-usage'
provides=(parallel-disk-usage)
conflicts=(parallel-disk-usage)
sha1sums=(
"$_checksum" # for the pdu binary
"${_completion_checksums[@]}" # for the completion files
SKIP # for the man page
SKIP # for the readme file
SKIP # for the usage file
SKIP # for the license file
)
prepare() {
if [[ -n $PDU_SKIP_PROVENANCE_VERIFY ]]; then
warning 'PDU_SKIP_PROVENANCE_VERIFY is set, skipping provenance verification.'
return 0
fi
if ! command -v gh > /dev/null 2>&1; then
warning 'GitHub CLI (gh) not found, skipping provenance verification.'
plain 'hint: install the github-cli package to enable cryptographic verification of release artifacts.'
return 0
fi
if ! gh auth status > /dev/null 2>&1; then
warning 'gh is not authenticated, skipping provenance verification.'
plain 'hint: run `gh auth login` (or set GH_TOKEN) to enable cryptographic verification of release artifacts.'
return 0
fi
msg2 'Verifying build provenance with gh attestation...'
local _repo='KSXGitHub/parallel-disk-usage'
local _file
for _file in "pdu-$_checksum" "completion.$pkgver.bash" "completion.$pkgver.fish" "completion.$pkgver.zsh"; do
if ! gh attestation verify --repo "$_repo" "$_file"; then
error 'Build provenance verification failed.'
plain 'hint: set PDU_SKIP_PROVENANCE_VERIFY=1 to skip verification (e.g., for offline builds).'
return 1
fi
done
}
package() {
install -Dm755 "pdu-$_checksum" "$pkgdir/usr/bin/pdu"
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
install -Dm644 USAGE.md "$pkgdir/usr/share/doc/$pkgname/USAGE.md"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 "completion.$pkgver.bash" "$pkgdir/usr/share/bash-completion/completions/pdu"
install -Dm644 "completion.$pkgver.fish" "$pkgdir/usr/share/fish/completions/pdu.fish"
install -Dm644 "completion.$pkgver.zsh" "$pkgdir/usr/share/zsh/site-functions/_pdu"
install -Dm644 "pdu.$pkgver.1" "$pkgdir/usr/share/man/man1/pdu.1"
}