From 90c88731bd036e5698b281fbc0a5f3aa4c9983ac Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 29 Jun 2020 11:38:31 +0100 Subject: gentoo resync : 29.06.2020 --- app-emulation/lxd/Manifest | 12 +- .../lxd/files/de-translation-newline-1.patch | 11 - app-emulation/lxd/files/lxd-4.0.1-clang.patch | 76 +++++++ app-emulation/lxd/files/lxd.confd | 24 -- app-emulation/lxd/files/lxd.initd | 46 ---- app-emulation/lxd/lxd-3.14.ebuild | 241 --------------------- app-emulation/lxd/lxd-4.0.1.ebuild | 4 +- app-emulation/lxd/lxd-4.0.2.ebuild | 204 +++++++++++++++++ app-emulation/lxd/metadata.xml | 11 - 9 files changed, 288 insertions(+), 341 deletions(-) delete mode 100644 app-emulation/lxd/files/de-translation-newline-1.patch create mode 100644 app-emulation/lxd/files/lxd-4.0.1-clang.patch delete mode 100644 app-emulation/lxd/files/lxd.confd delete mode 100644 app-emulation/lxd/files/lxd.initd delete mode 100644 app-emulation/lxd/lxd-3.14.ebuild create mode 100644 app-emulation/lxd/lxd-4.0.2.ebuild (limited to 'app-emulation/lxd') diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest index 4d38dedd79c5..c4c509e429ce 100644 --- a/app-emulation/lxd/Manifest +++ b/app-emulation/lxd/Manifest @@ -1,11 +1,9 @@ -AUX de-translation-newline-1.patch 432 BLAKE2B 2b546cd7200f0d736bffd255bbb79d4e997241a35159e052598d4b9da77ca402a0eb90fcb6fae74ac7d9dca9b8383843fd67fb88b6cab474e547d892ac414d4b SHA512 2857ec4e4856d47340163c10644805ee7a65a0095539c7fdc422b874d1af645187a1de0aff4844d9ed0387cebbd82dbb33da32a839b6dda02df4c3d741e88d76 AUX lxd-4.0.0.confd 582 BLAKE2B 88ce8ec99eb50174bffea7d3b8bddc67b50fe6677d54df115c9069311b5fb59a72170a15988f50714740074f7ec4f2cd32fb47b6d8c52cf69b8c6fa332162a06 SHA512 96d922ae81677eebace3f8d2dff7f67d58701c40c09e2435677f9289cca89fe260c0d9526059d3772c3405a5b8ec52466bf7d7a920dcdd7551f1b3f01f2fc9c4 AUX lxd-4.0.0.initd 1097 BLAKE2B 8cd967f37edc7c87a5d225dc77a39e6696596fb9d53829289b75b3f136572aaaaede5ad78360c0ca2055bcf23627fd75102616ff9da604785bdcbdcb57ae81ff SHA512 5a40f0e7a6fe5e8b301f8fc22344fed64fe8b8894a175600e938f147f49ccf4fa71c75fdfe25ba936c65435fcabdc5f7a606993093e5ffdb7dbc4e0b9f03621d -AUX lxd.confd 538 BLAKE2B f020d83375bddc3e88f752d4be49c65893901893eaa572f212c655f4d3c5631b41238ed917c70f16b4c092d82ced13011edd6e91140cda251ebf8745591cd886 SHA512 9ea61647a8da82bc595f78882adf5a6c71483c7adf8965d7d32016a67a0da6510f8dc3d09fd29f77d5f6d5f18282bca3b3b5c2abffaa67265a4fd4ddb07f31a8 -AUX lxd.initd 853 BLAKE2B 0b48de1a596767db356850adcb5682c5c351e7477b0d49d81aebf857a01e4eb75067087d323ba4b5d6fbf8765a76cf161ad2cfaa0eba480fb86e91fdb95b0e79 SHA512 960aceb2845cc3b454b2f916c73273f4b1ec6f87e5d569c27c8c58e0db153c084e03addbdcc91dc8761fc6f0e306261d87db73f8610fda197e55f9ec6756fd56 +AUX lxd-4.0.1-clang.patch 2566 BLAKE2B 1cc6db796393569512dda9b483afaac810a0d2f852308901d1a79e76ffd6def7b4d6a269054c1ec9180de616d0550f4e2542f6aa5417ce91d51ab3ac6cb72fca SHA512 748cf9bf93d4b86de230bf85313ba90e435e8e7011383cba39f4a5767c9cf9e818eb8eae3213d8745ed114a62ae633b311d2088e3e35b1ccef6f5ede5a0f424c AUX lxd.service 174 BLAKE2B 8686d57a79fbc3a9ec2e1a3197012599a5d6b81b62188e779cdb9a86f9f413fa485090c79dab8c4aa8891e0e35604b85fb1cdb1da313918b34a974b61699b24a SHA512 6f9d71d5c08c49653f28511bc793d1365604af6bf105789caea27f4685d721fbb283f888e3b7310997b73ff2fc5bb1a47e7500c4678cb3d39124cab723523140 -DIST lxd-3.14.tar.gz 26141949 BLAKE2B 69004501012c9a873eef77a60df7e5dba25c692224d27b02cd2d2b27533012e71bd7562cb64a17920234746e8be2819bb773365c01422c0b776dd2b7c36b69fe SHA512 3d2d4e61298fc9fde49defad776a398fcccf7639485e810173c9c7f7d939c354a9ad8112a4a631b0850f6eb54435012d289236ff61839416caf95434eb23c8ff DIST lxd-4.0.1.tar.gz 25027762 BLAKE2B 1154a427558ad5eda62b63501a2f62a5c3a1b740fac061432b06a1034b75cb906f38d6c43e8215cab8ae0bed328d75a7612c1bb7af3272cdbe3f93235d5bb920 SHA512 1f47f8239cc1d3425fc4cd075487678e219e94deddec10f52a1cd18fbdc0515f54b67552e7b41d0052803c317a861b34cfc83a25776eae7b9673b5c5fd50d70f -EBUILD lxd-3.14.ebuild 6865 BLAKE2B 56a86d6bb704c3c562654d01953b566f34e9d57abf915972899b663b61e8d9fe1e50523a439a406b013e7396c3286e104859bf4ca23106306ee719ef41810d80 SHA512 aadb152acac7f5784028bbd89c8ebc105992dd6898e22ed36b26889969b7ce1cffdb79e8db1c0e0a43ca98cae7feee3f133165c3f624b87611dfed1dbe0c8511 -EBUILD lxd-4.0.1.ebuild 5667 BLAKE2B 0d264505373865191a0db35f39e93a02783696904f1e254e8e4eb4b698652db207bc22e222f7c70337a9db648f0af3d64f3faad0b21541a158e73cbf0bc7179d SHA512 6ce8d93d08af5f15984d4f0a099edb478a3bc42ea13a4028b01288e8436de0352e97f78a35edc8451f5f8399bb37faaf9fef5c110b71fc0ef5cb53fee36c8fd5 -MISC metadata.xml 925 BLAKE2B 74a89f515bf441f62686a9a2fc2576ec8986705b681e52c9e8267acd6839b06fdafe82dd27df43c39b5e09bba87e63bbb27cc4da18ed31931393946b90add05b SHA512 e4fc6d70a790e164366349e4980f5161db0ca1b4d1996c1ce32223a75926a38ea46f8e08e6c708c6f41c2c81aebde3dbe0d0ce5c63f9340f7ae6f895b5fde144 +DIST lxd-4.0.2.tar.gz 25350601 BLAKE2B 2abecb61759a1a717960671516157dc7b7a36865ecdbcec1f211e5b653b2b4afc41932a4a289430de0dd4ac1e2c777de471ab26e31dbf2b8d1855f67d03886ad SHA512 6c1c668055e9677850f24e142e6741cb6b5aa8d4d9cce29af566e8090c28e04b4baf973f486aef28b7f6b34be5b9ab9bb45e77956879ff7feff6bec8e4db3077 +EBUILD lxd-4.0.1.ebuild 5715 BLAKE2B 7b5da6fd786bfbcd0381d02fe00a3f6d2da680f3ac497d2e890cac11f5b577271496540ac1e48c200a70f9d7be61887f95de0d209075386d55da509e416cef56 SHA512 c8083ec436f116f3bad879c05ab75f33c4113b79ec4ea241e2f95a85edd636166468cc76b991c53ad7469fb98ffefb8ce94de807c8d1db86f3d47026e48a27a7 +EBUILD lxd-4.0.2.ebuild 5646 BLAKE2B a12ba65e48ddbb509d7f4776581cf6347efc6a5fe9f2cd155f9da61cb7bb2b1f3201b5e9287976663727b553ac0a1de0b6510af3ccd5f5c71bcdb257ff6ac261 SHA512 4ca17c1526bdafa38fea05d19a0e9cd6c960d90bd4ef146545fd8a19c90d580fdbf07f599ccbe3db72c35716a236b72c7e6b0ba1d3150919ba2bf8b61dbb8347 +MISC metadata.xml 677 BLAKE2B 4349c9e18f865c5036e53c6cc5e6492ef35d73786408dbb54f8ad77b7e5edcdf48f5636cbd571e0a510c1faffcc17cfda32461185266af8e3f5fd541bae389b9 SHA512 0e1639760f475f9c77dfe0e1457b5ee2dec81cdb87ba92c179882ad820d82d9fa2606d88eb16eea847f0cfebab7327106abe984bead69ac6670929c181dce86b diff --git a/app-emulation/lxd/files/de-translation-newline-1.patch b/app-emulation/lxd/files/de-translation-newline-1.patch deleted file mode 100644 index 4c731e9023dc..000000000000 --- a/app-emulation/lxd/files/de-translation-newline-1.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- /po/de.po 2018-06-27 19:57:56.759130047 -0500 -+++ /po/de.po 2018-06-27 20:01:09.694634346 -0500 -@@ -167,7 +167,7 @@ - "###\n" - "### Each property is represented by a single line:\n" - "### An example would be:\n" --"### description: My custom image" -+"### description: My custom image\n" - msgstr "" - "### Dies ist eine Darstellung der Eigenschaften eines Images in yaml.\n" - "### Jede Zeile die mit '# beginnt wird ignoriert.\n" diff --git a/app-emulation/lxd/files/lxd-4.0.1-clang.patch b/app-emulation/lxd/files/lxd-4.0.1-clang.patch new file mode 100644 index 000000000000..765f2f38be5d --- /dev/null +++ b/app-emulation/lxd/files/lxd-4.0.1-clang.patch @@ -0,0 +1,76 @@ +From c7ce94825871ea5d0946e92762e981354628b8ad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?St=C3=A9phane=20Graber?= +Date: Mon, 22 Jun 2020 22:17:02 -0400 +Subject: [PATCH] lxd: Fix building with clang +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Closes #7573 + +Signed-off-by: Stéphane Graber +--- + lxd/main_forksyscall.go | 8 -------- + lxd/seccomp/seccomp.go | 16 ++++++++-------- + 2 files changed, 8 insertions(+), 16 deletions(-) + +diff --git a/lxd/main_forksyscall.go b/lxd/main_forksyscall.go +index a304405c2e..14895b6ce0 100644 +--- a/lxd/main_forksyscall.go ++++ b/lxd/main_forksyscall.go +@@ -34,12 +34,6 @@ extern void attach_userns_fd(int ns_fd); + extern int pidfd_nsfd(int pidfd, pid_t pid); + extern bool setnsat(int ns_fd, const char *ns); + +-static inline bool same_fsinfo(struct stat *s1, struct stat *s2, +- struct statfs *sfs1, struct statfs *sfs2) +-{ +- return ((sfs1->f_type == sfs2->f_type) && (s1->st_dev == s2->st_dev)); +-} +- + static bool chdirchroot_in_mntns(int cwd_fd, int root_fd) + { + ssize_t len; +@@ -209,8 +203,6 @@ const char *ns_names[] = { "user", "pid", "uts", "ipc", "net", "cgroup", NULL }; + + static bool change_creds(int ns_fd, cap_t caps, uid_t nsuid, gid_t nsgid, uid_t nsfsuid, gid_t nsfsgid) + { +- __do_close int fd = -EBADF; +- + if (prctl(PR_SET_KEEPCAPS, 1)) + return false; + +diff --git a/lxd/seccomp/seccomp.go b/lxd/seccomp/seccomp.go +index 8945fd9197..025efb3141 100644 +--- a/lxd/seccomp/seccomp.go ++++ b/lxd/seccomp/seccomp.go +@@ -91,21 +91,21 @@ static int device_allowed(dev_t dev, mode_t mode) + { + switch (mode & S_IFMT) { + case S_IFCHR: +- if ((dev == makedev(0, 0))) // whiteout ++ if (dev == makedev(0, 0)) // whiteout + return 0; +- else if ((dev == makedev(5, 1))) // /dev/console ++ else if (dev == makedev(5, 1)) // /dev/console + return 0; +- else if ((dev == makedev(1, 7))) // /dev/full ++ else if (dev == makedev(1, 7)) // /dev/full + return 0; +- else if ((dev == makedev(1, 3))) // /dev/null ++ else if (dev == makedev(1, 3)) // /dev/null + return 0; +- else if ((dev == makedev(1, 8))) // /dev/random ++ else if (dev == makedev(1, 8)) // /dev/random + return 0; +- else if ((dev == makedev(5, 0))) // /dev/tty ++ else if (dev == makedev(5, 0)) // /dev/tty + return 0; +- else if ((dev == makedev(1, 9))) // /dev/urandom ++ else if (dev == makedev(1, 9)) // /dev/urandom + return 0; +- else if ((dev == makedev(1, 5))) // /dev/zero ++ else if (dev == makedev(1, 5)) // /dev/zero + return 0; + } + diff --git a/app-emulation/lxd/files/lxd.confd b/app-emulation/lxd/files/lxd.confd deleted file mode 100644 index 8e342cc62d16..000000000000 --- a/app-emulation/lxd/files/lxd.confd +++ /dev/null @@ -1,24 +0,0 @@ -# Group which owns the shared socket -LXD_OPTIONS+=" --group lxd" - - - -# Enable cpu profiling into the specified file -#LXD_OPTIONS+=" --cpuprofile /tmp/lxc_cpu_profile" - -# Enable memory profiling into the specified file -#LXD_OPTIONS+=" --memprofile /tmp/lxc_mem_profile" - - - -# Enables debug mode -#LXD_OPTIONS+=" --debug" - -# For debugging, print a complete stack trace every n seconds -#LXD_OPTIONS+=" --print-goroutines 5" - -# Enables verbose mode -#LXD_OPTIONS+=" --verbose" - -# Logfile to log to -#LXD_OPTIONS+=" --logfile /var/log/lxd/lxd.log" diff --git a/app-emulation/lxd/files/lxd.initd b/app-emulation/lxd/files/lxd.initd deleted file mode 100644 index b1fa7caac546..000000000000 --- a/app-emulation/lxd/files/lxd.initd +++ /dev/null @@ -1,46 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -DAEMON=/usr/sbin/lxd -PIDFILE=/run/lxd.pid - -extra_commands="stopall" - -depend() { - need net - use lxcfs -} - -start() { - ebegin "Starting lxd service" - - start-stop-daemon --start \ - --pidfile ${PIDFILE} \ - --exec ${DAEMON} \ - --background \ - --make-pidfile \ - -- \ - ${LXD_OPTIONS} - - eend $? -} - -stop() { - if [ "$RC_GOINGDOWN" = "YES" ] || [ "$RC_REBOOT" = "YES" ]; then - stopall - else - ebegin "Stopping lxd service (but not containers)" - start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE} - eend $? - fi -} - -stopall() { - ebegin "Stopping lxd service and containers" - if "${DAEMON}" shutdown; then - /etc/init.d/lxd zap - rm -f ${PIDFILE} - fi - eend $? -} diff --git a/app-emulation/lxd/lxd-3.14.ebuild b/app-emulation/lxd/lxd-3.14.ebuild deleted file mode 100644 index 3639d12ad028..000000000000 --- a/app-emulation/lxd/lxd-3.14.ebuild +++ /dev/null @@ -1,241 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DESCRIPTION="Fast, dense and secure container management" -HOMEPAGE="https://linuxcontainers.org/lxd/introduction/" - -LICENSE="Apache-2.0 BSD BSD-2 LGPL-3 MIT MPL-2.0" -SLOT="0" -KEYWORDS="amd64" - -IUSE="+daemon +ipv6 +dnsmasq nls test tools" -RESTRICT="!test? ( test )" - -inherit autotools bash-completion-r1 linux-info systemd user - -SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz" - -DEPEND=" - dev-lang/tcl - >=dev-lang/go-1.9.4 - dev-libs/libuv - dev-libs/protobuf - nls? ( sys-devel/gettext ) - test? ( - app-misc/jq - net-misc/curl - sys-devel/gettext - ) -" - -RDEPEND=" - daemon? ( - app-arch/xz-utils - >=app-emulation/lxc-2.0.7[seccomp] - dev-libs/libuv - dev-libs/lzo - dev-util/xdelta:3 - dnsmasq? ( - net-dns/dnsmasq[dhcp,ipv6?] - ) - net-firewall/ebtables - net-firewall/iptables[ipv6?] - net-libs/libnfnetlink - net-libs/libnsl:0= - net-misc/rsync[xattr] - sys-apps/iproute2[ipv6?] - sys-fs/fuse - sys-fs/lxcfs - sys-fs/squashfs-tools - virtual/acl - ) -" - -CONFIG_CHECK=" - ~BRIDGE - ~DUMMY - ~IP6_NF_NAT - ~IP6_NF_TARGET_MASQUERADE - ~IPV6 - ~IP_NF_NAT - ~IP_NF_TARGET_MASQUERADE - ~MACVLAN - ~NETFILTER_XT_MATCH_COMMENT - ~NET_IPGRE - ~NET_IPGRE_DEMUX - ~NET_IPIP - ~NF_NAT_MASQUERADE_IPV4 - ~NF_NAT_MASQUERADE_IPV6 - ~VXLAN -" - -ERROR_BRIDGE="BRIDGE: needed for network commands" -ERROR_DUMMY="DUMMY: needed for network commands" -ERROR_IP6_NF_NAT="IP6_NF_NAT: needed for network commands" -ERROR_IP6_NF_TARGET_MASQUERADE="IP6_NF_TARGET_MASQUERADE: needed for network commands" -ERROR_IPV6="IPV6: needed for network commands" -ERROR_IP_NF_NAT="IP_NF_NAT: needed for network commands" -ERROR_IP_NF_TARGET_MASQUERADE="IP_NF_TARGET_MASQUERADE: needed for network commands" -ERROR_MACVLAN="MACVLAN: needed for network commands" -ERROR_NETFILTER_XT_MATCH_COMMENT="NETFILTER_XT_MATCH_COMMENT: needed for network commands" -ERROR_NET_IPGRE="NET_IPGRE: needed for network commands" -ERROR_NET_IPGRE_DEMUX="NET_IPGRE_DEMUX: needed for network commands" -ERROR_NET_IPIP="NET_IPIP: needed for network commands" -ERROR_NF_NAT_MASQUERADE_IPV4="NF_NAT_MASQUERADE_IPV4: needed for network commands" -ERROR_NF_NAT_MASQUERADE_IPV6="NF_NAT_MASQUERADE_IPV6: needed for network commands" -ERROR_VXLAN="VXLAN: needed for network commands" - -EGO_PN="github.com/lxc/lxd" - -src_prepare() { - eapply_user - eapply "${FILESDIR}/de-translation-newline-1.patch" - - cd "${S}/dist/dqlite" || die "Can't cd to dqlite dir" - eautoreconf -} - -src_configure() { - export GOPATH="${S}/dist" - cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir" - econf --enable-replication --disable-amalgamation --disable-tcl --libdir="${EPREFIX}/usr/lib/lxd" - - cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir" - PKG_CONFIG_PATH="${GOPATH}/sqlite/" econf --libdir=${EPREFIX}/usr/lib/lxd -} - -src_compile() { - export GOPATH="${S}/dist" - - cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir" - emake - - cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir" - emake CFLAGS="-I${GOPATH}/sqlite" LDFLAGS="-L${GOPATH}/sqlite" - - # We don't use the Makefile here because it builds targets with the - # assumption that `pwd` is in a deep gopath namespace, which we're not. - # It's simpler to manually call "go install" than patching the Makefile. - cd "${S}" - go install -v -x ${EGO_PN}/lxc || die "Failed to build the client" - - if use daemon; then - - # LXD depends on a patched, bundled sqlite with replication - # capabilities. - export CGO_CFLAGS="-I${GOPATH}/sqlite/ -I${GOPATH}/dqlite/include/" - export CGO_LDFLAGS="-L${GOPATH}/sqlite/.libs/ -L${GOPATH}/dqlite/.libs/ -Wl,-rpath,${EPREFIX}/usr/lib/lxd" - export LD_LIBRARY_PATH="${GOPATH}/sqlite/.libs/:${GOPATH}/dqlite/.libs/" - - go install -v -x -tags libsqlite3 ${EGO_PN}/lxd || die "Failed to build the daemon" - fi - - if use tools; then - go install -v -x ${EGO_PN}/fuidshift || die "Failed to build fuidshift" - go install -v -x ${EGO_PN}/lxc-to-lxd || die "Failed to build lxc-to-lxd" - go install -v -x ${EGO_PN}/lxd-benchmark || die "Failed to build lxd-benchmark" - go install -v -x ${EGO_PN}/lxd-p2c || die "Failed to build lxd-p2c" - fi - - use nls && emake build-mo -} - -src_test() { - if use daemon; then - export GOPATH="${S}/dist" - # This is mostly a copy/paste from the Makefile's "check" rule, but - # patching the Makefile to work in a non "fully-qualified" go namespace - # was more complicated than this modest copy/paste. - # Also: sorry, for now a network connection is needed to run tests. - # Will properly bundle test dependencies later. - go get -v -x github.com/rogpeppe/godeps - go get -v -x github.com/remyoudompheng/go-misc/deadcode - go get -v -x github.com/golang/lint/golint - go test -v ${EGO_PN}/lxd - else - einfo "No tests to run for client-only builds" - fi -} - -src_install() { - local bindir="dist/bin" - dobin ${bindir}/lxc - if use daemon; then - - export GOPATH="${S}/dist" - cd "${GOPATH}/sqlite" || die "Can't cd to sqlite dir" - emake DESTDIR="${D}" install - - cd "${GOPATH}/dqlite" || die "Can't cd to dqlite dir" - emake DESTDIR="${D}" install - - # Must only install libs - rm "${D}/usr/bin/sqlite3" || die "Can't remove custom sqlite3 binary" - rm -r "${D}/usr/include" || die "Can't remove include directory" - - cd "${S}" || die "Can't cd to \${S}" - dosbin ${bindir}/lxd - fi - - if use tools; then - dobin ${bindir}/fuidshift - dobin ${bindir}/lxc-to-lxd - dobin ${bindir}/lxd-benchmark - dobin ${bindir}/lxd-p2c - fi - - if use nls; then - domo po/*.mo - fi - - if use daemon; then - newinitd "${FILESDIR}"/${PN}.initd lxd - newconfd "${FILESDIR}"/${PN}.confd lxd - - systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service - fi - - newbashcomp scripts/bash/lxd-client lxc - - dodoc AUTHORS doc/* -} - -pkg_postinst() { - elog - elog "Consult https://wiki.gentoo.org/wiki/LXD for more information," - elog "including a Quick Start." - - # The messaging below only applies to daemon installs - use daemon || return 0 - - # The control socket will be owned by (and writeable by) this group. - enewgroup lxd - - # Ubuntu also defines an lxd user but it appears unused (the daemon - # must run as root) - - elog - elog "Though not strictly required, some features are enabled at run-time" - elog "when the relevant helper programs are detected:" - elog "- sys-apps/apparmor" - elog "- sys-fs/btrfs-progs" - elog "- sys-fs/lvm2" - elog "- sys-fs/zfs" - elog "- sys-process/criu" - elog - elog "Since these features can't be disabled at build-time they are" - elog "not USE-conditional." - elog - elog "Be sure to add your local user to the lxd group." - elog - elog "Networks with bridge.mode=fan are unsupported due to requiring" - elog "a patched kernel and iproute2." -} - -# TODO: -# - man page, I don't see cobra generating it -# - maybe implement LXD_CLUSTER_UPDATE per -# https://discuss.linuxcontainers.org/t/lxd-3-5-has-been-released/2656 -# EM I'm not convinced it's a good design. diff --git a/app-emulation/lxd/lxd-4.0.1.ebuild b/app-emulation/lxd/lxd-4.0.1.ebuild index 21a6fcee0663..578a64630a10 100644 --- a/app-emulation/lxd/lxd-4.0.1.ebuild +++ b/app-emulation/lxd/lxd-4.0.1.ebuild @@ -12,7 +12,7 @@ SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz" # Needs to include licenses for all bundled programs. LICENSE="Apache-2.0 BSD BSD-2 LGPL-3 MIT MPL-2.0" SLOT="0" -KEYWORDS="~amd64" +KEYWORDS="amd64" IUSE="+ipv6 nls" DEPEND="app-arch/xz-utils @@ -67,6 +67,8 @@ QA_PREBUILT="/usr/lib/lxd/libdqlite.so.0.0.1 EGO_PN="github.com/lxc/lxd" GOPATH="${S}/_dist" # this seems to reset every now and then, though +PATCHES=( "${FILESDIR}"/lxd-4.0.1-clang.patch ) + common_op() { local i for i in dqlite raft; do diff --git a/app-emulation/lxd/lxd-4.0.2.ebuild b/app-emulation/lxd/lxd-4.0.2.ebuild new file mode 100644 index 000000000000..8317a5bc6fb0 --- /dev/null +++ b/app-emulation/lxd/lxd-4.0.2.ebuild @@ -0,0 +1,204 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools bash-completion-r1 eutils linux-info systemd + +DESCRIPTION="Fast, dense and secure container management" +HOMEPAGE="https://linuxcontainers.org/lxd/introduction/ https://github.com/lxc/lxd" +SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz" + +# Needs to include licenses for all bundled programs and libraries. +LICENSE="Apache-2.0 BSD BSD-2 LGPL-3 MIT MPL-2.0" +SLOT="0" +KEYWORDS="~amd64" +IUSE="+ipv6 nls" + +DEPEND="app-arch/xz-utils + >=app-emulation/lxc-3.0.0[seccomp] + dev-lang/tcl + dev-libs/libuv + dev-libs/lzo + net-dns/dnsmasq[dhcp,ipv6?]" +RDEPEND="${DEPEND} + acct-group/lxd + net-firewall/ebtables + net-firewall/iptables[ipv6?] + sys-apps/iproute2[ipv6?] + sys-fs/fuse:0= + sys-fs/lxcfs + sys-fs/squashfs-tools + virtual/acl" +BDEPEND="dev-lang/go + nls? ( sys-devel/gettext )" + +CONFIG_CHECK=" + ~BRIDGE + ~DUMMY + ~IP6_NF_NAT + ~IP6_NF_TARGET_MASQUERADE + ~IPV6 + ~IP_NF_NAT + ~IP_NF_TARGET_MASQUERADE + ~MACVLAN + ~NETFILTER_XT_MATCH_COMMENT + ~NET_IPGRE + ~NET_IPGRE_DEMUX + ~NET_IPIP + ~NF_NAT_MASQUERADE_IPV4 + ~VSOCKETS + ~VXLAN +" + +# Uses internet connection. +RESTRICT="test" + +# Go magic. +QA_PREBUILT="/usr/lib/lxd/libdqlite.so.0.0.1 + /usr/bin/fuidshift + /usr/bin/lxc + /usr/bin/lxc-to-lxd + /usr/bin/lxd-agent + /usr/bin/lxd-benchmark + /usr/bin/lxd-p2c + /usr/sbin/lxd" + +EGO_PN="github.com/lxc/lxd" +GOPATH="${S}/_dist" # this seems to reset every now and then, though + +common_op() { + local i + for i in dqlite raft; do + cd "${GOPATH}"/deps/${i} || die "failed to switch dir to ${i}" + "${@}" + cd "${S}" || die "failed to switch dir back from ${i} to ${S}" + done +} + +src_prepare() { + default + + export GOPATH="${S}/_dist" + + sed -i \ + -e "s:\./configure:./configure --prefix=/usr --libdir=${EPREFIX}/usr/lib/lxd:g" \ + -e "s:make:make ${MAKEOPTS}:g" \ + Makefile || die + + sed -i 's#lib$#lib/lxd#' "${GOPATH}"/deps/libco/Makefile || die + sed -i 's#zfs version 2>/dev/null | cut -f 2 -d - | head -1#< /sys/module/zfs/version cut -f 1#' "${GOPATH}"/deps/raft/configure.ac || die + + common_op eautoreconf +} + +src_configure() { + export GOPATH="${S}/_dist" + + export CO_CFLAGS="-I${GOPATH}/deps/libco/" + export CO_LIBS="${GOPATH}/deps/libco/" + + export RAFT_CFLAGS="-I${GOPATH}/deps/raft/include/" + export RAFT_LIBS="${GOPATH}/deps/raft/.libs" + + export SQLITE_CFLAGS="-I${GOPATH}/deps/sqlite" + export SQLITE_LIBS="${GOPATH}/deps/sqlite/.libs" + + export PKG_CONFIG_PATH="${GOPATH}/sqlite/:${GOPATH}/libco/:${GOPATH}/raft/" + + cd "${GOPATH}/deps/sqlite" || die + econf --enable-replication --disable-amalgamation --disable-tcl --libdir="${EPREFIX}/usr/lib/lxd" + + common_op econf --libdir="${EPREFIX}"/usr/lib/lxd +} + +src_compile() { + export GOPATH="${S}/_dist" + + export CGO_CFLAGS="${CGO_CFLAGS} -I${GOPATH}/deps/sqlite/ -I${GOPATH}/deps/dqlite/include/ -I${GOPATH}/deps/raft/include/ -I${GOPATH}/deps/libco/" + export CGO_LDFLAGS="${CGO_LDFLAGS} -L${GOPATH}/deps/sqlite/.libs/ -L${GOPATH}/deps/dqlite/.libs/ -L${GOPATH}/deps/raft/.libs -L${GOPATH}/deps/libco/ -Wl,-rpath,${EPREFIX}/usr/lib/lxd" + export LD_LIBRARY_PATH="${GOPATH}/deps/sqlite/.libs/:${GOPATH}/deps/dqlite/.libs/:${GOPATH}/deps/raft/.libs:${GOPATH}/deps/libco/:${LD_LIBRARY_PATH}" + + local j + for j in sqlite raft libco; do + cd "${GOPATH}"/deps/${j} || die + emake + done + + ln -s libco.so.0.1.0 libco.so || die + + cd "${GOPATH}/deps/dqlite" || die + emake CFLAGS="-I${GOPATH}/deps/sqlite -I${GOPATH}/deps/raft/include" LDFLAGS="-L${GOPATH}/deps/sqlite -L${GOPATH}/deps/raft" + + cd "${S}" || die + + for k in fuidshift lxd-agent lxd-benchmark lxd-p2c lxc lxc-to-lxd; do + go install -v -x ${EGO_PN}/${k} || die "failed compiling ${k}" + done + + go install -v -x -tags libsqlite3 ${EGO_PN}/lxd || die "Failed to build the daemon" + + use nls && emake build-mo +} + +src_test() { + export GOPATH="${S}/_dist" + + # This is mostly a copy/paste from the Makefile's "check" rule, but + # patching the Makefile to work in a non "fully-qualified" go namespace + # was more complicated than this modest copy/paste. + # Also: sorry, for now a network connection is needed to run tests. + # Will properly bundle test dependencies later. + go get -v -x github.com/rogpeppe/godeps || die + go get -v -x github.com/remyoudompheng/go-misc/deadcode || die + go get -v -x github.com/golang/lint/golint || die + go test -v ${EGO_PN}/lxd || die +} + +src_install() { + local bindir="_dist/bin" + export GOPATH="${S}/_dist" + + dosbin ${bindir}/lxd + + for l in fuidshift lxd-agent lxd-benchmark lxd-p2c lxc lxc-to-lxd; do + dobin ${bindir}/${l} + done + + for m in dqlite libco raft sqlite; do + cd "${GOPATH}"/deps/${m} || die "failed switching into ${GOPATH}/${m}" + emake DESTDIR="${D}" install + done + + cd "${S}" || die + + # We only need libraries, and we don't want anything to link against these. + rm "${ED}"/usr/bin/sqlite3 || die + rm -r "${ED}"/usr/include || die + rm -r "${ED}"/usr/lib/lxd/*.a || die + rm -r "${ED}"/usr/lib/lxd/pkgconfig || die + + newbashcomp scripts/bash/lxd-client lxc + + newconfd "${FILESDIR}"/${PN}-4.0.0.confd lxd + newinitd "${FILESDIR}"/${PN}-4.0.0.initd lxd + + systemd_newunit "${FILESDIR}"/${PN}.service ${PN}.service + + dodoc AUTHORS 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 + elog "Optional features:" + optfeature "apparmor support" app-emulation/lxc[apparmor] + 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." +} diff --git a/app-emulation/lxd/metadata.xml b/app-emulation/lxd/metadata.xml index bc72b24a7262..6711afb51f17 100644 --- a/app-emulation/lxd/metadata.xml +++ b/app-emulation/lxd/metadata.xml @@ -18,15 +18,4 @@ lxc/lxd - - - Build the system daemon, not just the client tool - - - Depend on dnsmasq to provide DHCP and DNS - - - Build and install optional tools - - -- cgit v1.2.3