View | Details | Raw Unified | Return to bug 279003 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/Makefile (+1 lines)
Lines 587-592 Link Here
587
    SUBDIR += kiconvtool
587
    SUBDIR += kiconvtool
588
    SUBDIR += kldfind
588
    SUBDIR += kldfind
589
    SUBDIR += kldpatch
589
    SUBDIR += kldpatch
590
    SUBDIR += kleene-daemon
590
    SUBDIR += kopia
591
    SUBDIR += kopia
591
    SUBDIR += kops
592
    SUBDIR += kops
592
    SUBDIR += kpmcore
593
    SUBDIR += kpmcore
(-)sysutils/kleene-daemon/Makefile (+89 lines)
Added Link Here
1
PORTNAME=	kleene-daemon
2
DISTVERSIONPREFIX=	v
3
DISTVERSION=	0.1.0
4
DISTVERSIONSUFFIX=	-rc.3
5
CATEGORIES=	sysutils
6
7
MASTER_SITES+=	https://builds.hex.pm/installs/1.16.0/:hex
8
DISTFILES+=	hex-${_HEXPM_VERSION}.ez:hex
9
10
MAINTAINER=	lasse@philomath.dk
11
COMMENT=	Kleene backend daemon for managing containers on FreeBSD
12
WWW=		https://kleene.dev
13
14
LICENSE=	APACHE20 BSD2CLAUSE
15
LICENSE_COMB=	multi
16
17
BUILD_DEPENDS=	ca_root_nss>0:security/ca_root_nss \
18
		mix:lang/elixir \
19
		rebar3:devel/rebar3
20
21
USES=		gmake ssl
22
USE_GITHUB=	yes
23
24
GH_ACCOUNT=	kleene-project
25
GH_PROJECT=	kleened
26
USE_RC_SUBR=	kleened
27
28
MAKE_ENV+=	ERL_LIBS='' \
29
		HEX_HOME=${WRKDIR}/.hex \
30
		HEX_OFFLINE=true \
31
		LANG=en_US_UTF-8 \
32
		LC_ALL=en_US.UTF-8 \
33
		MIX_ARCHIVES=${WRKDIR} \
34
		MIX_ENV=prod \
35
		MIX_HOME=${WRKDIR}/.mix \
36
		MIX_PATH=${WRKDIR}/.mix/archives/hex-${_HEXPM_VERSION}/hex-${_HEXPM_VERSION}/ebin \
37
		MIX_REBAR3=${LOCALBASE}/bin/rebar3
38
39
ETCDIR=		${PREFIX}/etc/kleened
40
SUB_FILES=	pkg-message
41
PLIST_SUB=	DISTVERSION=${DISTVERSION}
42
43
_HEXPM_VERSION=		2.1.1
44
_HEX_DIR=		${WRKDIR}/.mix/archives/hex-${_HEXPM_VERSION}
45
_RELEASE_PATH=		${WRKSRC}/_build/prod/rel/kleened
46
_RELEASE_BINARIES=	escript dialyzer erlexec beam.smp heart dyn_erl to_erl \
47
			erlc epmd run_erl typer inet_gethost erl_child_setup \
48
			ct_run erl_call yielding_c_fun
49
50
.include <bsd.port.pre.mk>
51
52
post-extract:
53
	${MKDIR} ${_HEX_DIR}
54
	${MV} ${WRKDIR}/hex-* \
55
		${_HEX_DIR}/
56
57
do-build:
58
	(cd ${WRKSRC} && \
59
		env ${MAKE_ENV} ${LOCALBASE}/bin/mix do deps.compile, compile, \
60
		release)
61
62
do-install:
63
# sample configs
64
	${MKDIR} ${STAGEDIR}${ETCDIR}
65
	${INSTALL_DATA} ${WRKSRC}/example/kleened_config.yaml \
66
		${STAGEDIR}${ETCDIR}/config.yaml.sample
67
	${INSTALL_DATA} ${WRKSRC}/example/pf.conf.kleene \
68
		${STAGEDIR}${ETCDIR}/pf.conf.kleene.sample
