Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gentoomaniac #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# gentoo-snappy
An unofficial Gentoo Overlay that enables installation of Canonical's "Snappy" backbone.

## Add the Overlay
Gentoo's currently preferred Overlay system is through using a git sync. What follows are abbreviated instructions assuming that you already have the `dev-vcs/git` and `app-portage/layman` packages installed.
## Add the Overlay using layman
Gentoo's currently preferred Overlay system is through using a git sync. What follows are abbreviated instructions assuming that you already have the `dev-vcs/git` and `app-portage/layman` packages installed. (there are other methods, however layman allows you to keep your packages organised. Compare it to ubuntu's ppas if you must)

Add the overlay:

Expand All @@ -12,12 +12,40 @@ Sync overlay:

# layman -S

## Add the Overlay Manually ##

Gentoo's currently preferred Overlay system is through using a git sync. What follows are abbreviated instructions assuming that you already have the `dev-vcs/git` package installed. please note this is a more complex process that many may view as having no true benefit.

Next, create a custom `/etc/portage/repos.conf` entry for the **gentoo-snappy** overlay, so Portage knows what to do. Make sure that `/etc/portage/repos.conf` exists, and is a directory. Then, use your text editor without line wrapping:

# nano -w /etc/portage/repos.conf/gentoo-snappy.conf

and put the following text in the file:

```
[gentoo-snappy]

# An unofficial overlay that supports the installation of the "Snappy" backbone.
# Maintainer: Clayton "kefnab" Dobbs ([email protected])
# Upstream Maintainer: Zygmunt "zyga" Krynicki ([email protected])

location = /usr/local/portage/gentoo-snappy
sync-type = git
sync-uri = https://github.com/zyga/gentoo-snappy.git
priority = 50
auto-sync = yes
```

Then run:

# emaint sync --repo gentoo-snappy

## Packages
### `app-emulation/snapd`
Based off of Docker being available within this portage category, I have placed snapd (the guts of snappy) here as well. Installation of this package will draw in `sys-apps/snap-confine` as a dependency.

### `sys-apps/snap-confine`
Provides sandbox type isolation of individual snap packages. This is a dependency of `snapd` proper.
Provides sandbox type isolation of individual snap packages. This is a dependency of `snapd` proper. Although newer versions seem to no longer require snap-confine due to a merge, it is still required for the older versions which i see no real reason to remove, gentoo is about choice after all, if you want an older version feel free.

## Installation

Expand All @@ -26,3 +54,6 @@ Provides sandbox type isolation of individual snap packages. This is a dependen
## Post-installation

