summaryrefslogtreecommitdiff
path: root/app-emulation/snapd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-11-28 20:40:51 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-11-28 20:40:51 +0000
commit9c417bacd51da6d8b57fa9f37425161d30d4b95b (patch)
tree47c9d6e4243f39a1f48afd54c969b65b00a5c649 /app-emulation/snapd
parentd934827bf44b7cfcf6711964418148fa60877668 (diff)
gentoo resync : 28.11.2020
Diffstat (limited to 'app-emulation/snapd')
-rw-r--r--app-emulation/snapd/Manifest4
-rw-r--r--app-emulation/snapd/snapd-2.47.1-r1.ebuild1
-rw-r--r--app-emulation/snapd/snapd-2.48.ebuild179
3 files changed, 182 insertions, 2 deletions
diff --git a/app-emulation/snapd/Manifest b/app-emulation/snapd/Manifest
index 0837da3f0f9e..5f4735612ac5 100644
--- a/app-emulation/snapd/Manifest
+++ b/app-emulation/snapd/Manifest
@@ -1,4 +1,6 @@
AUX README.gentoo 1941 BLAKE2B dd25269f2aaaea693701d74511d632bc45f2c99954ae683cb81d4df41c4c1f8007bb6c337234e46bfc5973aa7e8356cd12ac510e9109eca09890cbc42bd184bb SHA512 5b522e6c29bdad84a71245fa1f0289e9cfed0501d936b433829f66ef9d655f3cc13d6bca29beeae2c00e1b68f9fa30058608b9c4cde86ba66eab67bd011c9d00
DIST snapd-2.47.1.tar.xz 3664756 BLAKE2B 90cb117ea385890c38c6efdecd3652c115158ad769858ebe1a5035d37c9543da5b2a8768ce4f56cfcee053701d308f826bf7993d9b5f9d5313f2840ca829ab23 SHA512 e08dd7057b85b970a1177996c483d3f663b1424cdbf6643a69923a7012d38fc13109b449ce3a2c5c8d65e5836f93a36567f2f641a62caea6e9989a458f7f2892
-EBUILD snapd-2.47.1-r1.ebuild 5605 BLAKE2B c7ab087434b5531b65eb87c295d372297422a8461ec9fb3e0eb5cdde5167d8846e3d455bb2faa5dddaca9c6761129bb130870754c7c94c279b2a396f00d6ac22 SHA512 1401cbc19e4969ebccc033560ac584f6032c583711a64d375391668931a145187d7899991b3d19714da7e4ae4be2053d7ae4badf64f46371cb8da98aef9b457f
+DIST snapd-2.48.tar.xz 3757292 BLAKE2B 4d1fd4b9ff3bd7cf05ebf0e27db4bcc87b5de689be470b4c62758e411e9d99a541ae084c7b1afe4ede44ad6dce19a53b337dcddc18d0b82957ef537f466e720a SHA512 27e1924d86296a969cd18980d6100c8e41be66f2ad0214ac2857580a2686b1e7ef01e2561c6ed532106eadb1ac2d5fd070ef9eb05e5fabfb8fa9a98456259b89
+EBUILD snapd-2.47.1-r1.ebuild 5572 BLAKE2B ae6c639cdda970dd44a23025b735ca370d976279f7a311892eeb8c802e52c2ae6c4c611c3160ca933d9409aab5b31a4e046d4614a79d5aeb2e80f29e80a73157 SHA512 d09ab7989bff32bf1f257573c12a7c50c490e154580c87f852ff935a6990901d5f0f7b90bf2a8c49c51ffbeb5ba2e342808fd543f0d9141ed066b8d125091cbd
+EBUILD snapd-2.48.ebuild 5344 BLAKE2B 445ce9232da1d6b881154b2dd033a170e576133496f40611087e8490f855976a35f02a75d17b7cc65055deb5a84f484bbe1ec68cce8511f9cffba953a924b697 SHA512 1b42ad9a59579d7fc44d2afdb975b6dbbd70f9579d5ca8eec72ad4d91f695482489de6e74eff820daf5afbc952be0d24522c5325af9d8d75cd132c44ce82ce98
MISC metadata.xml 635 BLAKE2B b3ed2d2b0fa24d4f06a0ff8a01391856432c6cb97eca89d49bafccbd1f5421073f4d5366484b784e8683d288e26908306a5abbe3e1766e784c1effd2f29ee3fd SHA512 e9319595c1e6b96c2907010873d5793b981c88b34bc1df2f3f6e34ef48ba7bb9b98d32419372688a48ec4d8310083055a6be735e9bcc6e59df2ed162e311ea1e
diff --git a/app-emulation/snapd/snapd-2.47.1-r1.ebuild b/app-emulation/snapd/snapd-2.47.1-r1.ebuild
index b9ba0a354704..863784f7b24c 100644
--- a/app-emulation/snapd/snapd-2.47.1-r1.ebuild
+++ b/app-emulation/snapd/snapd-2.47.1-r1.ebuild
@@ -101,7 +101,6 @@ src_configure() {
export CGO_CFLAGS="${CFLAGS}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
- export CGO_LDFLAGS="${LDFLAGS}"
pushd "${MY_S}/cmd" >/dev/null || die
econf --libdir="${EPREFIX}/usr/lib" \
diff --git a/app-emulation/snapd/snapd-2.48.ebuild b/app-emulation/snapd/snapd-2.48.ebuild
new file mode 100644
index 000000000000..c1a8f5af38ba
--- /dev/null
+++ b/app-emulation/snapd/snapd-2.48.ebuild
@@ -0,0 +1,179 @@
+# Copyright 2020 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"
+
+DEPEND="${RDEPEND}"
+
+BDEPEND="
+ >=dev-lang/go-1.9
+ dev-python/docutils
+ sys-devel/gettext"
+
+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 || cgroupv2\)#//\1\n\tif !apparmorFull || cgroupv2 {\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-confine/snap-device-helper,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
+}