summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Redaelli2016-07-18 18:00:12 +0200
committerTimothy Redaelli2016-07-18 18:00:12 +0200
commit915ea91ebcfa7a5582abdd6363a74935580b2d4d (patch)
tree506a748e958364009c47615ac1ac5fc87bcca218
downloadaur-915ea91ebcfa7a5582abdd6363a74935580b2d4d.tar.gz
first commit
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD87
-rw-r--r--disable-devmode-enforcing.patch32
-rw-r--r--fix_test.patch33
-rw-r--r--snapd.install15
-rw-r--r--snapd.sh10
6 files changed, 208 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..6fa4bb73b0fd
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = snapd-confinement
+ pkgdesc = Service and tools for management of snap packages (with confinement enabled).
+ pkgver = 2.0.10
+ pkgrel = 1
+ url = https://github.com/snapcore/snapd
+ install = snapd.install
+ arch = i686
+ arch = x86_64
+ license = GPL3
+ checkdepends = python
+ makedepends = git
+ makedepends = go
+ makedepends = go-tools
+ makedepends = bzr
+ depends = snap-confine-apparmor
+ depends = squashfs-tools
+ conflicts = snapd
+ replaces = snapd
+ options = !strip
+ options = emptydirs
+ source = git+https://github.com/snapcore/snapd.git#tag=2.0.10
+ source = snapd.sh
+ source = fix_test.patch
+ source = disable-devmode-enforcing.patch
+ md5sums = SKIP
+ md5sums = 1d841a1d09ba86945551dfc5c5658b2e
+ md5sums = 7fd19e053051825b189914cedb95c3e7
+ md5sums = cf60668da3dbce5a779aec3c52c69528
+
+pkgname = snapd-confinement
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c38937ce4079
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,87 @@
+# $Id$
+# Maintainer: Timothy Redaelli <timothy.redaelli@gmail.com>
+# Contributor: Zygmunt Krynicki <me at zygoon dot pl>
+
+pkgname=snapd-confinement
+_pkgname=snapd
+pkgver=2.0.10
+pkgrel=1
+pkgdesc="Service and tools for management of snap packages (with confinement enabled)."
+arch=('i686' 'x86_64')
+url="https://github.com/snapcore/snapd"
+license=('GPL3')
+depends=('snap-confine-apparmor' 'squashfs-tools')
+makedepends=('git' 'go' 'go-tools' 'bzr')
+checkdepends=('python')
+conflicts=('snapd')
+replaces=('snapd')
+options=('!strip' 'emptydirs')
+install=snapd.install
+source=("git+https://github.com/snapcore/$_pkgname.git#tag=$pkgver"
+ 'snapd.sh'
+ 'fix_test.patch'
+ 'disable-devmode-enforcing.patch')
+md5sums=('SKIP'
+ '1d841a1d09ba86945551dfc5c5658b2e'
+ '7fd19e053051825b189914cedb95c3e7'
+ 'cf60668da3dbce5a779aec3c52c69528')
+
+_gourl=github.com/snapcore/snapd
+
+prepare() {
+ cd "$_pkgname"
+ patch -Np1 -i "$srcdir/fix_test.patch"
+ patch -Np1 -i "$srcdir/disable-devmode-enforcing.patch"
+
+ # Use $srcdir/go as our GOPATH
+ export GOPATH="$srcdir/go"
+ mkdir -p "$GOPATH"
+ # Have snapd checkout appear in a place suitable for subsequent GOPATH This
+ # way we don't have to go get it again and it is exactly what the tag/hash
+ # above describes.
+ mkdir -p "$(dirname "$GOPATH/src/${_gourl}")"
+ ln --no-target-directory -fs "$srcdir/$_pkgname" "$GOPATH/src/${_gourl}"
+}
+
+build() {
+ export GOPATH="$srcdir/go"
+ # Use get-deps.sh provided by upstream to fetch go dependencies using the
+ # godeps tool and dependencies.tsv (maintained upstream).
+ cd "$GOPATH/src/${_gourl}"
+ ./get-deps.sh
+ # Build/install snap and snapd
+ go install "${_gourl}/cmd/snap"
+ go install "${_gourl}/cmd/snapd"
+}
+
+check() {
+ export GOPATH="$srcdir/go"
+ cd "$GOPATH/src/${_gourl}"
+ ./run-checks --unit
+ ./run-checks --static
+}
+
+package() {
+ export GOPATH="$srcdir/go"
+ # Ensure that we have /var/lib/snapd/{hostfs,lib/gl}/ as they are required by snap-confine
+ # for constructing some bind mounts around.
+ install -d -m 755 "$pkgdir/var/lib/snapd/hostfs/" "$pkgdir/var/lib/snapd/lib/gl/"
+ # Install the refresh timer and service for updating snaps
+ install -d -m 755 "$pkgdir/usr/lib/systemd/system/"
+ install -m 644 "$GOPATH/src/${_gourl}/debian/snapd.refresh.service" "$pkgdir/usr/lib/systemd/system"
+ install -m 644 "$GOPATH/src/${_gourl}/debian/snapd.refresh.timer" "$pkgdir/usr/lib/systemd/system"
+ # Install the snapd socket and service for the main daemon
+ install -m 644 "$GOPATH/src/${_gourl}/debian/snapd.service" "$pkgdir/usr/lib/systemd/system"
+ install -m 644 "$GOPATH/src/${_gourl}/debian/snapd.socket" "$pkgdir/usr/lib/systemd/system"
+ # Install legacy "frameworks" units
+ # TODO: drop those when they go away upstream
+ install -m 644 "$GOPATH/src/${_gourl}/debian/snapd.frameworks-pre.target" "$pkgdir/usr/lib/systemd/system"
+ install -m 644 "$GOPATH/src/${_gourl}/debian/snapd.frameworks.target" "$pkgdir/usr/lib/systemd/system"
+ # Install snap and snapd executables
+ install -d -m 755 "$pkgdir/usr/bin/"
+ install -m 755 "$GOPATH/bin/snap" "$pkgdir/usr/bin/"
+ install -d -m 755 "$pkgdir/usr/lib/snapd"
+ install -m 755 "$GOPATH/bin/snapd" "$pkgdir/usr/lib/snapd/"
+ # Install script to export binaries paths of snaps
+ install -Dm 755 "$srcdir/snapd.sh" "$pkgdir/etc/profile.d/apps-bin-path.sh"
+}
diff --git a/disable-devmode-enforcing.patch b/disable-devmode-enforcing.patch
new file mode 100644
index 000000000000..f55c1009dc2f
--- /dev/null
+++ b/disable-devmode-enforcing.patch
@@ -0,0 +1,32 @@
+--- snapd/release/release.go.bak 2016-07-18 16:43:17.137859989 +0200
++++ snapd/release/release.go 2016-07-18 16:50:05.033109215 +0200
+@@ -43,6 +43,10 @@
+ switch os.ID {
+ case "neon":
+ fallthrough
++ case "arch":
++ fallthrough
++ case "parabola":
++ fallthrough
+ case "ubuntu":
+ return false
+
+--- snapd/release/release_test.go.bak 2016-07-18 16:48:05.185499404 +0200
++++ snapd/release/release_test.go 2016-07-18 16:49:34.725213399 +0200
+@@ -107,7 +107,7 @@
+ devmode bool
+ }{
+ // Please keep this list sorted
+- {id: "arch", devmode: true},
++ {id: "arch", devmode: false},
+ {id: "debian", devmode: true},
+ {id: "elementary", devmode: true},
+ {id: "elementary", idVersion: "0.4", devmode: false},
+@@ -115,6 +115,7 @@
+ {id: "gentoo", devmode: true},
+ {id: "neon", devmode: false},
+ {id: "opensuse", devmode: true},
++ {id: "parabola", devmode: false},
+ {id: "rhel", devmode: true},
+ {id: "ubuntu", devmode: false},
+ }
diff --git a/fix_test.patch b/fix_test.patch
new file mode 100644
index 000000000000..83b62446687e
--- /dev/null
+++ b/fix_test.patch
@@ -0,0 +1,33 @@
+From b66d3ea328ee42d3d4f56ed9736c315833dee67d Mon Sep 17 00:00:00 2001
+From: Timothy Redaelli <timothy.redaelli@gmail.com>
+Date: Fri, 1 Jul 2016 15:28:46 +0200
+Subject: [PATCH] Fix ./run-checks --static
+
+Python doesn't like LANG=C.UTF-8 so just open the files
+using UTF-8 directly
+---
+ mdlint.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mdlint.py b/mdlint.py
+index 533c812..a1bd4ac 100755
+--- a/mdlint.py
++++ b/mdlint.py
+@@ -7,7 +7,7 @@
+ # http://pythonhosted.org/Markdown/
+
+ import sys
+-
++import codecs
+
+ def lint_li(fname, text):
+ """Ensure that the list-items are multiplies of 4"""
+@@ -23,7 +23,7 @@ def lint(md_files):
+ """lint all md files"""
+ all_clean = True
+ for md in md_files:
+- with open(md) as f:
++ with codecs.open(md, "r", "utf-8") as f:
+ buf = f.read()
+ for fname, func in globals().items():
+ if fname.startswith("lint_"):
diff --git a/snapd.install b/snapd.install
new file mode 100644
index 000000000000..cd80f1da7dc6
--- /dev/null
+++ b/snapd.install
@@ -0,0 +1,15 @@
+## arg 1: the new package version
+post_install() {
+ echo
+ echo 'To use snapd start/enable the snapd.socket'
+ echo
+ echo 'If you want your apps to be automatically updated'
+ echo 'from the store start/enable the snapd.refresh.timer'
+ echo
+ echo 'NOTE: Desktop entries show up after logging in again'
+ echo ' or rebooting after snapd installation'
+ echo
+ echo 'For more informations, see https://wiki.archlinux.org/index.php/Snapd'
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/snapd.sh b/snapd.sh
new file mode 100644
index 000000000000..76580b6c56ba
--- /dev/null
+++ b/snapd.sh
@@ -0,0 +1,10 @@
+# Expand the $PATH to include /snaps/bin which is what snappy applications
+# use
+PATH=$PATH:/snap/bin
+
+if [ -z "$XDG_DATA_DIRS" ]; then
+ XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
+else
+ XDG_DATA_DIRS="$XDG_DATA_DIRS":/var/lib/snapd/desktop
+fi
+export XDG_DATA_DIRS