Browse Source

Bump package version to 1.0.3

- Properly build package instead of distributing binaries
master
Michael William Le Nguyen 2 years ago
parent
commit
1233146fc3
No known key found for this signature in database GPG Key ID: 3CDDE3F28BC3C4F5
  1. 15
      .SRCINFO
  2. 49
      PKGBUILD
  3. 14
      build.patch
  4. 7
      ci.patch
  5. 13
      version.patch

15
.SRCINFO

@ -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

49
PKGBUILD

@ -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}"
}

14
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

7
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

13
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)
Loading…
Cancel
Save