# systemctl enable --now snapd.service
## FAQ
### why isn't there an option without systemd?
good question, with openrc being the more popular init system, you would think it would be an available option. sadly this is not a mistake, snappy is designed in such a way that systemd is required. obviously much like funtoo has proven with their solution with gnome, it is theoretically possible. so possible in fact, that early ubuntu (which used upstart) even used a modified version of systemd to run snappy. however to this best of my knowledge there is no updated version of that, hence no openrc compatible ebuilds. feel free to contribute and make this otherwise.
2 changes: 2 additions & 0 deletions app-emulation/snapd/Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ DIST snapd-2.14.2_p1.tar.gz 641768 SHA256 efc6c6b55d8fb6d79818750373ce173f3bc1d7
DIST snapd-2.15.2.tar.gz 684471 SHA256 d9c8c098f74c7ba9215ca0f0bf1083e15db2e150b0d1ee9b11d664c244f9b4cb SHA512 1b05fc66ec2f70e45bebdf280e3270401e268da3691e8b39eaa4f594b29e583342d065bd70a7f6678c13793c0f374944b35647b53e93fb9832367139b61411bb WHIRLPOOL 2c9fa5c6f0404e086cee16c9337e415b6a0e5faa7cdc4a421e12bac174c2be38b7d272c1707323c3ebc34ec6f109b69f368f2ee7cdba6b2e51d60e2332047106
DIST snapd-2.15.tar.gz 682145 SHA256 f23fd7fe737ad0f34a0e153c63a5b7c580eae0cdf64861043699f3420810ad0c SHA512 208c9eae2131d13fde2052e2b66624c497a3b013df222e4b2f84ebdf4e7b00a9c2ae2cf4f7004d583ce00eb9bf7920eda25878ef48a04f2c37aac7403c32501e WHIRLPOOL 0b32583913501692be42e8af963329ada32f8c74adf58600ddb6437c688146eb2faff2ff235e241301e581a4dd680b501f00e2ac2951ec32e87031e61ed5cfdd
DIST snapd-2.27.6.tar.gz 1356457 SHA256 75200afe3c45dd0dd9b162d2f3e6d20e647b8e9fecdd667cf45e694b9a05d859 SHA512 3299cd9e241247c42571600ddba7e8b36dd7d4bd08f8247f872145f4c5a4708cfd6a4a404e6cd8056c75582c76f80cd060d765b832cc889e5bcd28c99e0ceb69 WHIRLPOOL 59566c29b7a980257073af7fd8bfd68eedd16fbbe9b53c86052fa2d9e9d0062bedbd36aae2c2ac50b8ba45c63d3c2fcefb215102e1957822b971b8b0b45f2e27
DIST snapd-2.31.1.tar.gz 1987246 SHA256 15b630811b8b017276767f1e0e8713c5fbf223d7dd90f75a740535652c066d85 SHA512 c5a17734fa1a5d45ec2dbbaa265b362ba541fba6a65db6000f9b98fe54dd3368005a473150cc9a868522112d910af260bb52a875de9e0178a8179869ed2a8f04 WHIRLPOOL 93e29bb21b56fac616a282e5be1db56cb2fd9300580668f6db15cabde1ed994a211b7953ecf2105902b471f21b44551ef22be7043f3283a1c16a1273b0420314
EBUILD snapd-2.0.9.ebuild 2824 SHA256 4c17c1b80fd3bf233bded4d57273daedf0952b9c038341cc4389dd37c545cf68 SHA512 600c2f3d3cb37314f402b582a5164b4988e6716c3cfe2c1e7cc43d584a3a3241eeef110da57ed2d81d61efc553e0cfe9fd95274b6fafa8a7e106b6098a7d883c WHIRLPOOL 07ed7ac20fcb997da295907edbd6cf40e6f3edaf39342d1462616216f3191a6daa86d2bda2577b671a1bd8d39227219795c9fdf24858fc30428cb29a1e155e56
EBUILD snapd-2.13.ebuild 2898 SHA256 5d949d870a80ccd9aa1a6f24853ec1232dfc8b7f3616c5d196a305ecec765abd SHA512 9bfe7d42dd205fffbf584a4d1c872bb1452ca8599e0ef823d78f011780d0f397dadc87ec557524b6e4bf72080778fc19618b5ee8d18664c643d79e20c848092e WHIRLPOOL 23a51305f2feb8f657b55320698a7e7a21a0b37a1be2638f59ac3427e9fd25cd211e6048f30837503e176c1a11eea4d2c340a3f957db0d30e54aa7f047f2ea5a
EBUILD snapd-2.14.1.ebuild 2842 SHA256 c85340df4e20a2da0ed2ba9933430ab9dd2f3b1dc6de1253f5a1bb7a71c04c7a SHA512 758ef90827d9fe9a168b23d180ad14abdae37fb3eca02197bd439a352ef0d01f81bd7c49e6b3604c21b3bcec2ddd9082dbafe32d9b8ed2565b5f1fcb0c6ee2a3 WHIRLPOOL 54dc0e8b31d62506044399b35211eacf3e91f3b69144f2cfe754ccb93bf0be552911bc89b3db3f7f202a4f42d25004bc1d13ef64f978156b908a2f17aa3adbba
EBUILD snapd-2.14.2_p1.ebuild 2933 SHA256 9299752a83988fc871e6638d1228e1f0f570316843013d45e71bc18020fed5a7 SHA512 2d5854ffdba7c1971cc5a409ae60126e60b0bbe7d9ab1293d0cbea035450912055477b4cd2d00cefb0cf9c4dabb6dd035f60fe490fe2130b34e8fa16d545260f WHIRLPOOL c47ad02de8ab908f7cbc571405c4f70f059e41e250092481878227e2a9bda6a7e96366f56afc9b721dcb0f792e60e0ce24ebcc555a22f87f1f0760c6c0dd64ae
EBUILD snapd-2.15.2.ebuild 3066 SHA256 2ea132e38cff04e102a0ba840ce34768ba55eb4ec326944a96eb370029f46e4c SHA512 e072fb9db9b66b1565bb1e5e011f12f2dcaf13e00aa3f9bc05e1db1384f0ed920d684b843bd0b73fb79e2b83124ea9d6fbe84b1c928aaf70ebcae6da9f9a9dc5 WHIRLPOOL 3100b9ff62cb10bedcacbec8b0ea75a1e5391d9d130aa2a16654532e4a11601990061a55c9439300dc6f44fdb263875aafbc8a0ac7b44dd3e714e240ea759066
EBUILD snapd-2.15.ebuild 3066 SHA256 ad9b9430dd80d545c5852e4b865614575e14de7bfcc7e6b303433e155c4c6193 SHA512 beb7cbd670c8a4ab99b643e0170883dba3c2c0de4c34f027c40779ae39a8c4f60d86d57590742ca5aa6488385a249818a7a24827cd5906da4b3af6a7b07938bf WHIRLPOOL 3232aeae27fb4b45094a6590e85120e6b87289f00159b87b8b31c8aa48fb97d6e4d48d47e408a2e1fa574152d3fa0bc2dd30ceb01254e5aac93d1cda2024fa05
EBUILD snapd-2.27.6.ebuild 4372 SHA256 f0956fe477b891128da0aca767045ced2ded28fa2e5b6d9ee8e82f0c85f34eb0 SHA512 cde19bae721ef0cedb177259e55ec8ad381298fc27f135bf1c65da49a1f00ee7844e4cea04d240c87ef78843d18d821404b16f6a97b3f679a71b49234533eb86 WHIRLPOOL 674eb112663b7ed9e90735185177c80dc654c38b12b1998c7df65195518958b3e1da7b48598477750ce0ec3a29f0dfbcf854b6d290c43e5abadfe9435ccd1f99
EBUILD snapd-2.31.1.ebuild 3060 SHA256 a9b2d88ced077ff8bac1cf164dca151c8cb7aafa6c09af84579c18bda8687d33 SHA512 fd5912b0c2310a9d60fb11a00d11c810bee70330d9904041ad435fbc08c535dbfcc9a4fcccbf8c376e7a308ddf4b4a648d247fd141fa089a80aac5a2ef2032a3 WHIRLPOOL be559956dc2e10108791eafcb91f8ffdfa3fcc65756ffaa323783cb70b4ab7eaec6f7626b7e32da7a29018b0e9f76cc34c40f8c207f7306350005410e4b5b726
MISC metadata.xml 559 SHA256 dca8bb735be22924cf63b6a68325ee341216f1e3cd2a6bc0f6a486fe70f14427 SHA512 190cd4e3580e220706210e6a9695c113a0d08e9c30f252a86dafb0ecdb35667014301e3576f8c41018d1b0731cfb02b2ab7f077454e94bed0640c035830f6a55 WHIRLPOOL 851c8d9db5e904a9bc1ba6eff0755c2d02b3d9626144897388f8a6bcca8add667b86b32b689f4163a7b96e791a6aea811a14bc154a9ca9a966a57a7e3c3cc0f2
89 changes: 89 additions & 0 deletions app-emulation/snapd/snapd-2.31.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