69
# the release
70
	${CP} -a ${WRKSRC}/_build/prod/rel/kleened ${STAGEDIR}${PREFIX}/libexec/
71
	${INSTALL_PROGRAM} ${WRKSRC}/priv/bin/kleened_pty \
72
		${STAGEDIR}${PREFIX}/libexec/kleened/bin/
73
	${RM} ${STAGEDIR}${PREFIX}/libexec/kleened/bin/*.src
74
# strip binaries and objects
75
	${FIND} ${STAGEDIR}${PREFIX}/libexec/kleened/lib -type f -name \
76
		*.so -exec ${STRIP_CMD} {} \;
77
.for bin in ${_RELEASE_BINARIES}
78
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/kleened/erts-*/bin/${bin}
79
.endfor
80
81
post-install:
82
	@cd ${STAGEDIR}${PREFIX} && \
83
		${FIND} libexec/kleened/erts-* -type f -o -type l | \
84
		${SORT} >> ${TMPPLIST}
85
	@cd ${STAGEDIR}${PREFIX} && \
86
		${FIND} libexec/kleened/lib/* -type f -o -type l | \
87
		${SORT} >> ${TMPPLIST}
88
89
.include <bsd.port.post.mk>
(-)sysutils/kleene-daemon/distinfo (+5 lines)
Added Link Here
1
TIMESTAMP = 1739714987
2
SHA256 (hex-2.1.1.ez) = 59c163c3e4efe4bdbb7029cd494e30c09b87beebc99359c175960cc4101beada
3
SIZE (hex-2.1.1.ez) = 777696
4
SHA256 (kleene-project-kleened-v0.1.0-rc.3_GH0.tar.gz) = 8b4a0fc1707c542bf9025ad74419c09872df38fe0291dc981fb698630f79fa20
5
SIZE (kleene-project-kleened-v0.1.0-rc.3_GH0.tar.gz) = 5079955
(-)sysutils/kleene-daemon/files/kleened.in (+74 lines)
Added Link Here
1
#!/bin/sh
2
#
3
# PROVIDE: kleened
4
# REQUIRE: LOGIN
5
# KEYWORD: shutdown
6
#
7
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
8
# to enable and configure this service:
9
#
10
# kleened_enable (bool):    Set to NO by default.
11
#                          Set it to YES to enable kleened.
12
# kleened_user (str):      Set to "root" by default.
13
# kleened_config (str):    Path to config file.
14
#                          Default: %%PREFIX%%/etc/kleened/config.yaml
15
# kleened_shutdown_timeout (int): Seconds to wait for graceful shutdown.
16
#                                Default: 60
17
18
. /etc/rc.subr
19
name=kleened
20
rcvar=kleened_enable
21
extra_commands="init dryinit"
22
# kleened_init: Initialize host configuration
23
# kleened_dryinit: Test host configuration without applying changes
24
25
required_files="${kleened_config}"
26
27
command="%%PREFIX%%/libexec/kleened/bin/kleened"
28
pidfile="/var/run/kleened.pid"
29
procname="$(/usr/bin/find %%PREFIX%%/libexec/kleened -name beam.smp)"
30
31
start_cmd="${command} daemon"
32
status_cmd="${command} ping"
33
stop_cmd="kleened_stop"
34
init_cmd="kleened_init"
35
dryinit_cmd="kleened_dryinit"
36
37
load_rc_config $name
38
39
: ${kleened_enable:=no}
40
: ${kleened_user:="root"}
41
: ${kleened_config:="%%ETCDIR%%/config.yaml"}
42
: ${kleened_shutdown_timeout:=60}
43
: ${kleened_env="LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 PATH=%%PREFIX%%/libexec/kleened/bin:${PATH}"}
44
45
kleened_stop()
46
{
47
    echo "Stopping ${name}."
48
    ${command} stop
49
    wait_for_pids ${pidfile} ${kleened_shutdown_timeout}
50
}
51
52
kleened_init()
53
{
54
    echo "Initializing kleened host configuration..."
55
    if %%PREFIX%%/libexec/kleened/bin/kleened eval "Kleened.Core.Config.initialize_host(%{dry_run: false})"; then
56
        echo "Host initialization completed successfully"
57
    else
58
        echo "Host initialization failed"
59
        return 1
60
    fi
61
}
62
63
kleened_dryinit()
64
{
65
    echo "Testing kleened host configuration..."
66
    if %%PREFIX%%/libexec/kleened/bin/kleened eval "Kleened.Core.Config.initialize_host(%{dry_run: true})"; then
67
        echo "Host configuration test completed successfully"
68
    else
69
        echo "Host configuration test failed"
70
        return 1
71
    fi
72
}
73
74
run_rc_command "$1"
(-)sysutils/kleene-daemon/files/pkg-message.in (+33 lines)
Added Link Here
1
[
2
{ type: install
3
  message: <<EOM
4
Kleene is a new tool and should be used for
5
testing and experimentation purposes only.
6
7
To use Kleened, enable it in rc.conf using
8
9
  sysrc kleened_enable=YES
10
11
Kleened requires certain services and kernel modules to be configured in order
12
to work properly. Run
13
14
  service kleened init
15
16
to make Kleened automatically try and configure the host for you.
17
Alternatively, run
18
19
  service kleened dryinit
20
21
to get an overview of what needs to be configured, without actually changing
22
the host.
23
24
NB. The %%ETCDIR%%/config.yaml file should be edited before running
25
    'service kleened init' since some of the parameters are used during host
26
    initialization.
27
28
You can then start Kleened by running:
29
30
  service kleened start
31
EOM
32
}
33
]
(-)sysutils/kleene-daemon/pkg-descr (+3 lines)
Added Link Here
1
Backend daemon for Kleene.
2
3
Kleene is a container management tool for FreeBSD.
(-)sysutils/kleene-daemon/pkg-plist (+27 lines)
Added Link Here
1
@sample %%ETCDIR%%/config.yaml.sample
2
@sample %%ETCDIR%%/pf.conf.kleene.sample
3
libexec/kleened/bin/kleened
4
libexec/kleened/bin/kleened_pty
5
libexec/kleened/releases/%%DISTVERSION%%/consolidated/Elixir.Collectable.beam
6
libexec/kleened/releases/%%DISTVERSION%%/consolidated/Elixir.DBConnection.Query.beam
7
libexec/kleened/releases/%%DISTVERSION%%/consolidated/Elixir.Enumerable.beam
8
libexec/kleened/releases/%%DISTVERSION%%/consolidated/Elixir.IEx.Info.beam
9
libexec/kleened/releases/%%DISTVERSION%%/consolidated/Elixir.Inspect.beam
10
libexec/kleened/releases/%%DISTVERSION%%/consolidated/Elixir.Jason.Encoder.beam
11
libexec/kleened/releases/%%DISTVERSION%%/consolidated/Elixir.List.Chars.beam
12
libexec/kleened/releases/%%DISTVERSION%%/consolidated/Elixir.OpenApiSpex.Extendable.beam
13
libexec/kleened/releases/%%DISTVERSION%%/consolidated/Elixir.Plug.Exception.beam
14
libexec/kleened/releases/%%DISTVERSION%%/consolidated/Elixir.String.Chars.beam
15
libexec/kleened/releases/%%DISTVERSION%%/elixir
16
libexec/kleened/releases/%%DISTVERSION%%/env.sh
17
libexec/kleened/releases/%%DISTVERSION%%/iex
18
libexec/kleened/releases/%%DISTVERSION%%/kleened.rel
19
libexec/kleened/releases/%%DISTVERSION%%/remote.vm.args
20
libexec/kleened/releases/%%DISTVERSION%%/start.boot
21
libexec/kleened/releases/%%DISTVERSION%%/start.script
22
libexec/kleened/releases/%%DISTVERSION%%/start_clean.boot
23
libexec/kleened/releases/%%DISTVERSION%%/start_clean.script
24
libexec/kleened/releases/%%DISTVERSION%%/sys.config
25
libexec/kleened/releases/%%DISTVERSION%%/vm.args
26
libexec/kleened/releases/COOKIE
27
libexec/kleened/releases/start_erl.data

Return to bug 279003