summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMaxim De Clercq2023-03-06 12:43:08 +0100
committerMaxim De Clercq2023-03-06 12:43:08 +0100
commit54f42370d5a745461396942f774c01984976a518 (patch)
tree4a92f8e167b5c39a41d41c6a848730600db09207 /PKGBUILD
downloadaur-54f42370d5a745461396942f774c01984976a518.tar.gz
chore: initial commit
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD42
1 files changed, 42 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1b56df4b2065
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Maxim De Clercq <youremail@domain.com>
+_pkgname=capstan
+pkgname=$_pkgname-git
+pkgver=v0.4.1.r6.de91c4e
+pkgrel=1
+pkgdesc="Capstan, a tool for packaging and running your application on OSv."
+arch=('i686' 'x86_64')
+url="https://github.com/cloudius-systems/capstan"
+license=('BSD')
+depends=()
+makedepends=('git' 'go')
+provides=("$_pkgname")
+conflicts=("$_pkgname")
+install=
+source=("$_pkgname::git+$url.git")
+noextract=()
+md5sums=('SKIP')
+
+pkgver() {
+ cd "$srcdir/$_pkgname"
+ printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
+}
+
+prepare() {
+ cd "$srcdir/$_pkgname"
+ mkdir -p build/
+}
+
+build() {
+ cd "$srcdir/$_pkgname"
+ 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"
+ go build -o build .
+}
+
+package() {
+ cd "$srcdir/$_pkgname"
+ install -Dm755 build/$_pkgname "$pkgdir"/usr/bin/$_pkgname
+}