diff options
author | Michael William Le Nguyen | 2020-01-25 15:00:46 -0500 |
---|---|---|
committer | Michael William Le Nguyen | 2020-01-25 15:00:46 -0500 |
commit | 1233146fc3cf7c49d831648ab62ad00dd7e924c4 (patch) | |
tree | 6e7eda09cbc2a4d5bc65af1f8d66f7ab6ad567d3 | |
parent | 1ebd1d7ac7d790e653913514e27fe951c40d74c6 (diff) | |
download | aur-1233146fc3cf7c49d831648ab62ad00dd7e924c4.tar.gz |
Bump package version to 1.0.3
- Properly build package instead of distributing binaries
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | PKGBUILD | 49 | ||||
-rw-r--r-- | build.patch | 14 | ||||
-rw-r--r-- | ci.patch | 7 | ||||
-rw-r--r-- | version.patch | 13 |
5 files changed, 86 insertions, 12 deletions
@@ -1,13 +1,20 @@ pkgbase = rke pkgdesc = An extremely simple, lightning fast Kubernetes installer that works everywhere. - pkgver = 0.2.6 + pkgver = 1.0.3 pkgrel = 1 url = https://github.com/rancher/rke arch = x86_64 license = apache - noextract = rke-0.2.6 - source = rke-0.2.6::https://github.com/rancher/rke/releases/download/v0.2.6/rke_linux-amd64 - sha256sums = 7699e0fd3428c37c1683395c566931da0182317f5bde9084812dadc5dcae5619 + makedepends = git + makedepends = go>=1.11 + source = rke-1.0.3::git+https://github.com/rancher/rke#tag=v1.0.3 + source = build.patch + source = ci.patch + source = version.patch + sha512sums = SKIP + sha512sums = cf18becc521bedafb13658d15e2a7ab8f847e375f4b4f6326320f587a11c657af6b4acd2d13e5fe885138a6c337336ed3d18001b6deb54425f96cfe6862d0331 + sha512sums = 097d6211104ac7772d6f96c792902f690513b6e780a686c3fdda32ef66c6dd530c7c97a575fd380c4c627e8f7c1192cd877c1512d07a118ff1ad005a2f0cc14b + sha512sums = e586996e0acc0736116cd6bd085c5bfa01bb67bf73a99fc9dcddb0c56597485a78612456dd1bcf2d8d97e54cef3b61429df4874877c88fa24b1944a04093f6f4 pkgname = rke @@ -1,20 +1,53 @@ # Maintainer: Michael William Le Nguyen <michael at mail dot ttp dot codes> pkgname=rke -pkgver=0.2.6 +pkgver=1.0.3 pkgrel=1 pkgdesc="An extremely simple, lightning fast Kubernetes installer that works everywhere." arch=('x86_64') url="https://github.com/rancher/rke" license=('apache') -source=( - "rke-${pkgver}::https://github.com/rancher/rke/releases/download/v${pkgver}/rke_linux-amd64" + +makedepends=( + "git" + # Cannot be built with go-pie due to rke's build flags. + "go>=1.11" ) -noextract=( - "rke-${pkgver}" +source=( + "rke-${pkgver}::git+https://github.com/rancher/rke#tag=v${pkgver}" + "build.patch" + "ci.patch" + "version.patch" ) -sha256sums=( - "7699e0fd3428c37c1683395c566931da0182317f5bde9084812dadc5dcae5619" +sha512sums=( + "SKIP" + "cf18becc521bedafb13658d15e2a7ab8f847e375f4b4f6326320f587a11c657af6b4acd2d13e5fe885138a6c337336ed3d18001b6deb54425f96cfe6862d0331" + "097d6211104ac7772d6f96c792902f690513b6e780a686c3fdda32ef66c6dd530c7c97a575fd380c4c627e8f7c1192cd877c1512d07a118ff1ad005a2f0cc14b" + "e586996e0acc0736116cd6bd085c5bfa01bb67bf73a99fc9dcddb0c56597485a78612456dd1bcf2d8d97e54cef3b61429df4874877c88fa24b1944a04093f6f4" ) + +prepare () { + cd "${pkgname}-${pkgver}" + patch --forward --strip=1 --input="${srcdir}/build.patch" + patch --forward --strip=1 --input="${srcdir}/ci.patch" + patch --forward --strip=1 --input="${srcdir}/version.patch" +} +build () { + export GOPATH="${srcdir}/go" + cd "${pkgname}-${pkgver}" + ./scripts/entry build +} +check () { + export GOPATH="${srcdir}/go" + export PATH="$PATH:${srcdir}/go/bin" + go get -u golang.org/x/lint/golint + cd "${pkgname}-${pkgver}" + ./scripts/entry test + ./scripts/entry validate + # Integration tests not run due to requiring a ton of kernel modules just to test locally. +} package() { - install -D -m755 "rke-${pkgver}" "${pkgdir}/usr/bin/${pkgname}" + export GOPATH="${srcdir}/go" + # *sigh*: https://github.com/golang/go/issues/27455 + go clean -modcache + install -D -m755 "${srcdir}/${pkgname}-${pkgver}/bin/rke" "${pkgdir}/usr/bin/${pkgname}" } diff --git a/build.patch b/build.patch new file mode 100644 index 000000000000..340a5fe15707 --- /dev/null +++ b/build.patch @@ -0,0 +1,14 @@ +--- rke-1.0.2/scripts/build 2020-01-25 14:38:29.922569136 -0500 ++++ rke-1.0.2-patches/scripts/build 2020-01-25 14:38:59.085902963 -0500 +@@ -10,8 +10,9 @@ + OS_ARCH_ARG_DARWIN="amd64" + + mkdir -p bin +-[ "$(uname)" != "Darwin" ] && LINKFLAGS="-extldflags -static -s" +-CGO_ENABLED=0 go build -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/rke ++# https://wiki.archlinux.org/index.php/Go_package_guidelines#Flags_and_build_options ++[ "$(uname)" != "Darwin" ] && LINKFLAGS="-extldflags '-static -s $LDFLAGS'" ++CGO_ENABLED=0 go build -trimpath -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/rke + + if [ -n "$CROSS" ]; then + rm -rf build/bin diff --git a/ci.patch b/ci.patch new file mode 100644 index 000000000000..440f4f4a4a08 --- /dev/null +++ b/ci.patch @@ -0,0 +1,7 @@ +--- rke-1.0.2/scripts/ci 2020-01-19 12:20:08.090024014 -0500 ++++ rke-1.0.2-patch/scripts/ci 2020-01-19 12:41:06.750027535 -0500 +@@ -7,4 +7,3 @@ + ./test + ./validate + ./integration +-./package diff --git a/version.patch b/version.patch new file mode 100644 index 000000000000..c8519f9fefb6 --- /dev/null +++ b/version.patch @@ -0,0 +1,13 @@ +--- rke-1.0.2/scripts/version 2020-01-19 13:26:04.053368662 -0500 ++++ rke-1.0.2-patch/scripts/version 2020-01-19 13:25:33.360035246 -0500 +@@ -1,7 +1,9 @@ + #!/bin/bash + + if [ -n "$(git status --porcelain --untracked-files=no)" ]; then +- DIRTY="-dirty" ++ # Ignore the fact git is dirty to properly version the binary. ++ # DIRTY="-dirty" ++ true + fi + + COMMIT=$(git rev-parse --short HEAD) |