summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorml2020-08-09 21:42:55 +0200
committerml2020-08-09 21:42:55 +0200
commita1c40f04f4361d761b7f4b02371deebfef113cf3 (patch)
treedf8148121dca722683aeeb164623b51f0d22b062
downloadaur-a1c40f04f4361d761b7f4b02371deebfef113cf3.tar.gz
newpkg: etcdadm 0.1.3-1
-rw-r--r--.SRCINFO15
-rw-r--r--.gitignore6
-rw-r--r--PKGBUILD45
3 files changed, 66 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..cf80fb7cf38
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = etcdadm
+ pkgdesc = Commandline tool for operating an etcd cluster
+ pkgver = 0.1.3
+ pkgrel = 1
+ url = https://github.com/kubernetes-sigs/etcdadm
+ arch = x86_64
+ license = Apache
+ makedepends = git
+ makedepends = go
+ depends = glibc
+ source = https://github.com/kubernetes-sigs/etcdadm/archive/v0.1.3/etcdadm-0.1.3.tar.gz
+ sha256sums = 0c2ae4401c6fe1c85d672e6f991c7e178ec7625ae2da27cf889174d1c7953e14
+
+pkgname = etcdadm
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..f1ecb611e6e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+/pkg/
+/src/
+/*.log
+/*.tar.gz
+/*.pkg.tar*
+/*.src.tar*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..36ffa49dd1c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: ml <ml@visu.li>
+pkgname=etcdadm
+pkgver=0.1.3
+pkgrel=1
+pkgdesc='Commandline tool for operating an etcd cluster'
+arch=('x86_64')
+url='https://github.com/kubernetes-sigs/etcdadm'
+license=('Apache')
+depends=('glibc')
+makedepends=('git' 'go')
+source=("$url/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
+sha256sums=('0c2ae4401c6fe1c85d672e6f991c7e178ec7625ae2da27cf889174d1c7953e14')
+
+prepare() {
+ cd "$pkgname-$pkgver"
+ go mod download
+}
+
+build() {
+ local _commit='' _ver=${pkgver%.?}
+ _commit=$(bsdcat "$pkgname-$pkgver.tar.gz" | git get-tar-commit-id)
+
+ local -a _x=(
+ buildDate="$(TZ=UTC printf '%(%FT%T)TZ' "$SOURCE_DATE_EPOCH")"
+ gitCommit="${_commit:?}"
+ gitTreeState="clean"
+ gitVersion="v$pkgver"
+ gitMajor="${_ver%.?}"
+ gitMinor="${_ver#?.}"
+ )
+ cd "$pkgname-$pkgver"
+ export CGO_ENABLED=1
+ export CGO_LDFLAGS="$LDFLAGS"
+ export CGO_CFLAGS="$CFLAGS"
+ export CGO_CPPFLAGS="$CPPFLAGS"
+ export CGO_CXXFLAGS="$CXXFLAGS"
+ export GOFLAGS='-buildmode=pie -trimpath -modcacherw -mod=readonly'
+ go build -o "$pkgname" -ldflags "${_x[*]/#/-X=k8s.io/component-base/version.}"
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ install -Dm755 "$pkgname" -t "$pkgdir/usr/bin"
+ install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
+}