summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorcaltlgin2020-11-04 15:36:39 +1300
committercaltlgin2020-11-04 15:36:39 +1300
commit501de410f058af267c85947101006302504caf14 (patch)
tree9ac55943f69f241b25c54f56936950dd20761502
downloadaur-cspparse-git.tar.gz
Add to AUR
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD45
2 files changed, 61 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2ff369acff3d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = cspparse-git
+ pkgdesc = Tool to evaluate Content Security Policies
+ pkgver = r27.372a4b8
+ pkgrel = 1
+ url = https://github.com/lc/cspparse
+ arch = x86_64
+ license = Unknown
+ makedepends = git
+ makedepends = go
+ provides = cspparse
+ conflicts = cspparse
+ source = git+https://github.com/lc/cspparse.git
+ sha256sums = SKIP
+
+pkgname = cspparse-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..cda32085c736
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: Caltlgin Stsodaat <contact@fossdaily.xyz>
+
+_pkgname='cspparse'
+pkgname="${_pkgname}-git"
+pkgver=r27.372a4b8
+pkgrel=1
+pkgdesc='Tool to evaluate Content Security Policies'
+arch=('x86_64')
+url='https://github.com/lc/cspparse'
+license=('Unknown')
+makedepends=('git' 'go')
+provides=("${_pkgname}")
+conflicts=("${_pkgname}")
+source=("git+${url}.git")
+sha256sums=('SKIP')
+
+prepare() {
+ export GOPATH="${srcdir}/gopath"
+ go clean -modcache
+}
+
+pkgver() {
+ cd "${_pkgname}"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+build() {
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+
+ cd "${_pkgname}"
+ go build -v -o "${_pkgname}" .
+}
+
+package() {
+ cd "${_pkgname}"
+ install -Dvm755 "${_pkgname}" -t "${pkgdir}/usr/bin"
+ install -Dvm644 'README.md' -t "${pkgdir}/usr/share/doc/${_pkgname}"
+ #install -Dvm644 'LICENSE' -t "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
+}
+
+# vim: ts=2 sw=2 et: