diff options
author | Chocobo1 | 2023-02-24 22:02:37 +0800 |
---|---|---|
committer | Chocobo1 | 2023-02-24 22:14:12 +0800 |
commit | 4253149dc013382efdfa7b36b1d0fc65f2c16843 (patch) | |
tree | 0dd2ff97d58fef72d524d693ff412e3fda98ed49 | |
download | aur-4253149dc013382efdfa7b36b1d0fc65f2c16843.tar.gz |
newpkg: criticality_score-git 2.0.0.r0.g1e7ad38-1
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 58 |
2 files changed, 75 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..4b7a9c55579a --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = criticality_score-git + pkgdesc = Gives criticality score for an open source project + pkgver = 2.0.0.r0.g1e7ad38 + pkgrel = 1 + url = https://github.com/ossf/criticality_score + arch = i686 + arch = x86_64 + license = apache + makedepends = git + makedepends = go + depends = glibc + provides = criticality_score=2.0.0.r0.g1e7ad38 + conflicts = criticality_score + source = git+https://github.com/ossf/criticality_score.git + sha256sums = SKIP + +pkgname = criticality_score-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..f9ce1baac414 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,58 @@ +# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net> + +pkgname=criticality_score-git +pkgver=2.0.0.r0.g1e7ad38 +pkgrel=1 +pkgdesc="Gives criticality score for an open source project" +arch=('i686' 'x86_64') +url="https://github.com/ossf/criticality_score" +license=('apache') +depends=('glibc') +makedepends=('git' 'go') +provides=("criticality_score=$pkgver") +conflicts=('criticality_score') +source=("git+https://github.com/ossf/criticality_score.git") +sha256sums=('SKIP') + + +export CGO_CPPFLAGS="${CPPFLAGS}" +export CGO_CFLAGS="${CFLAGS}" +export CGO_CXXFLAGS="${CXXFLAGS}" +export CGO_LDFLAGS="${LDFLAGS}" +export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external -trimpath -mod=readonly -modcacherw" + +pkgver() { + cd "criticality_score" + + _tag=$(git tag -l --sort -v:refname | grep -P '^v?[\d\.]+$' | head -n1) + _rev=$(git rev-list --count $_tag..HEAD) + _hash=$(git rev-parse --short HEAD) + printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v//' +} + +build() { + cd "criticality_score" + + go build \ + ./... +} + +check() { + cd "criticality_score" + + go test \ + ./... +} + +package() { + cd "criticality_score" + + GOBIN="$pkgdir/usr/bin" \ + go install \ + ./cmd/criticality_score \ + ./cmd/enumerate_github \ + ./cmd/scorer + + install -d "$pkgdir/usr/share/criticality_score" + cp -r config "$pkgdir/usr/share/criticality_score" +} |