Skip to content

Commit

Permalink
user/cri-o: new package
Browse files Browse the repository at this point in the history
  • Loading branch information
tulilirockz committed Sep 23, 2024
1 parent 057b887 commit be5a5b7
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 0 deletions.
1 change: 1 addition & 0 deletions user/cri-o-recommends
10 changes: 10 additions & 0 deletions user/cri-o/files/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[crio.runtime]
conmon_cgroup = "pod"
cgroup_manager = "cgroupfs"
default_runtime = "crun"

[crio.runtime.runtimes.crun]
monitor_path = "/usr/libexec/podman/conmon"

[crio.runtime.runtimes.runc]
monitor_path = "/usr/libexec/podman/conmon"
4 changes: 4 additions & 0 deletions user/cri-o/files/crio
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type = process
command = /usr/bin/crio
pid-file = /run/crio.pid
depends-on = pre-local.target
2 changes: 2 additions & 0 deletions user/cri-o/files/tmpfiles.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
d /var/lib/crio 0755 root root -
d /var/log/crio 0755 root root -
12 changes: 12 additions & 0 deletions user/cri-o/patches/cni-plugins-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from aports/cri-o/cni-plugins-path.patch

--- a/pkg/config/config_unix.go 2024-09-09 19:22:50.000000000 -0300
+++ b/pkg/config/config_unix.go 2024-09-22 21:08:00.826738793 -0300
@@ -6,7 +6,7 @@
// Defaults for linux/unix if none are specified.
const (
cniConfigDir = "/etc/cni/net.d/"
- cniBinDir = "/opt/cni/bin/"
+ cniBinDir = "/usr/libexec/cni/"
containerExitsDir = "/var/run/crio/exits"
ContainerAttachSocketDir = "/var/run/crio"
33 changes: 33 additions & 0 deletions user/cri-o/patches/install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--- a/Makefile 2024-09-22 21:37:03.576504562 -0300
+++ b/Makefile 2024-09-22 21:49:31.372539262 -0300
@@ -9,12 +9,12 @@
PROJECT := github.com/cri-o/cri-o
CRIO_INSTANCE := crio_dev
PREFIX ?= ${DESTDIR}/usr/local
-BINDIR ?= ${PREFIX}/bin
+BINDIR ?= ${DESTDIR}/usr/bin
LIBEXECDIR ?= ${PREFIX}/libexec
-MANDIR ?= ${PREFIX}/share/man
+MANDIR ?= ${DESTDIR}/usr/share/man
ETCDIR ?= ${DESTDIR}/etc
ETCDIR_CRIO ?= ${ETCDIR}/crio
-DATAROOTDIR ?= ${PREFIX}/share/containers
+DATAROOTDIR ?= ${DESTDIR}/usr/share/containers
BUILDTAGS ?= containers_image_ostree_stub \
$(shell hack/apparmor_tag.sh) \
$(shell hack/btrfs_installed_tag.sh) \
@@ -35,10 +35,10 @@
TESTBIN_PATH := ${BUILD_PATH}/test
MOCK_PATH := ${PWD}/test/mocks

-BASHINSTALLDIR=${PREFIX}/share/bash-completion/completions
-FISHINSTALLDIR=${PREFIX}/share/fish/completions
-ZSHINSTALLDIR=${PREFIX}/share/zsh/site-functions
-OCIUMOUNTINSTALLDIR=$(PREFIX)/share/oci-umount/oci-umount.d
+BASHINSTALLDIR=${DESTDIR}/usr/share/bash-completion/completions
+FISHINSTALLDIR=${DESTDIR}/usr/share/fish/vendor_completions.d
+ZSHINSTALLDIR=${DESTDIR}/usr/share/zsh/site-functions
+OCIUMOUNTINSTALLDIR=${DESTDIR}/usr/share/oci-umount/oci-umount.d

SELINUXOPT ?= $(shell selinuxenabled 2>/dev/null && echo -Z)

12 changes: 12 additions & 0 deletions user/cri-o/patches/no-systemd-install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- a/Makefile 2024-09-09 19:22:50.000000000 -0300
+++ b/Makefile 2024-09-22 21:11:08.522952422 -0300
@@ -259,7 +259,7 @@
-t quay.io/crio/metrics-exporter:latest

.PHONY: install
-install: install.bin install.man install.completions install.systemd install.config ## Install the project locally.
+install: install.bin install.man install.completions install.config ## Install the project locally.

.PHONY: install.bin-nobuild
install.bin-nobuild: ## Install the binaries.

49 changes: 49 additions & 0 deletions user/cri-o/template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
pkgname = "cri-o"
pkgver = "1.31.0"
pkgrel = 0
build_style = "makefile"
make_build_env = {
"BUILDTAGS": "seccomp containers_image_openpgp containers_image_ostree_stub"
}
hostmakedepends = [
"bash",
"go",
"pkgconf",
]
makedepends = [
"gpgme-devel",
"libbtrfs-devel",
"libseccomp-devel",
"linux-headers",
]
depends = ["cni-plugins", "containers-common", "util-linux-ns"]
pkgdesc = "OCI-based implementation of Kubernetes Container Runtime Interface"
maintainer = "tulilirockz <tulilirockz@outlook.com>"
license = "Apache-2.0"
url = "https://cri-o.io"
source = f"https://github.com/cri-o/cri-o/archive/refs/tags/v{pkgver}.tar.gz"
sha256 = "4b7e23f8920b7252132536acf5da66788b339bb05868c20e561a6c09b198c0f6"
# check: depends on networking (fetches a container)
options = ["!check"]


def post_install(self):
self.install_license("LICENSE")
self.install_service(self.files_path / "crio")
self.install_tmpfiles(self.files_path / "tmpfiles.conf")
self.install_file(
self.files_path / "config.toml", "etc/crio/crio.conf.d/99-default.toml"
)
self.install_files("contrib/cni", "usr/share/examples/crio/cni")


@subpackage("cri-o-recommends")
def _(self):
self.depends = [
"crun",
"conmon",
]
self.subdesc = "recommended dependencies"
self.install_if = [self.parent]
self.options = ["empty"]
return []

0 comments on commit be5a5b7

Please sign in to comment.