inherit golang-vcs-snapshot
#inherit systemd

EGO_PN=github.com/snapcore/snapd
EGO_SRC=github.com/snapcore/snapd/...
EGIT_COMMIT="181f66ac30bc3a2bfb8e83c809019c037d34d1f3"

DESCRIPTION="Service and tools for management of snap packages"
HOMEPAGE="http://snapcraft.io/"
# rather than reference the git commit, it is better to src_uri to the package version (if possible) for future compatibility and ease of reading
# non-standard versioning upstream makes package renaming (below) prudent
SRC_URI="https://github.com/snapcore/${PN}/archive/${PV}.tar.gz -> ${PF}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"

# mirrors are restricted for unofficial packages
RESTRICT="mirror"

RDEPEND="sys-fs/squashfs-tools:*"

# Not sure if the runtime dependencies need to be duplicated in the build dependencies, but added them to be safe
DEPEND="${RDEPEND}
dev-vcs/git
dev-vcs/bzr"
# Original ebuild had blank list of IUSE, so line was removed

# TODO: package all the upstream dependencies
# TODO: ensure that used kernel supports xz compression for squashfs
# TODO: enable tests
# TODO: ship man page for snap
# TODO: use more of the gentoo golang packaging helpers
# TODO: put /var/lib/snpad/desktop on XDG_DATA_DIRS

src_compile() {
# Create a writable GOROOT in order to avoid sandbox violations.
cp -sR "$(go env GOROOT)" "${T}/goroot" || die
rm -rf "${T}/goroot/src/${EGO_SRC}" || die
rm -rf "${T}/goroot/pkg/$(go env GOOS)_$(go env GOARCH)/${EGO_SRC}" || die
export GOROOT="${T}/goroot"
# Exclude $(get_golibdir_gopath) from GOPATH, for bug 577908 which may
# or may not manifest, depending on what libraries are installed.
export GOPATH="${WORKDIR}/${P}"
cd src/${EGO_PN} && ./get-deps.sh
go install -v "${EGO_PN}/cmd/snapd" || die
go install -v "${EGO_PN}/cmd/snap" || die
# go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}/cmd/snapd" || die
}

src_install() {
# Install snap and snapd
export GOPATH="${WORKDIR}/${P}"
exeinto /usr/bin
dobin "$GOPATH/bin/snap"
exeinto /usr/lib/snapd/
doexe "$GOPATH/bin/snapd"
cd "src/${EGO_PN}" || die
# Install systemd units
#systemd_dounit debian/snapd.{service,socket}
#systemd_dounit debian/snapd.refresh.{service,timer}
# Work around https://github.com/zyga/snapd-gentoo/issues/1
#sed -i -e 's/RandomizedDelaySec=/#RandomizedDelaySec=/' debian/snapd.refresh.timer
# NOTE: the two "frameworks" units should be dropped upstream soon
#systemd_dounit debian/snapd.frameworks.target
#systemd_dounit debian/snapd.frameworks-pre.target
# Put /snap/bin on PATH
dodir /etc/profile.d/
echo 'PATH=$PATH:/snap/bin' > ${D}/etc/profile.d/snapd.sh
}

#pkg_postinst() {
# systemctl enable snapd.socket
# systemctl enable snapd.refresh.timer
#}

# added package post-removal instructions for tidying up added services
#pkg_postrm() {
# systemctl disable snapd.service
# systemctl stop snapd.service
# systemctl disable snapd.socket
# systemctl disable snapd.refresh.timer
#}