aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2017-06-23 20:10:34 +0100
committerStuart Shelton <stuart@shelton.me>2017-06-23 20:10:34 +0100
commitb33e9e0bd0aff64fa1b6403b44c88f59b5e4312f (patch)
treeefa7db290fbb3916183d230572c8577bb0b326bd /app-emulation
parentUpdate sys-apps/lm_sensors-3.4.0_p20160725 (diff)
downloadsrcshelton-b33e9e0bd0aff64fa1b6403b44c88f59b5e4312f.tar.gz
srcshelton-b33e9e0bd0aff64fa1b6403b44c88f59b5e4312f.tar.bz2
srcshelton-b33e9e0bd0aff64fa1b6403b44c88f59b5e4312f.zip
Add app-emulation/lxc-2.0.7
Diffstat (limited to 'app-emulation')
-rw-r--r--app-emulation/lxc/Manifest6
-rw-r--r--app-emulation/lxc/files/lxc-2.0.5-omit-sysconfig.patch5
-rw-r--r--app-emulation/lxc/files/lxc-2.0.6-bash-completion.patch27
-rw-r--r--app-emulation/lxc/files/lxc.initd.5133
-rw-r--r--app-emulation/lxc/files/lxc_at.service.414
-rw-r--r--app-emulation/lxc/lxc-2.0.7.ebuild205
6 files changed, 390 insertions, 0 deletions
diff --git a/app-emulation/lxc/Manifest b/app-emulation/lxc/Manifest
index 69f6a3db..95467bd0 100644
--- a/app-emulation/lxc/Manifest
+++ b/app-emulation/lxc/Manifest
@@ -1,16 +1,22 @@
AUX lxc-1.0.6-bash-completion.patch 1341 SHA256 ddac7cc033a4029f8264d06978321bb33ef7c4fd34c9a44bb1acaaaf1c85d302 SHA512 56b00f77812c0600a8ff7557ef0acf7f50d37bb9f6e5b3641c9a218a53ac64a59785430d0775c1c7980ac39120a2544fd7c28cf39fefc07e7f1558f88b9b5917 WHIRLPOOL b3ff9a377d7d29fa76b6d547f2d1b1621c5ab52e972a9b52389c269f26ba9f43eae6a414db46135be84f1ed91ebea9d6d24cc25da11f493dc86fee088e90bfb4
AUX lxc-1.0.8-bash-completion.patch 1324 SHA256 efadb125a43665ad60bb80a773fec517d2440cfc848fb9072be9db705378b45e SHA512 0d6293efa1080b568f8f2d64f41406ae6f07109eeb80e3d2a509246fa145c70c4128c4b8c38347b5b7e9bb0a69e2cc11f0c4e8e3ac2b6f74b57836216e5290db WHIRLPOOL 9f7fd01e8befa4e41079030ab55daefd95f7d3023d9aff1630da7d13aed1fca1bb1b6969332e3dcc052d02ece146bd3fdd249f9541d70cbee0668eb6eaaf3261
+AUX lxc-2.0.5-omit-sysconfig.patch 259 SHA256 2dc717dfa8afd2823a38aeb4de72d1594b59d51ce182e71dd41b00109901fdff SHA512 0aed9aca687accc6df79e97f48ab333043256e8ae68c8643f2b2452cc8013191238867d64ec71f7d399c59a43d3ba698b35d965090c5cb149b4f41302432e6e7 WHIRLPOOL 5dbad4a04955c818e010f5229c3d061c841d1d12ad2cd7f585343fb1f5d42362aa37842149399570a0abe45cae0f4be60f3fe8e4281a473e1657edf9da039fe5
+AUX lxc-2.0.6-bash-completion.patch 919 SHA256 44c354c90d85371654d77337c8daeca34c0b22a76a424d67b76e38daa960a1fd SHA512 caa90c8bad2a79b4e42b781f00d6f2a7be37fc5c5301592b026c88db2652c90871be940c86a9156f03bc186f76cf2068a2d3084e9abc7a5896ea081885085d41 WHIRLPOOL caf8b079f994db0a3139b6bc77b50f3510ec7fee91ba902d9f4f562a06e40110eea01c02c4427a85daae480dcce1e4cc352e6e00cf4b200cad3dd758fd573133
AUX lxc.initd.2 3673 SHA256 bb7780168695e934549909c5c7baa7d6cdc92b0e19093a3d04a1313081a832e1 SHA512 25b0474d6f16fcede89a8e17518a658f810cb554eaef10aae3ce1fdd8c8640118aa6375cbee443f0b26e8086eb7c25375ceaaaf29a4110bd779f94b2f4b0d300 WHIRLPOOL 28f56d71b95b26c7f6ad5402a37413a973bc7bdf08fd3963ad192888ae1b49809a56c16009bc6049061d419ecffb1279e153e6ef5acbe06956efca154eae6a01
AUX lxc.initd.3 4396 SHA256 0c78deed28e01f97d95d0aaf88948d16e73be258631b640518ac8edb5060d724 SHA512 f48b0f0c234dbe3f9cc2f834dd663e14f3fbfc29376c4a3b9d2061942f758372f8a9faf615f4396375fa964ab4a60ffbf6f971de5c9f53ae2e224355facfb0b6 WHIRLPOOL bdb5689165d2fafac56db29932120f2e715fc7286a7ee11e5dc1f0c93249b9fad3e7ab2b76369238d6c159f167cbb3c161543e3ace56cc714ebe53977ed89841
+AUX lxc.initd.5 3976 SHA256 dc6a39c70b9a99abc997dd58519b8eef81d73bd6814eb158b0ab622466ab80bd SHA512 bd1106d800155ac2250bcd2509485b0be749f473d40ba33ab36635398ef21b1ce8a8be7cc461936792251e2162fbb16b38411b1dabae7bbab0fed21c02241077 WHIRLPOOL 3f5b15dfc6bb265cc6885790f262d33a557ff9063290958a4b3a3276290c74bff962d552f5bb1d341cfdb161f12ef4c760cfd72d96d14001e6fe8cece3d5c6f2
AUX lxc_at.service 232 SHA256 0aaf2f362b3ac6aa2b427d47ac4436d46387624b0d8bc4850c5d5b6a7d228711 SHA512 4c3bab4f2cc9aea8b0753dcaf2fd7ed5f1cd7d97d286d6204b2fc17505b6edaac2f536bbda5c1466856311d0e93d75de91dec51e9b0f665d67afedbf40c19170 WHIRLPOOL f6928b4b85e63c38295cabc651b7bd61d2b0bc69ff1850de7cfa8a4f40e4894d94264c262fec7d345488cace49c4283f932739313b975f6862c1aa0ef51e0652
+AUX lxc_at.service.4 265 SHA256 194ce2917e99a5050dd793bc31c7d4393f61a9244aaa2f59109eaf8bebfe44fd SHA512 d61e7103e90e6ffb3202533e7d7555d8c02b943f06ec6c0d673713c1c0ede58641312c65d6dd6a15907c1171522e6148c2313d7b11acbd85d59fe65758cd52b3 WHIRLPOOL 55892d9cc5ff8cd8ca95ccae65abbb9735904cf1aba6ea33008349bbe4ea2ac01f83307998e90265b7dd2127761c05199be4f7133f21af1490bda40bf18a2873
DIST lxc-1.0.3.tar.gz 538073 SHA256 9fc4ac60a842058e4ad0fe6a281dc0079ee9830afa1852a10fa044219f2c6412 SHA512 95d7080cdb34776b601959bbc95572b1d6defeaec6820a38d9b09eb05bb43eaa4a2c4d9fae26f4d1a7ee13ad6cd104c36dd5cbe6ee5e44f274135e42370cc983 WHIRLPOOL 99324332f6d1f50dc3c0c9e54a565295b2186183f9e198418a8a891b799befebabf42784eab02988643ee0c1c77389dc0ce9ae28a5da4df42f9eb2749e0b0da4
DIST lxc-1.0.4.tar.gz 548741 SHA256 bcb04752fddc581030727be179a9f65715e11b0a04bf9bb119adb1b2d117bd9a SHA512 ec30e01e2dab393a74b50279981a9bb0e93da2ed2c82b33e218cd1146df20b5443a75ace623c30b6c9718f8a23e4a447484bf316c9155324fe931741d2ed9f06 WHIRLPOOL 2ae27940884bb645674410ff223f80e63b90cda7a4fdf189133ebab91621c0fc95ddb24e439f08ffbf93a3056e32dcc88cdc04ac75d9c4ad8a4779c177845074
DIST lxc-1.0.6.tar.gz 561249 SHA256 2aea199a89e2cd946f93406af6c3f62844f36954b79a6991b36d2c33022cb11c SHA512 fe85ccb57865d86704df6b4b79d60f31892785b07dc9dd2580cc6c384c89c29c23516e906b7a16bc03c6582c1fb2432bb8ff11bd17c09efa8f6a035fb41f46b1 WHIRLPOOL 9e77453fbe31523a2e8f39cfaba6f09fef68d00b54549167a0cde56c00934f827f5b4190b9fb64242f36782a9fcda63e6796c35fd47420870c2cee7b9bc0a1c8
DIST lxc-1.0.7.tar.gz 564985 SHA256 a0b1b09592e076e270dcb3ba004616d9ac3147f9de0b78ca39a30f8956b0a8f2 SHA512 e6ff42a7b41177e1be0d2cd47d4c554565c7fc35355f3aa8aeba00d4adc7a0f364ecd060ddb6c97b2fe5968329c4e4c4b3cb022bffd2da145f30880f077264a8 WHIRLPOOL f07e5e9efb8ff394aa9cdd6c3e725b453c8137ec221399cbf910d57dbc9268fc84e7227273567792821415dc14e774942b76a58a1a478de57d5c82e545702000
DIST lxc-1.0.8.tar.gz 575127 SHA256 399ac3eb4e0a89d657fb2e2a57f686ed061d3f1ea4733e7521b1539e9906c7ee SHA512 f552a4f48bb47d26c6b9ddaf8221a439c0848e3f54ec41b77d54717c21bddd56193941046cc96c699790e8265e762a926469c25ee687adcf7795f2906b1c260a WHIRLPOOL 72cd0b8b0345692dd9a3ed8785ee27f5e575794a96c515db1f1d073c29be4c06ae8c1ee24fa375a5ede2bba2494704916710b2e8814ed991d43330a40dff3d56
+DIST lxc-2.0.7.tar.gz 792557 SHA256 e74ee4a61a8ff426051ce86664f85b028052dd5664cc8e4cf710205c75ded356 SHA512 eb48dc800ce43d2f4d46e0cecc4d0a714b3e22c6a4975776b54d17d1d20d5a1411e6b605215282f1f77286ddf22b61c80b86b83752191fc18023894ef7a1c44d WHIRLPOOL 81da3116450a7c41c7aa4de95e0094a56e6dee29ef2a111bfe87a61d9b7b97846f77984ec4b9b45aaf776a2c8103b5957c129f6d05b9ebf46455450129653502
EBUILD lxc-1.0.3.ebuild 5663 SHA256 fc8f781c81355a752453cd7db5491619395aa897070ef07a7b67bd8790574080 SHA512 090b12f3465535653b140237a5191af26158e63b855dfcc5f3f789c683b52ccec9188bab378cf3b47f8901370d920a581b828665efa1fc2a4451d932798c4901 WHIRLPOOL bf9ec6858a14934796ab32d3279198ceedd2d57faa6311f4ea2e19412a4c2d91c9e2e7e482f63c626262d93ab79d9d1e3c14ec9f14b75f1e3d8bd8cbfd590b19
EBUILD lxc-1.0.4.ebuild 5662 SHA256 83ba9709b7e7ef752f985054eba5d02f0b41455f58a7bc76e7911226a7ff265c SHA512 e8554f0a259d61b3a30de07136f2e993f64f7c4561c3cbdf37c7f071ebf6f700301e16491df7fc10a74f7362909ad56b1359af38d67f3703cf832d9a8d6dca85 WHIRLPOOL f66a876ed5677c30fae13baabdf3f02a18fcd553cfcf62ad2c704da0a3eb806329462e96a5a10bc0c88aca593aa6d123ef55266142cc03d7184e175210064962
EBUILD lxc-1.0.6-r1.ebuild 6083 SHA256 1c89e3141086102c05e132c63bdd586e133976d7e2e5094e9993d7c4e34337c1 SHA512 01f5bc713baa000b1c1bf38c9bd1208278599a6c87c1e1097ca6df30cc7fbcce311076e20b959137e4fcfcc9cb71b0ab20e6dc94f6f1c85bc492ba9c67a19103 WHIRLPOOL 72ab2d5727e12a419f927cafa5c18dfdb8bf5817d26681138150c0b3ac96d2cfff5e7d1c4f5b246c8c71a779b5530ca8c81c92aae0030f7e940cf51774ce3632
EBUILD lxc-1.0.6.ebuild 5561 SHA256 65aa27cdb736a89935c8a0ebbd0e7719e891b1c76e6b227de498c417aea9a47f SHA512 9621cbc3c0acf923561ee2327a97c6a680f0e1b510cd5dc87721d951c4e3c7b264db09037c0f5216bf6036a30cba9e42c8f3ec831cd7d913be3dbbf615f62b4b WHIRLPOOL 02ea59945f0950087b64b806135f3a2414b36b384efa90a3502400334117a0d5e040db2d036086489165ce313c681bc6e273280c44cce4a44499c4fd1d59f9fd
EBUILD lxc-1.0.7.ebuild 6146 SHA256 bfedf2d4f14ad0d5eb7d7df4443f486f311dcfdee06fd54a9fe3e0f6295fa78b SHA512 d6bbd27b20f031d123fa23eea2e11b31b532c6ac50237ae3e44a38773177e6427dc99feab33e5b35acbe1e0923e5be094261f37752694f0810eb17e69ac9ecf8 WHIRLPOOL 94015432b335c9441492ab63f4281b7f9b67bcba8d01dfcb3a9617863362796bb54f25f38d46e231714017acafe7fce62f472dbd9e6ae9ae70f8b124ecb02f05
EBUILD lxc-1.0.8.ebuild 6146 SHA256 3a412236c8171ec8f9f71cebf1cbc2efbb6ff3ffe297e9d372d8b2e07e96062e SHA512 b03c8698a17c625dc8569f3a075a4ef4dee7200896b883f2f6db006b4ff46b9b840d89d76381231fa1037773f842bfdaa7b8b48032e14e79d0432444075c714f WHIRLPOOL 1a43d8377267c83a7dca0fd448e123ee6549b201f925bdce425728f454b5ff2db1851cbb0f71e8c75739efd10dd8ee43f045353f4320e9e49ce9031639791f5c
+EBUILD lxc-2.0.7.ebuild 6526 SHA256 30e7cc3a5a9e438fb376952420e3668212f8bcb1c3ae41b4c50d000a5561c9bb SHA512 b812dd56e88e545f04513cf28830b45167dac7d9267b382133ecab174f5ff127f3ccca1cdb55f9c49d0f426c15a268a132a26e0c1b1645c173b1476b2e9d1712 WHIRLPOOL 987d0a4d6e2e146e69c5629cd4751e5d868e1ca352c7067ff77852ddaf5f11edd4e708e5bbdf13d0a769ebe033fe86a139d0c6cb15d53108f35a73a39951b340
diff --git a/app-emulation/lxc/files/lxc-2.0.5-omit-sysconfig.patch b/app-emulation/lxc/files/lxc-2.0.5-omit-sysconfig.patch
new file mode 100644
index 00000000..3ec81356
--- /dev/null
+++ b/app-emulation/lxc/files/lxc-2.0.5-omit-sysconfig.patch
@@ -0,0 +1,5 @@
+--- /config/Makefile.am.orig 2016-05-19 02:56:11.891113982 +0000
++++ /config/Makefile.am 2016-05-19 02:56:32.596115476 +0000
+@@ -1 +1 @@
+-SUBDIRS = apparmor bash etc init selinux templates yum sysconfig
++SUBDIRS = apparmor bash etc init selinux templates yum
diff --git a/app-emulation/lxc/files/lxc-2.0.6-bash-completion.patch b/app-emulation/lxc/files/lxc-2.0.6-bash-completion.patch
new file mode 100644
index 00000000..6033e36c
--- /dev/null
+++ b/app-emulation/lxc/files/lxc-2.0.6-bash-completion.patch
@@ -0,0 +1,27 @@
+diff --git a/config/bash/lxc.in b/config/bash/lxc.in
+index 7dcf302..5927fe2 100644
+--- a/config/bash/lxc.in
++++ b/config/bash/lxc.in
+@@ -1,4 +1,3 @@
+-_have lxc-start && {
+ _lxc_names() {
+ COMPREPLY=( $( compgen -W "$( lxc-ls )" "$cur" ) )
+ }
+@@ -100,4 +99,3 @@ _have lxc-start && {
+
+ complete -o default -F _lxc_generic_o lxc-copy
+ complete -o default -F _lxc_generic_o lxc-start-ephemeral
+-}
+diff --git a/configure.ac b/configure.ac
+index 4640c0d..14ccdd3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -478,7 +478,7 @@ AM_CONDITIONAL([ENABLE_BASH], [test "x$enable_bash" = "xyes"])
+ AM_COND_IF([ENABLE_BASH],
+ [AC_MSG_CHECKING([bash completion directory])
+ PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], ,
+- bashcompdir="${sysconfdir}/bash_completion.d")
++ bashcompdir="$datadir/bash-completion/completions")
+ AC_MSG_RESULT([$bashcompdir])
+ AC_SUBST(bashcompdir)
+ ])
diff --git a/app-emulation/lxc/files/lxc.initd.5 b/app-emulation/lxc/files/lxc.initd.5
new file mode 100644
index 00000000..c206f697
--- /dev/null
+++ b/app-emulation/lxc/files/lxc.initd.5
@@ -0,0 +1,133 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+CONTAINER=${SVCNAME#*.}
+
+lxc_get_configfile() {
+ local container="${CONTAINER}"
+
+ if [ "${container}" = "${SVCNAME}" ]; then
+ container="default"
+ fi
+
+ LXC_PATH="$( readlink -e "$( lxc-config lxc.lxcpath 2>/dev/null || echo '/var/lib' )" )"
+ if [ -d "/etc/lxc" ] && [ -f "/etc/lxc/${container}.conf" -o -f "/etc/lxc/${container}/config" ]; then
+ #ewarn "Legacy LXC configuration directory '/etc/lxc' found - please migrate your"
+ #ewarn "configuration files to '${LXC_PATH}'"
+ LXC_PATH="/etc/lxc"
+ elif [ -d "${LXC_PATH}/lxc" ] && [ -f "${LXC_PATH}/lxc/${container}.conf" -o -f "${LXC_PATH}/lxc/${container}/config" ]; then
+ LXC_PATH="${LXC_PATH}/lxc"
+ fi
+ #einfo >&2 "Using '${LXC_PATH}' as LXC configuration directory"
+
+ if [ -f "${LXC_PATH}/${container}.conf" ]; then
+ echo "${LXC_PATH}/${container}.conf"
+ elif [ -f "${LXC_PATH}/${container}/config" ]; then
+ echo "${LXC_PATH}/${container}/config"
+ else
+ eerror "lxc is unable to find a suitable configuration file."
+ eerror "If you set up the '${container}' container in a"
+ eerror "non-standard location, please set the CONFIGFILE"
+ eerror "variable."
+ return 1
+ fi
+}
+
+[ "${CONTAINER}" != "${SVCNAME}" ] && CONFIGFILE=${CONFIGFILE:-$(lxc_get_configfile)}
+
+lxc_get_var() {
+ awk 'BEGIN { FS="[ \t]*=[ \t]*" } $1 == "'$1'" { print $2; exit }' ${CONFIGFILE}
+}
+
+lxc_get_net_link_type() {
+ awk 'BEGIN { FS="[ \t]*=[ \t]*"; _link=""; _type="" }
+ $1 == "lxc.network.type" {_type=$2;}
+ $1 == "lxc.network.link" {_link=$2;}
+ {if(_link != "" && _type != ""){
+ printf("%s:%s\n", _link, _type );
+ _link=""; _type="";
+ }; }' <${CONFIGFILE}
+}
+
+checkconfig() {
+ if [ "${CONTAINER}" = "${SVCNAME}" ]; then
+ eerror "You have to create an init script for each container:"
+ eerror " ln -s lxc /etc/init.d/lxc.container"
+ return 1
+ fi
+
+ # no need to output anything, the function takes care of that.
+ [ -z "${CONFIGFILE}" ] && return 1
+
+ utsname=$(lxc_get_var lxc.utsname)
+ if [ "${CONTAINER}" != "${utsname}" ]; then
+ eerror "You should use the same name for the service and the"
+ eerror "container. Right now the container is called '${utsname}'"
+ return 1
+ fi
+}
+
+depend() {
+ # be quiet, since we have to run depend() also for the
+ # non-muxed init script, unfortunately.
+ checkconfig 2>/dev/null || return 0
+
+ config ${CONFIGFILE}
+ need localmount
+ use lxcfs
+
+ local _x _if
+ for _x in $(lxc_get_net_link_type); do
+ _if=${_x%:*}
+ case "${_x##*:}" in
+ # when the network type is set to phys, we can make use of a
+ # network service (for instance to set it up before we disable
+ # the net_admin capability), but we might also not set it up
+ # at all on the host and leave the net_admin capable service
+ # to take care of it.
+ phys) use net.${_if} ;;
+ *) need net.${_if} ;;
+ esac
+ done
+}
+
+start() {
+ checkconfig || return 1
+ rm /var/log/lxc/${CONTAINER}.log
+
+ rootpath=$(lxc_get_var lxc.rootfs)
+
+ # Check the format of our init and the chroot's init, to see
+ # if we have to use linux32 or linux64; always use setarch
+ # when required, as that makes it easier to deal with
+ # x32-based containers.
+ case $(scanelf -BF '%a#f' ${rootpath}/sbin/init) in
+ EM_X86_64) setarch=linux64;;
+ EM_386) setarch=linux32;;
+ esac
+
+ ebegin "Starting ${CONTAINER}"
+ env -i ${setarch} $(type -p lxc-start) -l WARN -n ${CONTAINER} -f ${CONFIGFILE} -d -o /var/log/lxc/${CONTAINER}.log
+ sleep 0.5
+
+ # lxc-start -d will _always_ report a correct startup, even if it
+ # failed, so rather than trust that, check that the cgroup exists.
+ [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]
+ eend $?
+}
+
+stop() {
+ checkconfig || return 1
+
+
+ if ! [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]; then
+ ewarn "${CONTAINER} doesn't seem to be started."
+ return 0
+ fi
+
+ # 10s should be enough to shut everything down
+ ebegin "Stopping ${CONTAINER}"
+ lxc-stop -t 10 -n ${CONTAINER}
+ eend $?
+}
diff --git a/app-emulation/lxc/files/lxc_at.service.4 b/app-emulation/lxc/files/lxc_at.service.4
new file mode 100644
index 00000000..64ae7457
--- /dev/null
+++ b/app-emulation/lxc/files/lxc_at.service.4
@@ -0,0 +1,14 @@
+[Unit]
+Description=Linux Container %I
+After=network.target
+Wants=lxcfs.service
+
+[Service]
+Restart=always
+ExecStart=/usr/bin/lxc-start -n %i -F
+ExecReload=/usr/bin/lxc-restart -n %i
+ExecStop=/usr/bin/lxc-stop -n %i
+Delegate=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-emulation/lxc/lxc-2.0.7.ebuild b/app-emulation/lxc/lxc-2.0.7.ebuild
new file mode 100644
index 00000000..8fb32cbd
--- /dev/null
+++ b/app-emulation/lxc/lxc-2.0.7.ebuild
@@ -0,0 +1,205 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+MY_P="${P/_/-}"
+PYTHON_COMPAT=( python{3_4,3_5} )
+DISTUTILS_OPTIONAL=1
+
+inherit autotools bash-completion-r1 distutils-r1 linux-info versionator flag-o-matic systemd
+
+DESCRIPTION="LinuX Containers userspace utilities"
+HOMEPAGE="https://linuxcontainers.org/"
+SRC_URI="https://github.com/lxc/lxc/archive/${MY_P}.tar.gz"
+
+KEYWORDS="amd64 ~arm ~arm64"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE="cgmanager doc examples lua python seccomp systemd"
+
+RDEPEND="net-libs/gnutls
+ sys-libs/libcap
+ cgmanager? ( app-admin/cgmanager )
+ lua? ( >=dev-lang/lua-5.1:= )
+ python? ( ${PYTHON_DEPS} )
+ seccomp? ( sys-libs/libseccomp )"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-sgml-utils )
+ >=sys-kernel/linux-headers-3.2"
+
+RDEPEND="${RDEPEND}
+ sys-process/criu
+ sys-apps/util-linux
+ app-misc/pax-utils
+ virtual/awk"
+
+CONFIG_CHECK="~CGROUPS ~CGROUP_DEVICE
+ ~CPUSETS ~CGROUP_CPUACCT
+ ~CGROUP_SCHED
+
+ ~NAMESPACES
+ ~IPC_NS ~USER_NS ~PID_NS
+
+ ~NETLINK_DIAG ~PACKET_DIAG
+ ~INET_UDP_DIAG ~INET_TCP_DIAG
+ ~UNIX_DIAG ~CHECKPOINT_RESTORE
+
+ ~CGROUP_FREEZER
+ ~UTS_NS ~NET_NS
+ ~VETH ~MACVLAN
+
+ ~POSIX_MQUEUE
+ ~!NETPRIO_CGROUP
+
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+ ~!GRKERNSEC_PROC
+ ~!GRKERNSEC_SYSFS_RESTRICT
+"
+
+ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
+
+ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
+
+ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
+ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
+
+ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking"
+ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
+
+ERROR_NETLINK_DIAG="CONFIG_NETLINK_DIAG: needed for lxc-checkpoint"
+ERROR_PACKET_DIAG="CONFIG_PACKET_DIAG: needed for lxc-checkpoint"
+ERROR_INET_UDP_DIAG="CONFIG_INET_UDP_DIAG: needed for lxc-checkpoint"
+ERROR_INET_TCP_DIAG="CONFIG_INET_TCP_DIAG: needed for lxc-checkpoint"
+ERROR_UNIX_DIAG="CONFIG_UNIX_DIAG: needed for lxc-checkpoint"
+ERROR_CHECKPOINT_RESTORE="CONFIG_CHECKPOINT_RESTORE: needed for lxc-checkpoint"
+
+ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command"
+
+ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP: as of kernel 3.3 and lxc 0.8.0_rc1 this causes LXCs to fail booting."
+
+ERROR_GRKERNSEC_CHROOT_MOUNT="CONFIG_GRKERNSEC_CHROOT_MOUNT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_DOUBLE="CONFIG_GRKERNSEC_CHROOT_DOUBLE: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS: some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_PROC="CONFIG_GRKERNSEC_PROC: this GRSEC feature is incompatible with unprivileged containers"
+ERROR_GRKERNSEC_SYSFS_RESTRICT="CONFIG_GRKERNSEC_SYSFS_RESTRICT: this GRSEC feature is incompatible with unprivileged containers"
+
+DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
+
+S="${WORKDIR}/${PN}-${MY_P}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_setup() {
+ kernel_is -lt 4 7 && CONFIG_CHECK="${CONFIG_CHECK} ~DEVPTS_MULTIPLE_INSTANCES"
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ eapply "${FILESDIR}"/${PN}-2.0.6-bash-completion.patch
+ #558854
+ eapply "${FILESDIR}"/${PN}-2.0.5-omit-sysconfig.patch
+ eapply_user
+ eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+
+ if use python; then
+ #541932
+ python_setup "python3*"
+ export PKG_CONFIG_PATH="${T}/${EPYTHON}/pkgconfig:${PKG_CONFIG_PATH}"
+ fi
+
+ # I am not sure about the --with-rootfs-path
+ # /var/lib/lxc is probably more appropriate than
+ # /usr/lib/lxc.
+ econf \
+ --localstatedir=/var \
+ --bindir=/usr/bin \
+ --sbindir=/usr/bin \
+ --with-config-path=/etc/lxc \
+ --with-rootfs-path=/var/lib/lxc/rootfs \
+ --with-distro=gentoo \
+ --with-runtime-path=/var/run \
+ --disable-apparmor \
+ --disable-werror \
+ $(use_enable cgmanager) \
+ $(use_enable doc) \
+ $(use_enable examples) \
+ $(use_enable lua) \
+ $(use_enable python) \
+ $(use_enable seccomp)
+}
+
+python_compile() {
+ distutils-r1_python_compile build_ext -I ../ -L ../${PN}
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ pushd "${S}/src/python-${PN}" > /dev/null
+ distutils-r1_src_compile
+ popd > /dev/null
+ fi
+}
+
+src_install() {
+ default
+
+ mv "${ED}"/usr/share/bash-completion/completions/${PN} "${ED}"/$(get_bashcompdir)/${PN}-start || die
+ # start-ephemeral is no longer a command but removing it here
+ # generates QA warnings (still in upstream completion script)
+ bashcomp_alias ${PN}-start \
+ ${PN}-{attach,cgroup,copy,console,create,destroy,device,execute,freeze,info,monitor,snapshot,start-ephemeral,stop,unfreeze,wait}
+
+ if use python; then
+ pushd "${S}/src/python-lxc" > /dev/null
+ # Unset DOCS. This has been handled by the default target
+ unset DOCS
+ distutils-r1_src_install
+ popd > /dev/null
+ fi
+
+ keepdir /etc/lxc /var/lib/lxc/rootfs /var/log/lxc
+
+ find "${D}" -name '*.la' -delete
+
+ # Gentoo-specific additions!
+ newinitd "${FILESDIR}/${PN}.initd.5" ${PN}
+
+ # Remember to compare our systemd unit file with the upstream one
+ # config/init/systemd/lxc.service.in
+ use systemd && systemd_newunit "${FILESDIR}"/${PN}_at.service.4 "lxc@.service"
+}
+
+pkg_postinst() {
+ elog
+ elog "Starting from version ${PN}-1.1.0-r3, the upstream default lxc"
+ elog "path §has been moved from /etc/lxc to /var/lib/lxc."
+ elog "However, this particular package restores /etc/lxc as the default"
+ elog "configuration path has been restored to /etc/lxc."
+ elog "If you still want to use /var/lib/lxc please add the following to"
+ elog "your /etc/lxc/default.conf"
+ elog
+ elog " lxc.lxcpath = /var/lib/lxc"
+ elog
+ elog "There is an init script provided with the package now; no documentation"
+ elog "is currently available though, so please check out /etc/init.d/lxc ."
+ elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname"
+ elog "to start the container defined into /etc/lxc/configname.conf ."
+ elog "For further information about LXC development see"
+ elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available
+ elog
+}