Page MenuHomeFreeBSD

D49018.id151062.diff
No OneTemporary

D49018.id151062.diff

Index: sysutils/Makefile
===================================================================
--- sysutils/Makefile
+++ sysutils/Makefile
@@ -587,6 +587,7 @@
SUBDIR += kiconvtool
SUBDIR += kldfind
SUBDIR += kldpatch
+ SUBDIR += kleene-daemon
SUBDIR += kopia
SUBDIR += kops
SUBDIR += kpmcore
Index: sysutils/kleene-daemon/Makefile
===================================================================
--- /dev/null
+++ sysutils/kleene-daemon/Makefile
@@ -0,0 +1,84 @@
+PORTNAME= kleene-daemon
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.1.0rc2
+CATEGORIES= sysutils
+
+MAINTAINER= lasse@philomath.dk
+COMMENT= Kleene backend daemon for managing containers on FreeBSD
+WWW= https://kleene.dev
+
+LICENSE= BSD2CLAUSE
+
+BUILD_DEPENDS= ${LOCALBASE}/lib/elixir/lib/hex/ebin:devel/elixir-hex \
+ mix:lang/elixir \
+ rebar3:devel/rebar3
+
+USES= gmake ssl
+USE_GITHUB= yes
+
+GH_TUPLE= kleene-project:kleened:6a67380:DEFAULT
+USE_RC_SUBR= kleened
+
+SUB_FILES= pkg-message
+
+ETCDIR= ${PREFIX}/etc/kleened
+
+MIX_TARGET= release
+ELIXIR_LOCALE= en_US.UTF-8
+ELIXIR_APP_NAME= ${PORTNAME}
+MIX_ENV= MIX_REBAR3=${LOCALBASE}/bin/rebar3 \
+ LANG=${ELIXIR_LOCALE} LC_ALL=${ELIXIR_LOCALE} \
+ MIX_PATH=${LOCALBASE}/lib/elixir/lib/hex/ebin \
+ MIX_HOME=mix
+MIX_ENV_NAME= prod
+MIX_COMPILE= ${SETENV} ${MIX_ENV} MIX_ENV=${MIX_ENV_NAME} mix \
+ ${MIX_TARGET}
+
+RELEASE_PATH= ${WRKSRC}/_build/prod/rel/kleened
+RELEASE_BINARIES= escript dialyzer erlexec beam.smp heart dyn_erl to_erl \
+ erlc epmd run_erl typer inet_gethost erl_child_setup \
+ ct_run erl_call yielding_c_fun
+
+.include <bsd.port.pre.mk>
+
+do-build:
+ @cd ${WRKSRC} && ${MIX_COMPILE}
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/etc/kleened
+ ${INSTALL_DATA} ${WRKSRC}/example/kleened_config.yaml \
+ ${STAGEDIR}${PREFIX}/etc/kleened/config.yaml.sample
+ ${INSTALL_DATA} ${WRKSRC}/example/pf.conf.kleene \
+ ${STAGEDIR}${PREFIX}/etc/kleened/pf.conf.kleene.sample
+ ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/kleened/bin
+ ${INSTALL_PROGRAM} ${WRKSRC}/priv/bin/kleened_pty \
+ ${STAGEDIR}${PREFIX}/libexec/kleened/bin/kleened_pty
+ ${INSTALL_SCRIPT} ${WRKSRC}/_build/prod/rel/kleened/bin/kleened \
+ ${STAGEDIR}${PREFIX}/libexec/kleened/bin/
+ cd ${RELEASE_PATH}/lib && \
+ ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/libexec/kleened/lib
+ cd ${RELEASE_PATH} && \
+ ${COPYTREE_SHARE} ./erts-* ${STAGEDIR}${PREFIX}/libexec/kleened/ && \
+ ${CHMOD} +x ${STAGEDIR}${PREFIX}/libexec/kleened/erts-*/bin/*
+ cd ${RELEASE_PATH}/releases && \
+ ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/libexec/kleened/releases
+ cd ${RELEASE_PATH}/releases && \
+ ${INSTALL_DATA} ${WRKSRC}/_build/prod/rel/kleened/releases/start_erl.data ${STAGEDIR}${PREFIX}/libexec/kleened/releases/
+ ${INSTALL_SCRIPT} ${RELEASE_PATH}/releases/0.0.1/elixir \
+ ${STAGEDIR}${PREFIX}/libexec/kleened/releases/0.0.1/
+ ${INSTALL_SCRIPT} ${RELEASE_PATH}/releases/0.0.1/iex \
+ ${STAGEDIR}${PREFIX}/libexec/kleened/releases/0.0.1/
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/kleened/lib/asn1-*/priv/lib/asn1rt_nif.so
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/kleened/lib/crypto-*/priv/lib/*.so
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/kleened/lib/exqlite-0.20.0/priv/sqlite3_nif.so
+.for bin in ${RELEASE_BINARIES}
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/kleened/erts-*/bin/${bin}
+.endfor
+
+post-install:
+ @cd ${STAGEDIR}${PREFIX} && \
+ ${FIND} libexec/kleened/erts-* -type f -o -type l | ${SORT} >> ${TMPPLIST}
+ @cd ${STAGEDIR}${PREFIX} && \
+ ${FIND} libexec/kleened/lib/* -type f -o -type l | ${SORT} >> ${TMPPLIST}
+
+.include <bsd.port.post.mk>
Index: sysutils/kleene-daemon/distinfo
===================================================================
--- /dev/null
+++ sysutils/kleene-daemon/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1720628572
+SHA256 (kleene-project-kleened-v0.1.0rc2-6a67380_GH0.tar.gz) = 1b2c8f859b1453f4a86735094f67eebe3d62713c4ff1bfea4f708f525b87f1ac
+SIZE (kleene-project-kleened-v0.1.0rc2-6a67380_GH0.tar.gz) = 5048873
Index: sysutils/kleene-daemon/files/kleened.in
===================================================================
--- /dev/null
+++ sysutils/kleene-daemon/files/kleened.in
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: kleened
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add this line to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# kleened_enable (bool): Set to NO by default.
+# Set it to YES to enable doormand.
+
+. /etc/rc.subr
+name=kleened
+rcvar=kleened_enable
+extra_commands="init dryinit"
+
+LANG=en_US.UTF-8
+LC_ALL=en_US.UTF-8
+PATH="${PATH}:%%PREFIX%%/libexec/kleened/bin"
+
+command="%%PREFIX%%/libexec/kleened/bin/kleened"
+
+pidfile="/var/run/kleened.pid"
+procname="$(/usr/bin/find %%PREFIX%%/libexec/kleened/erts-* -depth 1 -type d)/beam.smp"
+start_cmd="${command} daemon"
+init_cmd="kleened_init"
+dryinit_cmd="kleened_dryinit"
+
+load_rc_config $name
+: ${kleened_enable:=no}
+
+kleened_init()
+{
+ %%PREFIX%%/libexec/kleened/bin/kleened eval "Kleened.Core.Config.initialize_host(%{dry_run: false})"
+}
+
+kleened_dryinit()
+{
+ %%PREFIX%%/libexec/kleened/bin/kleened eval "Kleened.Core.Config.initialize_host(%{dry_run: true})"
+}
+
+run_rc_command "$1"
Index: sysutils/kleene-daemon/files/pkg-message.in
===================================================================
--- /dev/null
+++ sysutils/kleene-daemon/files/pkg-message.in
@@ -0,0 +1,33 @@
+[
+{ type: install
+ message: <<EOM
+Kleene is a new tool and should be used for
+testing and experimentation purposes only.
+
+To use Kleened, enable it in rc.conf using
+
+ sysrc kleened_enable=YES
+
+Kleened requires certain services and kernel modules to be configured in order
+to work properly. Run
+
+ service kleened init
+
+to make Kleened automatically try and configure the host for you.
+Alternatively, run
+
+ service kleened dryinit
+
+to get an overview of what needs to be configured, without actually changing
+the host.
+
+NB. The %%ETCDIR%%/config.yaml file should be edited before running
+ 'service kleened init' since some of the parameters are used during host
+ initialization.
+
+You can then start Kleened by running:
+
+ service kleened start
+EOM
+}
+]
Index: sysutils/kleene-daemon/pkg-descr
===================================================================
--- /dev/null
+++ sysutils/kleene-daemon/pkg-descr
@@ -0,0 +1,3 @@
+Backend daemon for Kleene.
+
+Kleene is a container management tool for FreeBSD.
Index: sysutils/kleene-daemon/pkg-plist
===================================================================
--- /dev/null
+++ sysutils/kleene-daemon/pkg-plist
@@ -0,0 +1,27 @@
+@sample %%ETCDIR%%/config.yaml.sample
+@sample %%ETCDIR%%/pf.conf.kleene.sample
+libexec/kleened/bin/kleened
+libexec/kleened/bin/kleened_pty
+libexec/kleened/releases/0.0.1/consolidated/Elixir.Collectable.beam
+libexec/kleened/releases/0.0.1/consolidated/Elixir.Enumerable.beam
+libexec/kleened/releases/0.0.1/consolidated/Elixir.IEx.Info.beam
+libexec/kleened/releases/0.0.1/consolidated/Elixir.Inspect.beam
+libexec/kleened/releases/0.0.1/consolidated/Elixir.Jason.Encoder.beam
+libexec/kleened/releases/0.0.1/consolidated/Elixir.List.Chars.beam
+libexec/kleened/releases/0.0.1/consolidated/Elixir.OpenApiSpex.Extendable.beam
+libexec/kleened/releases/0.0.1/consolidated/Elixir.Plug.Exception.beam
+libexec/kleened/releases/0.0.1/consolidated/Elixir.String.Chars.beam
+libexec/kleened/releases/0.0.1/consolidated/Elixir.DBConnection.Query.beam
+libexec/kleened/releases/0.0.1/elixir
+libexec/kleened/releases/0.0.1/env.sh
+libexec/kleened/releases/0.0.1/iex
+libexec/kleened/releases/0.0.1/kleened.rel
+libexec/kleened/releases/0.0.1/remote.vm.args
+libexec/kleened/releases/0.0.1/start.boot
+libexec/kleened/releases/0.0.1/start.script
+libexec/kleened/releases/0.0.1/start_clean.boot
+libexec/kleened/releases/0.0.1/start_clean.script
+libexec/kleened/releases/0.0.1/sys.config
+libexec/kleened/releases/0.0.1/vm.args
+libexec/kleened/releases/COOKIE
+libexec/kleened/releases/start_erl.data

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 21, 6:58 AM (9 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30068397
Default Alt Text
D49018.id151062.diff (7 KB)

Event Timeline