diff --git a/sysutils/ioc/Makefile b/sysutils/ioc/Makefile new file mode 100644 index 000000000000..8aaad39d55b8 --- /dev/null +++ b/sysutils/ioc/Makefile @@ -0,0 +1,39 @@ +# $FreeBSD$ + +PORTNAME= ioc +PORTVERSION= 0.8.2 +CATEGORIES= sysutils + +MAINTAINER= stefan@gronke.net +COMMENT= Jail management CLI using libioc + +LICENSE= BSD2CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE.txt + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}click>0:devel/py-click@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}libioc>0:devel/py-libioc@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}texttable>0:textproc/py-texttable@${PY_FLAVOR} + +USES= python:3.6+ + +USE_GITHUB= yes +GH_ACCOUNT= bsdci +GH_PROJECT= ioc + +NO_ARCH= yes +NO_BUILD= yes + +USE_RC_SUBR= ioc + +post-patch: + @${REINPLACE_CMD} -e "s#LIB_DIR =.*#LIB_DIR = \"${PREFIX}/lib/ioc\"#" ${WRKSRC}/bin/ioc + +pre-install: + @${MKDIR} ${STAGEDIR}${PREFIX}/lib/ioc + +do-install: + ${INSTALL_SCRIPT} ${WRKSRC}/rc.d/ioc ${STAGEDIR}${PREFIX}/etc/rc.d + ${INSTALL_SCRIPT} ${WRKSRC}/bin/ioc ${STAGEDIR}${PREFIX}/bin + (cd ${WRKSRC}/ && ${COPYTREE_SHARE} ioc_cli ${STAGEDIR}${PREFIX}/lib/ioc) + +.include diff --git a/sysutils/ioc/distinfo b/sysutils/ioc/distinfo new file mode 100644 index 000000000000..a857d4296d4f --- /dev/null +++ b/sysutils/ioc/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1565256009 +SHA256 (bsdci-ioc-0.8.2_GH0.tar.gz) = 75f70f770f8f552bcc9d0dc50a1bbfcc5e8cf0faab4be41f108bdb70b2ea6dd8 +SIZE (bsdci-ioc-0.8.2_GH0.tar.gz) = 31262 diff --git a/sysutils/ioc/files/ioc.in b/sysutils/ioc/files/ioc.in new file mode 100644 index 000000000000..1f243988deb2 --- /dev/null +++ b/sysutils/ioc/files/ioc.in @@ -0,0 +1,65 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: ioc +# REQUIRE: LOGIN cleanvar sshd ZFS +# BEFORE: securelevel +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable ioc start on boot: +# +# ioc_enable="YES" +# + +. /etc/rc.subr + +name="ioc" +rcvar=ioc_enable + +# read configuration and set defaults +load_rc_config "$name" +: ${ioc_enable="NO"} +: ${ioc_lang="en_US.UTF-8"} + +start_cmd="ioc_start" +stop_cmd="ioc_stop" +status_cmd="ioc_status" +extra_commands="status" +export LANG=$ioc_lang + +[ $# -ne 1 ] && rc_usage $_keywords + +ioc_start() +{ + if checkyesno ${rcvar}; then + echo "* [ioc] starting jails... " + %%PREFIX%%/bin/ioc start --rc + fi +} + +ioc_stop() +{ + if checkyesno ${rcvar}; then + echo "* [ioc] stopping jails... " + %%PREFIX%%/bin/ioc stop --rc + fi +} + +ioc_status() +{ + if checkyesno ${rcvar}; then + echo -n "* [ioc] checking jails status..." + test -z "$(%%PREFIX%%/bin/ioc list boot=yes running=no template=no,- --no-header --output=name --output-format=list)" + status=$? + if test ${status} -eq 0; then + echo " OK" + else + echo " Failed!" + fi + exit $status + fi +} + +run_rc_command "$1" diff --git a/sysutils/ioc/pkg-descr b/sysutils/ioc/pkg-descr new file mode 100644 index 000000000000..07bdb6b2e25a --- /dev/null +++ b/sysutils/ioc/pkg-descr @@ -0,0 +1,3 @@ +Jail management CLI using libioc (compatible with iocage/iocell) + +WWW: https://github.com/bsdci/ioc diff --git a/sysutils/ioc/pkg-plist b/sysutils/ioc/pkg-plist new file mode 100644 index 000000000000..eb4ced477a85 --- /dev/null +++ b/sysutils/ioc/pkg-plist @@ -0,0 +1,30 @@ +bin/ioc +lib/ioc/ioc_cli/__init__.py +lib/ioc/ioc_cli/activate.py +lib/ioc/ioc_cli/clone.py +lib/ioc/ioc_cli/console.py +lib/ioc/ioc_cli/create.py +lib/ioc/ioc_cli/deactivate.py +lib/ioc/ioc_cli/destroy.py +lib/ioc/ioc_cli/exec.py +lib/ioc/ioc_cli/export.py +lib/ioc/ioc_cli/fetch.py +lib/ioc/ioc_cli/fstab.py +lib/ioc/ioc_cli/get.py +lib/ioc/ioc_cli/import.py +lib/ioc/ioc_cli/list.py +lib/ioc/ioc_cli/migrate.py +lib/ioc/ioc_cli/pkg.py +lib/ioc/ioc_cli/promote.py +lib/ioc/ioc_cli/provision.py +lib/ioc/ioc_cli/rename.py +lib/ioc/ioc_cli/restart.py +lib/ioc/ioc_cli/set.py +lib/ioc/ioc_cli/shared/__init__.py +lib/ioc/ioc_cli/shared/click.py +lib/ioc/ioc_cli/shared/jail.py +lib/ioc/ioc_cli/shared/output.py +lib/ioc/ioc_cli/snapshot.py +lib/ioc/ioc_cli/start.py +lib/ioc/ioc_cli/stop.py +lib/ioc/ioc_cli/update.py