summaryrefslogtreecommitdiff
path: root/app-containers
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-01-19 17:59:37 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-01-19 17:59:37 +0000
commit150a86a9cb006b4800d6517d58532b8a556fec1e (patch)
tree0cea769c7bef669c4dfe19e7805593f6f34033fb /app-containers
parent1cb0dd91756f77b25d6cc22318dc85187ed084cb (diff)
gentoo auto-resync : 19:01:2023 - 17:59:37
Diffstat (limited to 'app-containers')
-rw-r--r--app-containers/Manifest.gzbin7546 -> 7546 bytes
-rw-r--r--app-containers/lxc/Manifest3
-rw-r--r--app-containers/lxc/lxc-5.0.2.ebuild168
-rw-r--r--app-containers/lxd/Manifest4
-rw-r--r--app-containers/lxd/files/lxd-5.0.2-remove-shellcheck-buildsystem-checks.patch32
-rw-r--r--app-containers/lxd/lxd-5.0.2.ebuild204
6 files changed, 411 insertions, 0 deletions
diff --git a/app-containers/Manifest.gz b/app-containers/Manifest.gz
index d72c03365452..d55756551ed0 100644
--- a/app-containers/Manifest.gz
+++ b/app-containers/Manifest.gz
Binary files differ
diff --git a/app-containers/lxc/Manifest b/app-containers/lxc/Manifest
index 2aadc7709a64..d3fa45d4a6b1 100644
--- a/app-containers/lxc/Manifest
+++ b/app-containers/lxc/Manifest
@@ -7,5 +7,8 @@ AUX lxc.service-5.0.0 527 BLAKE2B 44d1fca919615c1acb672baa7b77bd43680975782683ad
AUX lxc_at.service.5.0.0 395 BLAKE2B b4a329964041a9b3017df80aedb73f296d60e0b78097c72e52b921de939246a45d07591535d3971458cee38bf4ddf84021af3f325bffac6db9ba7c4c78a48a5b SHA512 d896c2eb889b83a77041fcd51604bea11db65b8b494c9c063a72ed182006577ed49e2e2c0842353de4676b3fc1246508e5b7c669d797929818cccf485282d85c
DIST lxc-5.0.1.tar.gz 973206 BLAKE2B 6d5cb1a03eb2612d0f8cb59783a64ec42bedd560cacfebf76383d9599dfc153e381f0e584a1c8c9a0b5b18a46bfb01863649dc5a019546e9ded6079b5ec69ddd SHA512 c87563b556aec83c93a7c62932217791e92da950cc76983f0d5e1d603fe1ae298a63fb5e88ec9ef5173846d579babb5acd0836679b915de00844bb9edf9c8d7e
DIST lxc-5.0.1.tar.gz.asc 833 BLAKE2B f85df5fc5bd88a738042f622ee4191b99e0a8e07db7ceb5824d634bc451f4bf93c8b64d1c72d4899f639ad30bbc9ee82be292dbe310218fa20566ee00f9bb752 SHA512 09de4e74d174b54cf9240ca4ef4793b9f63355c65f610abffb40e6dc2dc9130380761a50725e4dcee39b421e4b51c874d141fe22d5ecfd7ad3af35f7ebec09a0
+DIST lxc-5.0.2.tar.gz 973977 BLAKE2B e6017406b96f53525b576528814922a017a7d65fb04724046236307f4e85219b3c8ac725678e57ae3f77a4e817f718748e8c61fbc8147160e4ac87d3146b6567 SHA512 2e8800875e9c91cc0cbfdfc33c43d84bad9471d8a1b8ccd52d7d9c6fe44f280f9f701b8ccc2e0f5319a3e4c50d8c4331722f0dd9c0347575eb4f7b4ed110bef3
+DIST lxc-5.0.2.tar.gz.asc 833 BLAKE2B 3d78f8a87b2f45d2b91a9a6595d286e2fc1dcfc7d28f3c1d86e968860a7e346506ab28d4dafffede8acf1f82e8b12f90eda2e6210cd6bdec702f59bad97295c6 SHA512 9bd1ef117cf256841b75d409e8f14b88ed54fdfc9c8c472b6baa5e9695e39cdb8c1f47ce612dc8263abb65511df0812554cc9a5820cdd6c1539a07283a4cd08f
EBUILD lxc-5.0.1-r2.ebuild 5105 BLAKE2B f80036ccb5f6ad7b86e5de580a6a96bf5f3880c5068d1a1a32eb5c94ac6626c5be807fd188b8a0e2a3f23b29eb6bd232d6ecd5a608319c09f3c9511976b4127b SHA512 5d8779db5c85fc845a1439b15dce838633a8de3eade737cb70d0fb678970bd7c3e04a565bb07a3f6eca46ad809079e14e69508826a4fdc2a2dec4050d9f869fc
+EBUILD lxc-5.0.2.ebuild 5059 BLAKE2B a06441cf8bf1c9558953a1ae243b508c507fa7699d7f9852c85e7a146fb601c97c86ccbac8f13ca315fd5695ebd23a6a5682401528882d8d7658920bf575bda9 SHA512 285bf62b5bb405db85957cee8d1e7d490a26570f67abc855df86c081faf5be24ad4b81b32c92aa5f1b9f286cb7deadc654ac933cc3de547350af02a1ea90026b
MISC metadata.xml 720 BLAKE2B b34cfe10fc45695ec1222335a166da834b2a5e9bb03c76b1ec174af7a6bdb23c5d0969c5d298e73c839df24aa156a6979bc643842a4608bdfff6052fba9908c1 SHA512 0f2948ca809aec73de20658710bdd5a6ce42188e39a37ea59a08379719dbfbaab3012b1ccbfa07e856fae76c8adb061ddab7bda4c05dfbf143f9bd3e0a20e800
diff --git a/app-containers/lxc/lxc-5.0.2.ebuild b/app-containers/lxc/lxc-5.0.2.ebuild
new file mode 100644
index 000000000000..ee16591feeae
--- /dev/null
+++ b/app-containers/lxc/lxc-5.0.2.ebuild
@@ -0,0 +1,168 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 linux-info meson optfeature systemd toolchain-funcs verify-sig
+
+DESCRIPTION="A userspace interface for the Linux kernel containment features"
+HOMEPAGE="https://linuxcontainers.org/ https://github.com/lxc/lxc"
+SRC_URI="https://linuxcontainers.org/downloads/lxc/${P}.tar.gz
+ verify-sig? ( https://linuxcontainers.org/downloads/lxc/${P}.tar.gz.asc )"
+
+LICENSE="GPL-2 LGPL-2.1 LGPL-3"
+SLOT="0/1.502" # SONAME liblxc.so.1 + ${PV//./} _if_ breaking ABI change while bumping.
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="apparmor +caps examples io-uring lto man pam seccomp selinux ssl systemd test +tools"
+
+RDEPEND="acct-group/lxc
+ acct-user/lxc
+ apparmor? ( sys-libs/libapparmor )
+ caps? ( sys-libs/libcap[static-libs] )
+ io-uring? ( >=sys-libs/liburing-2:= )
+ pam? ( sys-libs/pam )
+ seccomp? ( sys-libs/libseccomp )
+ selinux? ( sys-libs/libselinux )
+ ssl? ( dev-libs/openssl:0= )
+ systemd? ( sys-apps/systemd:= )
+ tools? ( sys-libs/libcap[static-libs] )"
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers"
+BDEPEND="virtual/pkgconfig
+ man? ( app-text/docbook2X )
+ verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )"
+
+RESTRICT="!test? ( test )"
+
+CONFIG_CHECK="~!NETPRIO_CGROUP
+ ~CGROUPS
+ ~CGROUP_CPUACCT
+ ~CGROUP_DEVICE
+ ~CGROUP_FREEZER
+
+ ~CGROUP_SCHED
+ ~CPUSETS
+ ~IPC_NS
+ ~MACVLAN
+
+ ~MEMCG
+ ~NAMESPACES
+ ~NET_NS
+ ~PID_NS
+
+ ~POSIX_MQUEUE
+ ~USER_NS
+ ~UTS_NS
+ ~VETH"
+
+ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
+ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
+ERROR_MEMCG="CONFIG_MEMCG: needed for memory resource control in containers"
+ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
+ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command"
+ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
+ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/linuxcontainers.asc
+
+DOCS=( AUTHORS CONTRIBUTING MAINTAINERS README.md doc/FAQ.txt )
+
+pkg_setup() {
+ linux-info_pkg_setup
+}
+
+src_configure() {
+ local emesonargs=(
+ --localstatedir "${EPREFIX}/var"
+
+ -Dcoverity-build=false
+ -Doss-fuzz=false
+
+ -Dcommands=true
+ -Dmemfd-rexec=true
+ -Dthread-safety=true
+
+ $(meson_use apparmor)
+ $(meson_use caps capabilities)
+ $(meson_use examples)
+ $(meson_use io-uring io-uring-event-loop)
+ $(meson_use lto b_lto)
+ $(meson_use man)
+ $(meson_use pam pam-cgroup)
+ $(meson_use seccomp)
+ $(meson_use selinux)
+ $(meson_use ssl openssl)
+ $(meson_use test tests)
+ $(meson_use tools)
+
+ -Ddata-path=/var/lib/lxc
+ -Ddoc-path=/usr/share/doc/${PF}
+ -Dlog-path=/var/log/lxc
+ -Drootfs-mount-path=/var/lib/lxc/rootfs
+ -Druntime-path=/run
+ )
+
+ if use systemd; then
+ local emesonargs+=( -Dinit-script="systemd" )
+ local emesonargs+=( -Dsd-bus=enabled )
+ else
+ local emesonargs+=( -Dinit-script="sysvinit" )
+ local emesonargs+=( -Dsd-bus=disabled )
+ fi
+
+ use tools && local emesonargs+=( -Dcapabilities=true )
+
+ if $(tc-ld-is-gold) || $(tc-ld-is-lld); then
+ local emesonargs+=( -Db_lto_mode=thin )
+ else
+ local emesonargs+=( -Db_lto_mode=default )
+ fi
+
+ meson_src_configure
+}
+
+src_install() {
+ meson_src_install
+
+ # The main bash-completion file will collide with lxd, need to relocate and update symlinks.
+ mkdir -p "${ED}"/$(get_bashcompdir) || die "Failed to create bashcompdir."
+
+ if use tools; then
+ bashcomp_alias lxc-start lxc-{attach,autostart,cgroup,checkpoint,config,console,copy,create,destroy,device,execute,freeze,info,ls,monitor,snapshot,stop,top,unfreeze,unshare,usernsexec,wait}
+ else
+ bashcomp_alias lxc-start lxc-usernsexec
+ fi
+
+ keepdir /var/lib/cache/lxc /var/lib/lib/lxc
+
+ find "${ED}" -name '*.la' -delete -o -name '*.a' -delete || die
+
+ # Replace upstream sysvinit/systemd files.
+ if use systemd; then
+ rm -r "${D}$(systemd_get_systemunitdir)" || die "Failed to remove systemd lib dir"
+ else
+ rm "${ED}"/etc/init.d/lxc-{containers,net} || die "Failed to remove sysvinit scripts"
+ fi
+
+ newinitd "${FILESDIR}/${PN}.initd.8" ${PN}
+ systemd_newunit "${FILESDIR}"/lxc-monitord.service.5.0.0 lxc-monitord.service
+ systemd_newunit "${FILESDIR}"/lxc-net.service.5.0.0 lxc-net.service
+ systemd_newunit "${FILESDIR}"/lxc.service-5.0.0 lxc.service
+ systemd_newunit "${FILESDIR}"/lxc_at.service.5.0.0 "lxc@.service"
+
+ if ! use apparmor; then
+ sed -i '/lxc-apparmor-load/d' "${D}$(systemd_get_systemunitdir)/lxc.service" || die "Failed to remove apparmor references from lxc.service systemd unit."
+ fi
+}
+
+pkg_postinst() {
+ elog "Please refer to "
+ elog "https://wiki.gentoo.org/wiki/LXC for introduction and usage guide."
+ elog
+ elog "Run 'lxc-checkconfig' to see optional kernel features."
+ elog
+
+ optfeature "automatic template scripts" app-containers/lxc-templates
+ optfeature "Debian-based distribution container image support" dev-util/debootstrap
+ optfeature "snapshot & restore functionality" sys-process/criu
+}
diff --git a/app-containers/lxd/Manifest b/app-containers/lxd/Manifest
index abe06f944d73..67a5eb7efafb 100644
--- a/app-containers/lxd/Manifest
+++ b/app-containers/lxd/Manifest
@@ -4,11 +4,15 @@ AUX lxd-4.0.9-r1.service 612 BLAKE2B e44029b6f615afc0daf8abfccd7d2e472291d9b1f85
AUX lxd-4.0.9.initd 1333 BLAKE2B 72a27d38527b4f0dcca3b111ae0d112bd128cf83ff6261561c5a3bf1c619a2e36672b5eb06ff643660d3cee05a545991ed565be257a56452cbd498a202e1b197 SHA512 933a09e72dbf3bbab8e2148549b6bc08ac0caf2088bd44c3e378ac6041fa861845bfae351c83fcd0920655ceb29ea6ca8023163c52a2fb7499c9bf2958d4dc86
AUX lxd-5.0.2-fix-btrfs-driver-to-support-btrfs-6.0.patch 1169 BLAKE2B a590a4f958270509fa2787837992f5a0c16e689713fea13f15c120902a822b6e662b1658cabc4ba4b4c0d1d9fe5feab73a077f2ac751383e9408c436bbc599b1 SHA512 0fb90748070d8376e62af3dec5ae793b0b6e8c678c226eafce014e978a4e16c4fbcb30a1a98ce8ca1b67436ca603f0531522da1905fbbb79824222a3241806a5
AUX lxd-5.0.2-r1.initd 1710 BLAKE2B a9597d32e88502f521f3ae784e4f653ab6d3ab144537b27f5e9b84eb36e5688b13d74968c865153d6e442f77a67b5794fb429705bea8b40cdef00768102de55b SHA512 73ea4aaee39061565524a378b9317bee4b850f0c28ae3f8a47e905b9dffc4452e71736880391bb74b88ea70bda12874699a1eff56400ac9d7949738f3aa3ebce
+AUX lxd-5.0.2-remove-shellcheck-buildsystem-checks.patch 1059 BLAKE2B 2f75a4825584bfb864702f6d5b7023850ca19601014a0f594c2909b892c94b355013eac32d430caf7600e3fdc85fe5140d1e01bd6c26d3cb80df52ccf5cb3ee2 SHA512 026847b13dee7b92e718ea4c6697483d115cc452a9f129acedf7aa8df78f9f67c2b9ff72bec959560d1baabce9d5cf8c9b791fbd5b829cca18a488e8572e6872
AUX lxd-containers-4.0.0.service 322 BLAKE2B a38cffd4b5809946abdac858564dcab2c2967c295d671df0d315d790df1849e25f0bc052e20cd0d9e4c23403289050b4538f5a52437ab8ae9ca3b40c6a9a1571 SHA512 a55f2c1a367c5c3c5eb6880e01893977de18c6e9463949236ee3247715fbf53641bbe1b69404362dd6cb6ba2a30ac6539fd362b21059e529dc4dac4ec5ca6718
DIST lxd-5.0.1.tar.gz 14640923 BLAKE2B 81bdf3301c0eecc719864cd8e18fd886113f83d1980e13ee4d4ccb6641ee4a7e33f0b859a21abd8a0a9956d1c2f3dfa6e7eb1ae454fbb580c23b5558ef51168e SHA512 b04b7329bdeb17ca384cc2d931a1510d5f03521fd247eab93904bbcb6139cc0daf28f9aeb6416268ccf15affdd15b26598f3e280fb5eefe5c59be6918f092bed
DIST lxd-5.0.1.tar.gz.asc 833 BLAKE2B d233c8ebfb5b71f66ff08b4d74861a42bf45ef3e9622d4f113603a7a6c1a29b5aa3422c075ad5250a7d5ab7526a49dd676672d0a73194024af477fa762e02b12 SHA512 bf22f26b6688420e843e9e24eb731a2068eae3d90c77787e0f4a279d4cb7a8a2df38b7e9c8ea79f604c1d54743238cb36474baf018ea6bf72e6f37838b252294
DIST lxd-5.0.2-move-shellcheck-version-call-into-static-analysis.patch 882 BLAKE2B 4c4cb8b19709939c0c14ed87e5d9c917ac967471400de07c14ea049c0a8aae9a2ed0e3755d554cb1077ee7c607fcdc71431d57a55becd0a46c1f177bc9b33aed SHA512 266788186ca9aabda4ad0fe5fa47ef3acfa31bee64c742c011c58a39f4da833f768e8bb71ec81b57af8d4f124d733f2c22ab33f9ee1bc4ecbd21f5bbbae1f6e7
+DIST lxd-5.0.2.tar.gz 16258766 BLAKE2B a0d4e3108664724c064fb8c16031ff7dfa3f49735c81290c78fca1dd8c95774e8d8faf131a9de0961a51fb3f1fb1e3a1219d325e6c440dc42d077bfb6550df0b SHA512 e44b210828251ef2bbdcca332f605294a9258572a52a8e94f5c8dcf8d5c2b3d4cdaf46f85236d9c963de5654d3a0437b5f177ea908a6dac3b5b03fb721be6eaa
+DIST lxd-5.0.2.tar.gz.asc 833 BLAKE2B 606cae1439148060acd3fb04fdb108654a351ce2b7484081f7874ab2b0af8de2b5befc5a5409a94af0da25308622234db2e3b411edb20324df458fe85f46ac21 SHA512 884c921a263a8baf2d94958c72e232a0a47d0747f5a9d36ed8fc270edfa18dfc240d1e858e75dcc03eae921dae08d3ddfd34d9146d1510de6a09031da26aaccc
DIST lxd-5.8-add-tcp-keepalives-to-exec-channels.patch 15702 BLAKE2B ee834b86284e36f87ad3e54df04eb2968dc0fefdf81b116bd640e611ac4ca2eb93763ed2c2f3cfd1e9473da1a3e66bd90858eb4bab08a47f86306a0903a19e6e SHA512 5e7c56f5ffbc8cecb27c6916abbbf4bb3d268c0936b9fdb2b80b4b306c911bdcf782059290243988feb49c9209e55de9ea168ea7041636bf9ae1b7d88ff541c9
EBUILD lxd-5.0.1-r2.ebuild 5268 BLAKE2B b0d0d8601fe9dfda083f98078aa404e04cc4c82098583bc3b8bcee76b4f46f1eadd097a05ffb62111ab929a42f3af2377de9302f3acaeeca5056d85ef460715f SHA512 540ef775bc0558a59dad52220d1f8d9de6f0dd4aa57eff7e18beefefc2263651d9edf5fb0e993d724b4e03145f0250efa074cfb11d0e5e9997dcd5b968a2997c
EBUILD lxd-5.0.1-r5.ebuild 6235 BLAKE2B 95efb03e4ad618bd92d6a22311a135a9a096bb0742a15a3191254620f05604ae5e10fddc97883e06d6dabfa4972fa62899751e23a98f53d3235733f37ddd2ec2 SHA512 6d39152adabe406e568d39e6a3d696e4d3f554d66b063a4827f596ebc6e034f346a086faaedbc6de7a3e7a94c01b9d412533e81e1d5f1671e2fb75074ba52d61
+EBUILD lxd-5.0.2.ebuild 5735 BLAKE2B efd35039e5b0663cf5b1bfa8d6d46d8072d9f60c3719dd8797fa5eb1640c0717493da343b43013623d27e0f74f33b11142a7e3f345b015c094a76c94ee8e2bb5 SHA512 e247131eddcd3d866f67e28978f02ea6fd19280e3a7913afddc7f57a49e36e199ae8faef5bcecd739c632a203077e412aeb640408380a4c82bb97f950261d000
MISC metadata.xml 1403 BLAKE2B 4bff140bc9282b41631293b9cc28a5f85bec2b0f923c762c6572e75b752aba113632747142bd3b3a87322ce8d2ba10fd15afe3f1a7c1384e49c408ca176f267d SHA512 38fb2faa661a8473d0221117299baea01c06f46e5fbf5bd7e32f26b7d0a433ab35c5e0e5dde42c7478b7118489d619fdacca29b3a9b0e89cf432c5bccd3ffba3
diff --git a/app-containers/lxd/files/lxd-5.0.2-remove-shellcheck-buildsystem-checks.patch b/app-containers/lxd/files/lxd-5.0.2-remove-shellcheck-buildsystem-checks.patch
new file mode 100644
index 000000000000..a8e457387ee6
--- /dev/null
+++ b/app-containers/lxd/files/lxd-5.0.2-remove-shellcheck-buildsystem-checks.patch
@@ -0,0 +1,32 @@
+diff -Naur a/Makefile b/Makefile
+--- a/Makefile 2023-01-16 21:10:45.000000000 -0000
++++ b/Makefile 2023-01-19 14:52:28.488204725 -0000
+@@ -248,28 +248,6 @@
+ .PHONY: build-mo
+ build-mo: $(MOFILES)
+
+-.PHONY: static-analysis
+-static-analysis:
+-ifeq ($(shell command -v golangci-lint 2> /dev/null),)
+- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2
+-endif
+-ifeq ($(shell command -v shellcheck 2> /dev/null),)
+- echo "Please install shellcheck"
+- exit 1
+-endif
+-ifneq "$(shell shellcheck --version | grep version: | cut -d ' ' -f2)" "0.8.0"
+- @echo "WARN: shellcheck version is not 0.8.0"
+-endif
+-ifeq ($(shell command -v flake8 2> /dev/null),)
+- echo "Please install flake8"
+- exit 1
+-endif
+- golangci-lint run --timeout 5m
+- flake8 test/deps/import-busybox
+- shellcheck --shell sh test/*.sh test/includes/*.sh test/suites/*.sh test/backends/*.sh test/lint/*.sh
+- shellcheck test/extras/*.sh
+- run-parts --regex '.sh' test/lint
+-
+ .PHONY: tags
+ tags: *.go lxd/*.go shared/*.go lxc/*.go
+ find . -type f -name '*.go' | xargs gotags > tags
diff --git a/app-containers/lxd/lxd-5.0.2.ebuild b/app-containers/lxd/lxd-5.0.2.ebuild
new file mode 100644
index 000000000000..4ce69e48b15f
--- /dev/null
+++ b/app-containers/lxd/lxd-5.0.2.ebuild
@@ -0,0 +1,204 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 go-module linux-info optfeature systemd verify-sig
+
+DESCRIPTION="Modern, secure and powerful system container and virtual machine manager"
+HOMEPAGE="https://linuxcontainers.org/lxd/introduction/ https://github.com/lxc/lxd"
+SRC_URI="https://linuxcontainers.org/downloads/lxd/${P}.tar.gz
+ verify-sig? ( https://linuxcontainers.org/downloads/lxd/${P}.tar.gz.asc )"
+
+LICENSE="Apache-2.0 BSD LGPL-3 MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="apparmor nls"
+
+DEPEND="acct-group/lxd
+ app-arch/xz-utils
+ >=app-containers/lxc-5.0.0:=[apparmor?,seccomp(+)]
+ dev-db/sqlite:3
+ >=dev-libs/dqlite-1.13.0:=
+ dev-libs/lzo
+ >=dev-libs/raft-0.17.1:=[lz4]
+ >=dev-util/xdelta-3.0[lzma(+)]
+ net-dns/dnsmasq[dhcp,ipv6(+)]
+ sys-libs/libcap
+ virtual/udev"
+RDEPEND="${DEPEND}
+ net-firewall/ebtables
+ net-firewall/iptables[ipv6(+)]
+ sys-apps/iproute2[ipv6(+)]
+ sys-fs/fuse:*
+ >=sys-fs/lxcfs-5.0.0
+ sys-fs/squashfs-tools[lzma]
+ virtual/acl"
+BDEPEND="dev-lang/go
+ nls? ( sys-devel/gettext )
+ verify-sig? ( sec-keys/openpgp-keys-linuxcontainers )"
+
+CONFIG_CHECK="
+ ~CGROUPS
+ ~IPC_NS
+ ~NET_NS
+ ~PID_NS
+
+ ~SECCOMP
+ ~USER_NS
+ ~UTS_NS
+
+ ~KVM
+ ~MACVTAP
+ ~VHOST_VSOCK
+"
+
+ERROR_IPC_NS="CONFIG_IPC_NS is required."
+ERROR_NET_NS="CONFIG_NET_NS is required."
+ERROR_PID_NS="CONFIG_PID_NS is required."
+ERROR_SECCOMP="CONFIG_SECCOMP is required."
+ERROR_UTS_NS="CONFIG_UTS_NS is required."
+
+WARNING_KVM="CONFIG_KVM and CONFIG_KVM_AMD/-INTEL is required for virtual machines."
+WARNING_MACVTAP="CONFIG_MACVTAP is required for virtual machines."
+WARNING_VHOST_VSOCK="CONFIG_VHOST_VSOCK is required for virtual machines."
+
+# Go magic.
+QA_PREBUILT="/usr/bin/fuidshift
+ /usr/bin/lxc
+ /usr/bin/lxc-to-lxd
+ /usr/bin/lxd-agent
+ /usr/bin/lxd-benchmark
+ /usr/bin/lxd-migrate
+ /usr/sbin/lxd"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/linuxcontainers.asc
+
+# The testsuite must be run as root.
+# make: *** [Makefile:156: check] Error 1
+RESTRICT="test"
+
+GOPATH="${S}/_dist"
+
+PATCHES=( "${FILESDIR}"/lxd-5.0.2-remove-shellcheck-buildsystem-checks.patch )
+
+src_prepare() {
+ export GOPATH="${S}/_dist"
+
+ default
+
+ sed -i \
+ -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/lxd:g" \
+ -e "s:make:make ${MAKEOPTS}:g" \
+ Makefile || die
+
+ # Fix hardcoded ovmf file path, see bug 763180
+ sed -i \
+ -e "s:/usr/share/OVMF:/usr/share/edk2-ovmf:g" \
+ -e "s:OVMF_VARS.ms.fd:OVMF_VARS.fd:g" \
+ doc/environment.md \
+ lxd/apparmor/instance.go \
+ lxd/apparmor/instance_qemu.go \
+ lxd/instance/drivers/driver_qemu.go || die "Failed to fix hardcoded ovmf paths."
+
+ # Fix hardcoded virtfs-proxy-helper file path, see bug 798924
+ sed -i \
+ -e "s:/usr/lib/qemu/virtfs-proxy-helper:/usr/libexec/virtfs-proxy-helper:g" \
+ lxd/device/device_utils_disk.go || die "Failed to fix virtfs-proxy-helper path."
+
+ cp "${FILESDIR}"/lxd-4.0.9-r1.service "${T}"/lxd.service || die
+ if use apparmor; then
+ sed -i \
+ '/^EnvironmentFile=.*/a ExecStartPre=\/usr\/libexec\/lxc\/lxc-apparmor-load' \
+ "${T}"/lxd.service || die
+ fi
+
+ # Disable -Werror's from go modules.
+ find "${S}" -name "cgo.go" -exec sed -i "s/ -Werror / /g" {} + || die
+}
+
+src_configure() { :; }
+
+src_compile() {
+ export GOPATH="${S}/_dist"
+ export CGO_LDFLAGS_ALLOW="-Wl,-z,now"
+
+ for k in fuidshift lxd-benchmark lxc lxc-to-lxd; do
+ go install -v -x "${S}/${k}" || die "failed compiling ${k}"
+ done
+
+ go install -v -x -tags libsqlite3 "${S}"/lxd || die "Failed to build the daemon"
+
+ # Needs to be built statically
+ CGO_ENABLED=0 go install -v -tags netgo "${S}"/lxd-migrate
+ CGO_ENABLED=0 go install -v -tags agent,netgo "${S}"/lxd-agent
+
+ use nls && emake build-mo
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ export GOPATH="${S}/_dist"
+ local bindir="_dist/bin"
+
+ dosbin ${bindir}/lxd
+
+ for l in fuidshift lxd-agent lxd-benchmark lxd-migrate lxc lxc-to-lxd; do
+ dobin ${bindir}/${l}
+ done
+
+ newbashcomp scripts/bash/lxd-client lxc
+
+ newconfd "${FILESDIR}"/lxd-4.0.0.confd lxd
+ newinitd "${FILESDIR}"/lxd-5.0.2-r1.initd lxd
+
+ systemd_dounit "${T}"/lxd.service
+ systemd_newunit "${FILESDIR}"/lxd-containers-4.0.0.service lxd-containers.service
+ systemd_newunit "${FILESDIR}"/lxd-4.0.0.socket lxd.socket
+
+ dodoc AUTHORS
+ dodoc -r doc/*
+ use nls && domo po/*.mo
+}
+
+pkg_postinst() {
+ elog
+ elog "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
+ elog "including a Quick Start."
+ elog "For virtual machine support, see:"
+ elog "https://wiki.gentoo.org/wiki/LXD#Virtual_machines"
+ elog
+ elog "Please run 'lxc-checkconfig' to see all optional kernel features."
+ elog
+ optfeature "virtual machine support" app-emulation/qemu[spice,usbredir,virtfs]
+ optfeature "btrfs storage backend" sys-fs/btrfs-progs
+ optfeature "lvm2 storage backend" sys-fs/lvm2
+ optfeature "zfs storage backend" sys-fs/zfs
+ elog
+ elog "Be sure to add your local user to the lxd group."
+
+ if [[ ${REPLACING_VERSIONS} ]] &&
+ ver_test ${REPLACING_VERSIONS} -lt 5.0.1 &&
+ has_version app-emulation/qemu[spice,usbredir,virtfs]; then
+ ewarn ""
+ ewarn "You're updating from <5.0.1. Due to incompatible API updates in the lxd-agent"
+ ewarn "product, you'll have to restart any running virtual machines before they work"
+ ewarn "properly."
+ ewarn ""
+ ewarn "Run: 'lxc restart your-vm' after the update for your vm's managed by lxd."
+ ewarn ""
+ fi
+
+ if [[ ${REPLACING_VERSIONS} ]] &&
+ has_version "sys-apps/openrc"; then
+ elog ""
+ elog "The new init.d script will attempt to mount "
+ elog " /sys/fs/cgroup/systemd"
+ elog "by default, which is needed to run systemd containers with openrc host."
+ elog "See the /etc/init.d/lxd file for requirements."
+ elog ""
+ fi
+}