From 45882652f938cd74cee831abf7e7bab4f8e04ba6 Mon Sep 17 00:00:00 2001 From: Leonid Plyushch Date: Sat, 13 Jul 2019 19:21:43 +0300 Subject: [PATCH] new package: lxc --- root-packages/lxc/build.sh | 17 +++++++++++++++++ root-packages/lxc/src-include-lxcmntent.c.patch | 11 +++++++++++ root-packages/lxc/src-lxc-conf.c.patch | 11 +++++++++++ .../lxc/templates-lxc-download.in.patch | 15 +++++++++++++++ root-packages/lxc/templates-lxc-local.in.patch | 12 ++++++++++++ root-packages/lxc/templates-lxc-oci.patch | 12 ++++++++++++ 6 files changed, 78 insertions(+) create mode 100644 root-packages/lxc/build.sh create mode 100644 root-packages/lxc/src-include-lxcmntent.c.patch create mode 100644 root-packages/lxc/src-lxc-conf.c.patch create mode 100644 root-packages/lxc/templates-lxc-download.in.patch create mode 100644 root-packages/lxc/templates-lxc-local.in.patch create mode 100644 root-packages/lxc/templates-lxc-oci.patch diff --git a/root-packages/lxc/build.sh b/root-packages/lxc/build.sh new file mode 100644 index 000000000..5e195da9c --- /dev/null +++ b/root-packages/lxc/build.sh @@ -0,0 +1,17 @@ +TERMUX_PKG_HOMEPAGE=http://linuxcontainers.org/ +TERMUX_PKG_DESCRIPTION="Linux Containers" +TERMUX_PKG_LICENSE="LGPL-2.1" +TERMUX_PKG_MAINTAINER="Leonid Plyushch " +TERMUX_PKG_VERSION=3.1.0 +TERMUX_PKG_SRCURL=https://linuxcontainers.org/downloads/lxc-$TERMUX_PKG_VERSION.tar.gz +TERMUX_PKG_SHA256=4d8772c25baeaea2c37a954902b88c05d1454c91c887cb6a0997258cfac3fdc5 +TERMUX_PKG_DEPENDS="dirmngr, gnupg, libcap, rsync, wget" + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +--with-distro=termux +--with-runtime-path=$TERMUX_PREFIX/var/run +" + +termux_step_pre_configure() { + export LIBS="-llog" +} diff --git a/root-packages/lxc/src-include-lxcmntent.c.patch b/root-packages/lxc/src-include-lxcmntent.c.patch new file mode 100644 index 000000000..a3c9768fd --- /dev/null +++ b/root-packages/lxc/src-include-lxcmntent.c.patch @@ -0,0 +1,11 @@ +diff -uNr lxc-3.1.0/src/include/lxcmntent.c lxc-3.1.0.mod/src/include/lxcmntent.c +--- lxc-3.1.0/src/include/lxcmntent.c 2018-12-14 01:13:51.000000000 +0200 ++++ lxc-3.1.0.mod/src/include/lxcmntent.c 2019-07-13 19:04:12.908102863 +0300 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include "../lxc/macro.h" + + /* Since the values in a line are separated by spaces, a name cannot diff --git a/root-packages/lxc/src-lxc-conf.c.patch b/root-packages/lxc/src-lxc-conf.c.patch new file mode 100644 index 000000000..8c492d71f --- /dev/null +++ b/root-packages/lxc/src-lxc-conf.c.patch @@ -0,0 +1,11 @@ +diff -uNr lxc-3.1.0/src/lxc/conf.c lxc-3.1.0.mod/src/lxc/conf.c +--- lxc-3.1.0/src/lxc/conf.c 2018-12-14 01:13:51.000000000 +0200 ++++ lxc-3.1.0.mod/src/lxc/conf.c 2019-07-13 19:02:58.727793440 +0300 +@@ -4104,6 +4104,7 @@ + free(conf->init_cmd); + free(conf->init_cwd); + free(conf->unexpanded_config); ++#undef syslog + free(conf->syslog); + lxc_free_networks(&conf->network); + free(conf->lsm_aa_profile); diff --git a/root-packages/lxc/templates-lxc-download.in.patch b/root-packages/lxc/templates-lxc-download.in.patch new file mode 100644 index 000000000..9ac545e00 --- /dev/null +++ b/root-packages/lxc/templates-lxc-download.in.patch @@ -0,0 +1,15 @@ +diff -uNr lxc-3.1.0/templates/lxc-download.in lxc-3.1.0.mod/templates/lxc-download.in +--- lxc-3.1.0/templates/lxc-download.in 2018-12-14 01:13:51.000000000 +0200 ++++ lxc-3.1.0.mod/templates/lxc-download.in 2019-07-13 19:44:31.096490724 +0300 +@@ -312,10 +312,7 @@ + # Trap all exit signals + trap cleanup EXIT HUP INT TERM + +-# /tmp may be mounted in tmpfs or noexec +-if mountpoint -q /tmp; then +- DOWNLOAD_TEMP="${LXC_PATH}" +-fi ++DOWNLOAD_TEMP="${LXC_PATH}" + + if ! command -V mktemp >/dev/null 2>&1; then + DOWNLOAD_TEMP="${DOWNLOAD_TEMP}/tmp/lxc-download.$$" diff --git a/root-packages/lxc/templates-lxc-local.in.patch b/root-packages/lxc/templates-lxc-local.in.patch new file mode 100644 index 000000000..bb8e1881d --- /dev/null +++ b/root-packages/lxc/templates-lxc-local.in.patch @@ -0,0 +1,12 @@ +diff -uNr lxc-3.1.0/templates/lxc-local.in lxc-3.1.0.mod/templates/lxc-local.in +--- lxc-3.1.0/templates/lxc-local.in 2018-12-14 01:13:51.000000000 +0200 ++++ lxc-3.1.0.mod/templates/lxc-local.in 2019-07-13 19:37:11.128180850 +0300 +@@ -146,7 +146,7 @@ + + # Create temporary directory to + if ! command -V mktemp >/dev/null 2>&1; then +- LOCAL_TEMP=/tmp/lxc-local.$$ ++ LOCAL_TEMP=@TERMUX_PREFIX@/tmp/lxc-local.$$ + mkdir -p "${LOCAL_TEMP}" + else + LOCAL_TEMP=$(mktemp -d) diff --git a/root-packages/lxc/templates-lxc-oci.patch b/root-packages/lxc/templates-lxc-oci.patch new file mode 100644 index 000000000..e6e878bc5 --- /dev/null +++ b/root-packages/lxc/templates-lxc-oci.patch @@ -0,0 +1,12 @@ +diff -uNr lxc-3.1.0/templates/lxc-oci.in lxc-3.1.0.mod/templates/lxc-oci.in +--- lxc-3.1.0/templates/lxc-oci.in 2018-12-14 01:13:51.000000000 +0200 ++++ lxc-3.1.0.mod/templates/lxc-oci.in 2019-07-13 19:37:43.884968892 +0300 +@@ -291,7 +291,7 @@ + DOWNLOAD_BASE="${LOCALSTATEDIR}/cache/lxc" + fi + else +- DOWNLOAD_BASE=/tmp ++ DOWNLOAD_BASE=@TERMUX_PREFIX@/tmp + fi + mkdir -p "${DOWNLOAD_BASE}" +