summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorZygmunt Krynicki2016-06-14 11:11:21 +0200
committerZygmunt Krynicki2016-06-14 11:11:21 +0200
commitd2f5486adf290dd67977b9f2443fa898bf405525 (patch)
treee710241885900547a74df0c37f6624d4a015955b /PKGBUILD
downloadaur-d2f5486adf290dd67977b9f2443fa898bf405525.tar.gz
Initial import
Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD85
1 files changed, 85 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..10e0cfca8454
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,85 @@
+# Maintainer: Zygmunt Krynicki <me at zygoon dot pl>
+pkgname=snapd
+pkgver=2.0.8
+pkgrel=1
+pkgdesc="Service and tools for management of snap packages."
+arch=('i686' 'x86_64')
+url="git://github.com/snapcore/snapd"
+license=('GPL3')
+groups=()
+depends=('glibc' 'snap-confine' 'squashfs-tools')
+makedepends=('git' 'go' 'go-tools' 'bzr')
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=('!strip' '!emptydirs')
+install=snapd.install
+source=("https://github.com/snapcore/$pkgname/archive/$pkgver.tar.gz"
+ 'snapd.sh')
+noextract=()
+md5sums=('SKIP'
+ '1d841a1d09ba86945551dfc5c5658b2e')
+
+_gourl=github.com/snapcore/snapd
+
+prepare() {
+ # 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-$pkgver" "$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"
+ cd "$pkgname-$pkgver"
+}
+
+check() {
+ export GOPATH="$srcdir/go"
+ cd "$GOPATH/src/${_gourl}"
+ # FIXME: re-enable this after upstream behaves correctly in absence of .git
+ # ./run-checks --unit
+ # FIXME: this seems to break on C.UTF-8 locale
+ # ./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/"
+ touch "$pkgdir/var/lib/snapd/hostfs/.keep"
+ install -d -m 755 "$pkgdir/var/lib/snapd/lib/gl/"
+ touch "$pkgdir/var/lib/snapd/lib/gl/.keep"
+ # 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 the license
+ install -Dm 755 "$GOPATH/src/${_gourl}/COPYING" "$pkgdir/usr/share/licenses/${pkgname%-git}/COPYING"
+ # Install script to export binaries paths of snaps
+ install -Dm 755 "$srcdir/snapd.sh" "$pkgdir/etc/profile.d/apps-bin-path.sh"
+}