summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge2020-10-28 17:12:55 +0100
committerDavid Runge2020-10-28 17:12:55 +0100
commit88277c0e0aa6dba6a6c135de77402674700f6f24 (patch)
tree8f1a05d00de61d5ddec2d1c1823b0af2602d7f3e
parentb8ac8210bf6bb44e9d1591d7dc569f2d93da82d9 (diff)
downloadaur-88277c0e0aa6dba6a6c135de77402674700f6f24.tar.gz
Upgrade to 1.19.0
.gitignore: Add package and log files. Add directories. cri-o-1.19.0-pinns_pie.patch: Add patch to add PIE for the pinns executable, by linking it dynamically and adding LDFLAGS. PKGBUILD: Upgrade to 1.19.0. Add all available sodeps in package() and the respective packages to makedepends. Add cni-plugins and conmon to optdepends for networking and monitoring capabilities (respectively). Build from source tarball instead of unverified git checkout. Add service file fixes in prepare(). Add patch for pinns fixes in prepare(). Simplify build() by applying latest go package guidelines. Set PREFIX (containing DESTDIR) and DESTDIR in install target, because the Makefile is very weird. Install docs and examples. Update maintainer info.
-rw-r--r--.SRCINFO19
-rw-r--r--.gitignore9
-rw-r--r--PKGBUILD90
-rw-r--r--cri-o-1.19.0-pinns_pie.patch33
4 files changed, 98 insertions, 53 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2ff3d2af4e66..50bfacd003c7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,29 @@
pkgbase = cri-o
pkgdesc = Open Container Initiative-based implementation of Kubernetes Container Runtime Interface
- pkgver = 1.17.0
+ pkgver = 1.19.0
pkgrel = 1
url = https://github.com/cri-o/cri-o
arch = x86_64
license = Apache
+ makedepends = gpgme
makedepends = go
makedepends = go-md2man
+ makedepends = libseccomp
makedepends = ostree
+ depends = glibc
+ optdepends = cni-plugins: for CNI networking
+ optdepends = conmon: for per-container monitoring
+ options = emptydirs
backup = etc/crio/crio.conf
- source = git+https://github.com/cri-o/cri-o
- sha256sums = SKIP
+ source = cri-o-1.19.0.tar.gz::https://github.com/cri-o/cri-o/archive/v1.19.0.tar.gz
+ source = cri-o-1.19.0-pinns_pie.patch
+ sha512sums = 15b506d755be735d7b71e503b02b309693e3090be41f5790bd34cec460238eab56829239caf18849f3656cf8c12f77a10bbb3ae4ad81eb4e18858946e454583d
+ sha512sums = 1eb382a0a5c273a6ed1df9666ff2b7a83cdb513818f85ca9984da254aecf518580c1b13410715eb73fd1bc7d687a4fd6ef5ae30eb11a1046e422157f117aeb1a
+ b2sums = 8288985392a08fb7fdc58f509d34f8814bf9670386b7aae42be349765cb1f3bd3f4b77077e9c282a4a25b0f99b8a8fc335c6a53053bd2575b3e23c225483a1d3
+ b2sums = 8d77c8060f483c943bd48d9bc2c1d676878e570b29989b7ff733906612b6dff09ed1ffcabc5174175ebc667df897e37e98a8132016bddcb27137661fca2da6dd
pkgname = cri-o
+ depends = glibc
+ depends = libgpgme.so
+ depends = libseccomp.so
diff --git a/.gitignore b/.gitignore
index 2cd833bac0ac..3976ad2deef4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
-src
-pkg
-cri-o
-*pkg.tar.xz
-tags
+*.gz
+*.log
+*.zst
+*/*
diff --git a/PKGBUILD b/PKGBUILD
index 6f2c894e54e8..9c28085ac65b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,58 +1,58 @@
-# Maintainer: Tony Lambiris <tony@libpcap.net>
+# Maintainer: David Runge <dvzrv@archlinux.org>
+# Contributor: Tony Lambiris <tony@libpcap.net>
pkgname=cri-o
-pkgver=1.17.0
+pkgver=1.19.0
pkgrel=1
-pkgdesc='Open Container Initiative-based implementation of Kubernetes Container Runtime Interface'
-arch=(x86_64)
-url='https://github.com/cri-o/cri-o'
-license=(Apache)
-makedepends=(go go-md2man ostree)
+pkgdesc="Open Container Initiative-based implementation of Kubernetes Container Runtime Interface"
+arch=('x86_64')
+url="https://github.com/cri-o/cri-o"
+license=('Apache')
+depends=('glibc')
+makedepends=('gpgme' 'go' 'go-md2man' 'libseccomp' 'ostree')
+optdepends=('cni-plugins: for CNI networking'
+ 'conmon: for per-container monitoring')
backup=('etc/crio/crio.conf')
-source=("git+https://github.com/cri-o/cri-o")
-sha256sums=('SKIP')
+# configuration override and hook directories should exist
+options=('emptydirs')
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/${pkgname}/${pkgname}/archive/v${pkgver}.tar.gz"
+ "${pkgname}-1.19.0-pinns_pie.patch")
+sha512sums=('15b506d755be735d7b71e503b02b309693e3090be41f5790bd34cec460238eab56829239caf18849f3656cf8c12f77a10bbb3ae4ad81eb4e18858946e454583d'
+ '1eb382a0a5c273a6ed1df9666ff2b7a83cdb513818f85ca9984da254aecf518580c1b13410715eb73fd1bc7d687a4fd6ef5ae30eb11a1046e422157f117aeb1a')
+b2sums=('8288985392a08fb7fdc58f509d34f8814bf9670386b7aae42be349765cb1f3bd3f4b77077e9c282a4a25b0f99b8a8fc335c6a53053bd2575b3e23c225483a1d3'
+ '8d77c8060f483c943bd48d9bc2c1d676878e570b29989b7ff733906612b6dff09ed1ffcabc5174175ebc667df897e37e98a8132016bddcb27137661fca2da6dd')
prepare() {
- cd "$srcdir/$pkgname"
-
- git checkout "v$pkgver"
- install -m755 -d "$srcdir/go/src/github.com/cri-o"
-
- ln -sf "$srcdir/$pkgname" "$srcdir/go/src/github.com/cri-o/cri-o"
+ cd "${pkgname}-${pkgver}"
+ # make sure that /usr/bin is used in systemd units
+ sed -e 's|/usr/local|/usr|g' \
+ -i contrib/systemd/*.service
+ # do not statically link pinns and enable PIE
+ patch -Np1 -i "../${pkgname}-1.19.0-pinns_pie.patch"
}
build() {
- cd "$srcdir/go/src/github.com/cri-o/cri-o"
-
- sed -i 's/$(GO) build -i/$(GO) build/' Makefile
- #sed -i 's#../bin/conmon: config.h $(obj) | ../bin#../bin/conmon: $(obj) | config.h ../bin#' conmon/Makefile
-
-
- export GOPATH="${srcdir}/go" PATH="${srcdir}/go/bin:${PATH}"
-
- #make install.tools
- make
-
- ./bin/crio --selinux=true \
- --storage-driver=overlay \
- --conmon /usr/libexec/crio/conmon \
- --cni-plugin-dir /usr/libexec/cni \
- --cgroup-manager=systemd config > crio.conf
+ cd "${pkgname}-${pkgver}"
+ 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"
+
+ make
}
package() {
- cd "${srcdir}/go/src/github.com/cri-o/cri-o"
-
- export GOPATH="${srcdir}/go"
- make install install.systemd PREFIX="${pkgdir}/usr"
-
- install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
-
- # fix-up paths pointing to /usr/local to /usr
- sed -i --follow-symlinks -re 's|/usr/local|/usr|g' "${pkgdir}/usr/lib/systemd/system/"*.service
-
- # install configs
- install -dm755 "${pkgdir}/etc/crio/"
- install -Dm644 "crio.conf" "${pkgdir}/etc/crio/crio.conf"
- #install -Dm644 "seccomp.json" "${pkgdir}/etc/crio/seccomp.json"
+ depends+=('libgpgme.so' 'libseccomp.so')
+ cd "${pkgname}-${pkgver}"
+ # makefile is mixing DESTDIR and PREFIX
+ make install install.systemd DESTDIR="${pkgdir}" PREFIX="${pkgdir}/usr"
+ install -vDm 644 {CONTRIBUTING,README,awesome,code-of-conduct,install,transfer,tutorial}.md \
+ -t "${pkgdir}/usr/share/doc/${pkgname}/"
+ install -vDm 644 tutorials/*.md \
+ -t "${pkgdir}/usr/share/doc/${pkgname}/tutorials/"
+ install -vDm 644 contrib/cni/*.{conf,md} \
+ -t "${pkgdir}/usr/share/doc/${pkgname}/examples/cni/"
+ install -vDm 644 contrib/metrics-exporter/{Containerfile,*.{yaml,gif,json,go}} \
+ -t "${pkgdir}/usr/share/doc/${pkgname}/examples/metrics-exporter/"
}
diff --git a/cri-o-1.19.0-pinns_pie.patch b/cri-o-1.19.0-pinns_pie.patch
new file mode 100644
index 000000000000..7898d1d3e12e
--- /dev/null
+++ b/cri-o-1.19.0-pinns_pie.patch
@@ -0,0 +1,33 @@
+diff -ruN a/Makefile b/Makefile
+--- a/Makefile 2020-09-14 15:46:17.000000000 +0200
++++ b/Makefile 2020-10-28 16:14:38.476052535 +0100
+@@ -157,7 +157,7 @@
+ -x ${SHELLFILES}
+
+ bin/pinns:
+- $(MAKE) -C pinns
++ $(MAKE) -C pinns LDFLAGS=$(LDFLAGS)
+
+ test/copyimg/copyimg: $(GO_FILES) .gopathok
+ $(GO_BUILD) $(GCFLAGS) $(GO_LDFLAGS) -tags "$(BUILDTAGS)" -o $@ $(PROJECT)/test/copyimg
+diff -ruN a/pinns/Makefile b/pinns/Makefile
+--- a/pinns/Makefile 2020-09-14 15:46:17.000000000 +0200
++++ b/pinns/Makefile 2020-10-28 16:24:25.212722369 +0100
+@@ -1,15 +1,15 @@
+ src = $(wildcard src/*.c)
+ obj = $(src:.c=.o)
+
++LDFLAGS ?=
+ STRIP ?= strip
+ override LIBS +=
+ CFLAGS ?= -std=c99 -Os -Wall -Werror -Wextra
+-override CFLAGS += -static
+
+ all: ../bin/pinns
+
+ ../bin/pinns: $(obj) | ../bin
+- $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
++ $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS)
+ $(STRIP) -s $@
+
+ %.o: %.c $(HEADERS)