diff options
Diffstat (limited to 'app-containers')
-rw-r--r-- | app-containers/Manifest.gz | bin | 6235 -> 6233 bytes | |||
-rw-r--r-- | app-containers/containers-storage/Manifest | 2 | ||||
-rw-r--r-- | app-containers/containers-storage/containers-storage-1.30.0.ebuild | 58 | ||||
-rw-r--r-- | app-containers/flannel/Manifest | 2 | ||||
-rw-r--r-- | app-containers/flannel/flannel-0.16.1.ebuild | 54 | ||||
-rw-r--r-- | app-containers/nerdctl/Manifest | 2 | ||||
-rw-r--r-- | app-containers/nerdctl/nerdctl-0.16.0.ebuild | 33 | ||||
-rw-r--r-- | app-containers/snapd/Manifest | 2 | ||||
-rw-r--r-- | app-containers/snapd/snapd-2.54.2.ebuild | 180 |
9 files changed, 273 insertions, 60 deletions
diff --git a/app-containers/Manifest.gz b/app-containers/Manifest.gz Binary files differindex e6c08dd3187e..9c63e4d4b2ff 100644 --- a/app-containers/Manifest.gz +++ b/app-containers/Manifest.gz diff --git a/app-containers/containers-storage/Manifest b/app-containers/containers-storage/Manifest index d1ec2631f695..8a45ddc4a165 100644 --- a/app-containers/containers-storage/Manifest +++ b/app-containers/containers-storage/Manifest @@ -1,5 +1,3 @@ -DIST containers-storage-1.30.0.tar.gz 3642657 BLAKE2B daab9412702822fd6be64b8a4ac88875cdc12688b919dba955a7551bb2b56af87d55bd66c02401d2c329fdcb4db466c7b5acb9e53075028fef1248e0a62c6f37 SHA512 47e256d49fbd1d507e2d8bfa45cb0c840212478594ef8551c0ebb86f4f0e70ad7ed2be6727f52768afbb55c0e912bf32c23620e508b65ed4f3edc9e1f95837a2 DIST containers-storage-1.37.0.tar.gz 3557198 BLAKE2B ebe5c8e562149a9d007ac87d7fc615d29ad7decbfd6b1b8d919b14684a6341575d8f65080a808ba52674664d187a18bb47e88f10e1a02a2975898862873dadf9 SHA512 3a65a50946e1eed1c79ea77b65feb1c6c8cf58a0b7b81932acb8891b6daa25e007582eb7f70ef7e7f2a6d8262be5db7757ead2fe079e47c99114b47917d81084 -EBUILD containers-storage-1.30.0.ebuild 1460 BLAKE2B 384a8e1e2097ec8c18398a563494941821b75a889bdc23addb0912ba58ef9298ff3d5751bacd9db8d0a8154ee8911d4f2c4677cb80dce4e14c03ca3e5f207ae3 SHA512 8a54ea2230607cb424698397133443747cd6b1a687381f300083b618c621708165b53714a1a29bde52faa450b7384f6ba70d35c2bc381d715b07a4ff75bea9c9 EBUILD containers-storage-1.37.0.ebuild 1460 BLAKE2B 384a8e1e2097ec8c18398a563494941821b75a889bdc23addb0912ba58ef9298ff3d5751bacd9db8d0a8154ee8911d4f2c4677cb80dce4e14c03ca3e5f207ae3 SHA512 8a54ea2230607cb424698397133443747cd6b1a687381f300083b618c621708165b53714a1a29bde52faa450b7384f6ba70d35c2bc381d715b07a4ff75bea9c9 MISC metadata.xml 604 BLAKE2B b132c7cf2a280a6c5fee5b37eb644c5644890b845a92165551a5466caf2fbfa07f7b63b1a387fee62467a7df4218e1e4c563fe70fc40209a4f2eae5b9c714b57 SHA512 21725a1c25a5912b26a56f1970b968ca686f55a27888e4a2948ea6d7a6b8f3d70f528e875d8d2271963ebebb6fee11c51f218045296dac21a1b86ba9b5481b28 diff --git a/app-containers/containers-storage/containers-storage-1.30.0.ebuild b/app-containers/containers-storage/containers-storage-1.30.0.ebuild deleted file mode 100644 index a55dd8c3f0fb..000000000000 --- a/app-containers/containers-storage/containers-storage-1.30.0.ebuild +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit go-module - -KEYWORDS="~amd64" -DESCRIPTION="containers/storage library" -HOMEPAGE="https://github.com/containers/storage" -LICENSE="Apache-2.0 BSD BSD-2 CC-BY-SA-4.0 ISC MIT" -SLOT="0" -IUSE="btrfs +device-mapper test" -SRC_URI="https://github.com/containers/storage/archive/v${PV}.tar.gz -> ${P}.tar.gz" -RDEPEND=" - btrfs? ( sys-fs/btrfs-progs ) - device-mapper? ( sys-fs/lvm2:= )" -DEPEND="${RDEPEND} - dev-go/go-md2man - test? ( - sys-fs/btrfs-progs - sys-fs/lvm2 - sys-apps/util-linux - )" -RESTRICT="test" - -S=${WORKDIR}/${P#containers-} - -src_prepare() { - default - - sed -e 's|: install\.tools|:|' -i Makefile || die - - [[ -f hack/btrfs_tag.sh ]] || die - use btrfs || { echo -e "#!/bin/sh\necho exclude_graphdriver_btrfs" > \ - "hack/btrfs_tag.sh" || die; } - - [[ -f hack/libdm_tag.sh ]] || die - use device-mapper || { echo -e "#!/bin/sh\necho btrfs_noversion exclude_graphdriver_devicemapper" > \ - "hack/libdm_tag.sh" || die; } -} - -src_compile() { - export -n GOCACHE GOPATH XDG_CACHE_HOME #678856 - emake GOMD2MAN=go-md2man FFJSON= containers-storage docs -} - -src_install() { - dobin "${PN}" - while read -r -d ''; do - mv "${REPLY}" "${REPLY%.1}" || die - done < <(find "${S}/docs" -name '*.[[:digit:]].1' -print0) - find "${S}/docs" -name '*.[[:digit:]]' -exec doman '{}' + || die -} - -src_test() { - env -u GOFLAGS unshare -m emake local-test-unit || die -} diff --git a/app-containers/flannel/Manifest b/app-containers/flannel/Manifest index aee6d2f9fc6c..8a3f232f0a4f 100644 --- a/app-containers/flannel/Manifest +++ b/app-containers/flannel/Manifest @@ -6,6 +6,8 @@ AUX flanneld.logrotated 77 BLAKE2B 778f7289a6268cf6b150b1c58895514808c304b56baca AUX flanneld.service 476 BLAKE2B ea838e26be0834943bafb985a37e71b45219bffbd68784b8442c065d9bafc8c9cb2b097c8a00629c19faf4b7bb1fb4ae33071e51d4bf6ffdd62cf5898de1f3cf SHA512 4a7d09f25f117b1cda9b02914a394c0d6d6ddd6c02503f61c0646ede1934cb4cad831992058c5738401b1ac7be6e4c7cd83b1c4a70c04084bb4bb01338c08220 DIST flannel-0.14.0.tar.gz 8324790 BLAKE2B 47fd65d531f9fa10e602ccf1858549ede97d8f8c9afa32ffeb010d733060703262cafd02b5daddc65142dfa96b1c6b429eaff30b7fdaca27e2a5397c0d756e7c SHA512 a5d9f45d55f18c744e635b4d697200cf9d5a8c4387cd6d9c57220e652e3688337f2ee50fef193135dd0073b14edb8800fac8d5ca9f9d0d3e9ef70d09a52f259c DIST flannel-0.16.0.tar.gz 8697548 BLAKE2B a307990554a6cf215bef6ac75a544d00d8c6cd702f02e98efaf80b89d0ecf4592c1c338d1f80cf22ee086355ee7edb77492e6af587cbf037f38b6e3dbc4ac252 SHA512 7b80fe1e282c312b8b242d2201ecd164d87b551f4bc02d8375ca856c0dcfad2d31bd1b4041663016130b0bd7ebaf0062afe59c0946e97f10478142ca8ffd94f0 +DIST flannel-0.16.1.tar.gz 8697974 BLAKE2B bff4d5a6fe179129fa9ae494291301b25bc3ff9d6f4049b990f50b01920dfd20d149eb85339e2930b66dd060aca57f269a3b21fa508a3c95f5d152bbfb91631f SHA512 699ba7e7b80dd60a03bb5c6ee384a582201d8167ef21e60816ca9942a9d70ba0fd7633a3d2a44802f9f0a0851a79709afe78bd46f15ca81641ff64d46859f928 EBUILD flannel-0.14.0.ebuild 1418 BLAKE2B 94b7e426dc6e3d769b3564f60e969a28d21628a1f963721a9d78e3f3568bd6ef2a5b481406b6aa93aa072c47209ab1f7eb1c375429d66d8cd11910bacde07c6f SHA512 1dea57abed0dc5dc46b720d046788fc16e3d471d01bc0fe2115b156c3a7888b6d834f0da85eed00b644ed3318817e858126aabacdf40e94e53d06d3736bef43a EBUILD flannel-0.16.0.ebuild 1418 BLAKE2B 94b7e426dc6e3d769b3564f60e969a28d21628a1f963721a9d78e3f3568bd6ef2a5b481406b6aa93aa072c47209ab1f7eb1c375429d66d8cd11910bacde07c6f SHA512 1dea57abed0dc5dc46b720d046788fc16e3d471d01bc0fe2115b156c3a7888b6d834f0da85eed00b644ed3318817e858126aabacdf40e94e53d06d3736bef43a +EBUILD flannel-0.16.1.ebuild 1418 BLAKE2B cf64ef8ca8ccea8838b27dccf750a8497b23876ba68275bb97911770898e17b2c35c917134147ba06493e010ce5b18fd8950678fd992db4feb9fd49066aeb8d8 SHA512 6095d70c1bbe214c6122584f9b307bc93aee73018c20aae8ed0e11e7f6e87dbd9f38edf64dcaf6931d48db35906fa17df03bf983963ae349b3b951bfd3e3d85b MISC metadata.xml 306 BLAKE2B 0a81caca08d2e73cb3624f8116c978bd4f752785a2f75953e2d0f9f9a29d64be94b5e73bc2f3697a776c6c0219898f8163b96a084eeba238dbb2c6353c34b618 SHA512 82121996c0eccb06de9a19d660d55ba4314eef903286ad71da9f8286dfafe6d74b58e297638496b2461e793f5c5ee66b0c329d17a500afdaf4cbda03f06901dc diff --git a/app-containers/flannel/flannel-0.16.1.ebuild b/app-containers/flannel/flannel-0.16.1.ebuild new file mode 100644 index 000000000000..ad8fbf25ad4e --- /dev/null +++ b/app-containers/flannel/flannel-0.16.1.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit go-module systemd tmpfiles + +KEYWORDS="~amd64 ~arm64" +DESCRIPTION="An etcd backed network fabric for containers" +HOMEPAGE="https://github.com/coreos/flannel" +SRC_URI="https://github.com/coreos/flannel/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0 BSD ISC LGPL-3 MIT" +SLOT="0" +IUSE="hardened" + +RESTRICT+=" test" + +src_prepare() { + default + sed -e "s:^var Version =.*:var Version = \"${PV}\":" \ + -i "${S}/version/version.go" || die +} + +src_compile() { + CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')"\ + go build -o dist/flanneld -ldflags " + -X github.com/flannel-io/flannel/version.Version=v${PV} + -extldflags \"-static\"" . || die +} + +src_test() { + GOPATH="${WORKDIR}/${P}" \ + go test -v -work -x "${EGO_PN}" || die +} + +src_install() { + dobin dist/${PN}d + exeinto /usr/libexec/flannel + doexe dist/mk-docker-opts.sh + insinto /etc/systemd/system/docker.service.d + newins "${FILESDIR}/flannel-docker.conf" flannel.conf + newinitd "${FILESDIR}"/flanneld.initd flanneld + newconfd "${FILESDIR}"/flanneld.confd flanneld + keepdir /var/log/${PN} + insinto /etc/logrotate.d + newins "${FILESDIR}"/flanneld.logrotated flanneld + newtmpfiles "${FILESDIR}/flannel.tmpfilesd" flannel.conf + systemd_dounit "${FILESDIR}/flanneld.service" + dodoc README.md +} + +pkg_postinst() { + tmpfiles_process flannel.conf +} diff --git a/app-containers/nerdctl/Manifest b/app-containers/nerdctl/Manifest index f8d4e3591463..7b8b0ff4cf8f 100644 --- a/app-containers/nerdctl/Manifest +++ b/app-containers/nerdctl/Manifest @@ -1,5 +1,7 @@ DIST nerdctl-0.14.0-vendor.tar.gz 8166023 BLAKE2B 9aeeceb8b35244723a618814dd0b53ab380b31f15985754df41d5515ebfb00e5d5465e5ad0bd43b543683e0146d1114d2cb0dd95c7e011ca5974250ded296f7c SHA512 f63cecb655292cb8b0e734831834dd0134e6693ec517aeaa3d9accedcb35768115efa82b9133d20e34cbffbd78d043ec680a7fa4c838d5f4999fd8a50272d377 DIST nerdctl-0.15.0-vendor.tar.gz 8310858 BLAKE2B 2406d87e3f1ee17b501308cee4a662ce79d1a49510ab1b023a6e52d537feb8fe79e9a9eacb25a1dcdf019db206467f67bf6a95e3a2ba03c07ad658cb0757394c SHA512 65494af911382086e57eab669280cc377670ce1472a2a7aef74e437a7d70d3e811a858cba1a4e154397709531523c13f3840f286334c6df367ae8f9ba47a9976 +DIST nerdctl-0.16.0-vendor.tar.gz 7871495 BLAKE2B 048c5070cec7d8dd6260738b427c461fce5144d2a1c569b4872771d43682860d6406cf7768ea1261499d4dc768269fa2af017ce969a1698c12699e82cd968b47 SHA512 9cb782e7fec46dd1c939d7bc9c417437899c22579159439c82f4b8fa5b7d4a993da679aa9130a5ee24e190fa0030ba73ead87c3e7971791b3e9a7437ab77c95d EBUILD nerdctl-0.14.0.ebuild 984 BLAKE2B 9a00368dd6245d783f3ec7bf080e8006b281d67a82084d886e4c81d0d7f87fe160fa7a9515290a5785691543e02633e1c5ca5d19041d486309b4351b2fa557c1 SHA512 7fafcf4a06a7f81ba3ffb6c7cd23e4fbab6259eb9269ba80bce75f5ec05704b6059f1ac8bef856c97b4d9d8cf3061fb950f4e24c2ec37902a7af13ccd9be8fb6 EBUILD nerdctl-0.15.0.ebuild 984 BLAKE2B 93f8db2417b97aab95d59d6b3f2eeaa8e570eab833c05ed85651df85f9db7b18a64b1134b42a40c21ce4e714a029637187235a6092016896c8858918d9b61917 SHA512 ae80495efc547402cd5ddd3d5442da8a0cc2b4552510222e41b29875a87c7b164c360aedeedc4cb97502cf59098c4995b65cf692086b59f9c99b5f6fa040c9f8 +EBUILD nerdctl-0.16.0.ebuild 989 BLAKE2B bd1f42af13c54c9b475d6bbd2bcfe1394d9d158cfe5b71334c00b725c905c764c41526286470ac54e77b287d131782722b00764a46bbd07c0097fcebfc8b158d SHA512 151f8d2887eabf460bfe852b88f3a9032c77eb1fb0b1eb5fd889963ffabb613df0a7187bbaf2fed7889750cd7b958451b7ae7469a5c36ed6957efed92af6f292 MISC metadata.xml 328 BLAKE2B e1284388fe40d8aa709a783d583fc6116eafc276e6d3e65741a03dea3cfb007549c1dadfdc2eea8ee92e430c22b734ad76944efb9c00082b4dc84e003c684763 SHA512 27f4323cda23315264bc5ea386e19b3faea4fc4808835c7105b2827cb98ed62bbbc49fa9676bd8e897d66e1b2d1cc338eebfff4c7ed01b769c13f1b72e3d5252 diff --git a/app-containers/nerdctl/nerdctl-0.16.0.ebuild b/app-containers/nerdctl/nerdctl-0.16.0.ebuild new file mode 100644 index 000000000000..1ec02ed005d2 --- /dev/null +++ b/app-containers/nerdctl/nerdctl-0.16.0.ebuild @@ -0,0 +1,33 @@ +# Copyright 2021-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit go-module + +DESCRIPTION="Docker-compatible CLI for containerd, with support for Compose" +HOMEPAGE="https://github.com/containerd/nerdctl" + +EGIT_COMMIT="0ddaffd2ce304dd917267470883898feff9463dc" +# There are too many vendor dependencies to distribute via EGO_SUM (see https://bugs.gentoo.org/721088), +# so they are instead distributed via a combined tarball. +SRC_URI="https://github.com/zmedico/nerdctl/archive/refs/tags/v${PV}-vendor.tar.gz -> ${P}-vendor.tar.gz" +BDEPEND=">=dev-lang/go-1.16" +LICENSE="Apache-2.0 BSD BSD-2 ISC MIT" +SLOT="0" + +KEYWORDS="~amd64" +IUSE="" +S=${WORKDIR}/${P}-vendor + +src_prepare() { + sed -e 's:/usr/local/bin:/usr/bin:' \ + -e "s|^VERSION[[:space:]]*=.*|VERSION := v${PV}|" \ + -e "s|^REVISION[[:space:]]*=.*|REVISION := ${EGIT_COMMIT}|" \ + -i Makefile || die + default +} + +src_install() { + DOCS=(README.md docs examples) + default_src_install +} diff --git a/app-containers/snapd/Manifest b/app-containers/snapd/Manifest index 00f295846f54..53b8b992e548 100644 --- a/app-containers/snapd/Manifest +++ b/app-containers/snapd/Manifest @@ -1,6 +1,8 @@ AUX README.gentoo 1941 BLAKE2B dd25269f2aaaea693701d74511d632bc45f2c99954ae683cb81d4df41c4c1f8007bb6c337234e46bfc5973aa7e8356cd12ac510e9109eca09890cbc42bd184bb SHA512 5b522e6c29bdad84a71245fa1f0289e9cfed0501d936b433829f66ef9d655f3cc13d6bca29beeae2c00e1b68f9fa30058608b9c4cde86ba66eab67bd011c9d00 DIST snapd-2.53.4.tar.xz 4722696 BLAKE2B c4347db8d5a14b30f1e8811e9425dd7419dd2dcad02fc1cb6a51968cd7fa6a58da2b172c041de02202cbdba1072cb0a7a92d7f92def5c5dc1e253cbcbad86aae SHA512 0b4164d3c3c3ccc99b3fa1e25d9e7e3184a5f94deca5fd83bd6d4c7761b41d6ebd5fefd1e87432a5e18c716b3330b3991134f179e1b03326edd9511ebea4ef9a DIST snapd-2.54.1.tar.xz 4818344 BLAKE2B 654d4d6a8f08dabeb6c10ea3639e1fc31b68720953bd1456695eb6c1275f260e2793e49c39c80571727fb74c954583b1a2188c461b415803210be59c57775292 SHA512 65e14c85ab62d601fa46a271ba4322531a72e7d8880833cd74daac682188808ebd8c730c1fa62dea07d8f20ba76d314f84f89b3e565eaf3ae509a569f3ee7305 +DIST snapd-2.54.2.tar.xz 4824508 BLAKE2B b893a08a61e7db059f0a7ccdf7de01a8b8e4de65fb93fd44c23cec7fd557db692421da09a8ba705e9a8e734606267419291abe5d4e7a12883a68270f66d5b833 SHA512 9aec3c126d82f5e4e17c69af922dfe4e4f17950bf308217fece5fd3816f083b26e42d672052a6e6573d7c7064ea75f168fe7771840c68a3eb85184d6a17df3bd EBUILD snapd-2.53.4.ebuild 5300 BLAKE2B c20d73ebfd851536266c09e26c23c5cb4233f54a274ed0a3959ef75291380de5d2a6e90ab21eb1b460d12fc5f3830d7dd9653fde273b3f586cba6ddead47c5fb SHA512 b39ff479ae149f38a972dd752b76a87f676ea328815dd035e1ebb9c3e3e1c9d1c1a4a10f22fda1fb672be8f0f6b0a16592b6c01acda8b950b598d1384bf5085b EBUILD snapd-2.54.1.ebuild 5300 BLAKE2B c20d73ebfd851536266c09e26c23c5cb4233f54a274ed0a3959ef75291380de5d2a6e90ab21eb1b460d12fc5f3830d7dd9653fde273b3f586cba6ddead47c5fb SHA512 b39ff479ae149f38a972dd752b76a87f676ea328815dd035e1ebb9c3e3e1c9d1c1a4a10f22fda1fb672be8f0f6b0a16592b6c01acda8b950b598d1384bf5085b +EBUILD snapd-2.54.2.ebuild 5300 BLAKE2B 4c60dd51e762eb225999b6091f7f50ddc3ff54d270810b55499a13c6ec4a9f537649edec064dfc83a7af78f34a4c260630979fd5ef8ef41de233b163086ded03 SHA512 fa3be9b200a83de428bff013e8d3feba0d54886dfd9df4beb5c03cef8c04fd2ca8718613124416703c180f761bf2ce2903dea861cd50b381188cd23fc742daba MISC metadata.xml 636 BLAKE2B 4a281c549f4279097b8cb1739e557eabe36f97e8c43e1736c68385bb4f0fe46d6952991b0e0ca531552ec27fd9f3c990324c2f35d44cf6030a4957f6eaf4f441 SHA512 6cb86bb37aa587be9744e8a45f80bc8c78df644f97f7cfbd8c7e0228d26ea7a1d834ef8e1542bed099e1b80f7c91797871e4b447102c4bfbf2f46489b59dc244 diff --git a/app-containers/snapd/snapd-2.54.2.ebuild b/app-containers/snapd/snapd-2.54.2.ebuild new file mode 100644 index 000000000000..6366a2d391fc --- /dev/null +++ b/app-containers/snapd/snapd-2.54.2.ebuild @@ -0,0 +1,180 @@ +# Copyright 2020-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +EGO_PN="github.com/snapcore/${PN}" +inherit autotools bash-completion-r1 golang-vcs-snapshot linux-info readme.gentoo-r1 systemd xdg-utils + +DESCRIPTION="Service and tools for management of snap packages" +HOMEPAGE="http://snapcraft.io/" + +MY_S="${S}/src/github.com/snapcore/${PN}" + +SRC_URI="https://github.com/snapcore/${PN}/releases/download/${PV}/${PN}_${PV}.vendor.tar.xz -> ${P}.tar.xz" +MY_PV=${PV} +KEYWORDS="~amd64" + +LICENSE="GPL-3 Apache-2.0 BSD BSD-2 LGPL-3-with-linking-exception MIT" +SLOT="0" +IUSE="apparmor +cgroup-hybrid +forced-devmode gtk kde systemd" +REQUIRED_USE="!forced-devmode? ( apparmor cgroup-hybrid ) systemd" + +CONFIG_CHECK="~CGROUPS + ~CGROUP_DEVICE + ~CGROUP_FREEZER + ~NAMESPACES + ~SQUASHFS + ~SQUASHFS_ZLIB + ~SQUASHFS_LZO + ~SQUASHFS_XZ + ~BLK_DEV_LOOP + ~SECCOMP + ~SECCOMP_FILTER" + +RDEPEND=" + sys-libs/libseccomp:= + apparmor? ( + sec-policy/apparmor-profiles + sys-apps/apparmor:= + ) + dev-libs/glib + virtual/libudev + systemd? ( sys-apps/systemd[cgroup-hybrid(+)?] ) + sys-libs/libcap:= + sys-fs/squashfs-tools[lzma]" + +DEPEND="${RDEPEND}" + +BDEPEND=" + >=dev-lang/go-1.9 + dev-python/docutils + sys-devel/gettext + sys-fs/xfsprogs" + +PDEPEND="sys-auth/polkit[gtk?,kde?]" + +README_GENTOO_SUFFIX="" + +pkg_setup() { + if use apparmor; then + CONFIG_CHECK+=" ~SECURITY_APPARMOR" + fi + linux-info_pkg_setup +} + +src_prepare() { + default + # Update apparmor profile to allow libtinfow.so* + sed -i 's/libtinfo/libtinfo{,w}/' \ + "${MY_S}/cmd/snap-confine/snap-confine.apparmor.in" || die + + if ! use forced-devmode; then + sed -e 's#return !apparmorFull#if !apparmorFull {\n\t\tpanic("USE=forced-devmode is disabled")\n\t}\n\treturn false#' \ + -i "${MY_S}/sandbox/forcedevmode.go" || die + grep -q 'panic("USE=forced-devmode is disabled")' "${MY_S}/sandbox/forcedevmode.go" || die "failed to disable forced-devmode" + fi + + sed -i 's:command -v git >/dev/null:false:' -i "${MY_S}/mkversion.sh" || die + + pushd "${MY_S}" >/dev/null || die + ./mkversion.sh "${PV}" + popd >/dev/null || die + pushd "${MY_S}/cmd" >/dev/null || die + eautoreconf +} + +src_configure() { + SNAPD_MAKEARGS=( + "BINDIR=${EPREFIX}/usr/bin" + "DBUSSERVICESDIR=${EPREFIX}/usr/share/dbus-1/services" + "LIBEXECDIR=${EPREFIX}/usr/lib" + "SNAP_MOUNT_DIR=${EPREFIX}/var/lib/snapd/snap" + "SYSTEMDSYSTEMUNITDIR=$(systemd_get_systemunitdir)" + ) + export CGO_ENABLED="1" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + + pushd "${MY_S}/cmd" >/dev/null || die + econf --libdir="${EPREFIX}/usr/lib" \ + --libexecdir="${EPREFIX}/usr/lib/snapd" \ + $(use_enable apparmor) \ + --enable-nvidia-biarch \ + --with-snap-mount-dir="${EPREFIX}/var/lib/snapd/snap" +} + +src_compile() { + export -n GOCACHE XDG_CACHE_HOME + export GO111MODULE=off GOBIN="${S}/bin" GOPATH="${S}" + + local file + for file in "${MY_S}/po/"*.po; do + msgfmt "${file}" -o "${file%.po}.mo" || die + done + + emake -C "${MY_S}/data" "${SNAPD_MAKEARGS[@]}" + + local -a flags=(-buildmode=pie -ldflags "-s -linkmode external -extldflags '${LDFLAGS}'" -trimpath) + local -a staticflags=(-buildmode=pie -ldflags "-s -linkmode external -extldflags '${LDFLAGS} -static'" -trimpath) + + local cmd + for cmd in snap snapd snap-bootstrap snap-failure snap-preseed snap-recovery-chooser snap-repair snap-seccomp; do + go build -o "${GOBIN}/${cmd}" "${flags[@]}" \ + -v -x "github.com/snapcore/${PN}/cmd/${cmd}" + [[ -e "${GOBIN}/${cmd}" ]] || die "failed to build ${cmd}" + done + for cmd in snapctl snap-exec snap-update-ns; do + go build -o "${GOBIN}/${cmd}" "${staticflags[@]}" \ + -v -x "github.com/snapcore/${PN}/cmd/${cmd}" + [[ -e "${GOBIN}/${cmd}" ]] || die "failed to build ${cmd}" + done +} + +src_install() { + emake -C "${MY_S}/data" install "${SNAPD_MAKEARGS[@]}" DESTDIR="${D}" + emake -C "${MY_S}/cmd" install "${SNAPD_MAKEARGS[@]}" DESTDIR="${D}" + + if use apparmor; then + mv "${ED}/etc/apparmor.d/usr.lib.snapd.snap-confine"{,.real} || die + keepdir /var/lib/snapd/apparmor/profiles + fi + keepdir /var/lib/snapd/{apparmor/snap-confine,cache,cookie,snap,void} + fperms 700 /var/lib/snapd/{cache,cookie} + + dobin "${GOBIN}/"{snap,snapctl} + ln "${ED}/usr/bin/snapctl" "${ED}/usr/lib/snapd/snapctl" || die + + exeinto /usr/lib/snapd + doexe "${GOBIN}/"{snapd,snap-bootstrap,snap-failure,snap-exec,snap-preseed,snap-recovery-chooser,snap-repair,snap-seccomp,snap-update-ns} \ + "${MY_S}/"{cmd/snap-discard-ns/snap-discard-ns,cmd/snap-gdb-shim/snap-gdb-shim,cmd/snap-mgmt/snap-mgmt} \ + "${MY_S}/data/completion/bash/"{complete.sh,etelpmoc.sh,} + + dobashcomp "${MY_S}/data/completion/bash/snap" + + insinto /usr/share/zsh/site-functions + doins "${MY_S}/data/completion/zsh/_snap" + + insinto "/usr/share/polkit-1/actions" + doins "${MY_S}/data/polkit/io.snapcraft.snapd.policy" + + dodoc "${MY_S}/packaging/ubuntu-16.04/changelog" + domo "${MY_S}/po/"*.mo + + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog + xdg_desktop_database_update + + if use apparmor && [[ -z ${ROOT} && -e /sys/kernel/security/apparmor/profiles && + $(wc -l < /sys/kernel/security/apparmor/profiles) -gt 0 ]]; then + apparmor_parser -r "${EPREFIX}/etc/apparmor.d/usr.lib.snapd.snap-confine.real" + fi +} + +pkg_postrm() { + xdg_desktop_database_update +} |