Permalink
Browse files

packaging/arch: convert to -git package, update packaging

Arch packaging updates:
- convert the package to *-git (i.e. built from VCS)
- update conflicts to fully replace 'community' repo snapd package
- update build to properly set up CGO_CFLAGS, CGO_CPPFLAGS, CGO_CXXFLAGS,
  CGO_LDFLAGS to include settings configured in /etc/makepkg.conf

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
  • Loading branch information...
1 parent ebdb523 commit 1ac38e2614cef8e30d17b8800bc18c1abeac9409 @bboozzoo committed Nov 3, 2017
Showing with 27 additions and 17 deletions.
  1. +27 −17 packaging/arch/PKGBUILD
View
@@ -1,10 +1,12 @@
# $Id$
# Maintainer: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: Zygmunt Krynicki <me at zygoon dot pl>
+# Contributor: Maciej Borezcki <maciek.borzecki@gmail.com>
+_pkgname=snapd
pkgbase=snapd
-pkgname=snapd
-pkgver=2.26.14.r1445.g3df03f98b
+pkgname=snapd-git
+pkgver=2.29.r222.gc6d068254
pkgrel=1
arch=('i686' 'x86_64')
url="https://github.com/snapcore/snapd"
@@ -14,19 +16,25 @@ checkdepends=('python' 'squashfs-tools' 'indent' 'shellcheck')
options=('!strip' 'emptydirs')
install=snapd.install
-source=("git+https://github.com/snapcore/$pkgname.git")
+source=("git+https://github.com/bboozzoo/$_pkgname.git#branch=bboozzoo/arch-fixes")
+# source=("git+https://github.com/snapcore/$_pkgname.git")
md5sums=('SKIP')
-_gourl=github.com/snapcore/snapd
+pkgdesc="Service and tools for management of snap packages."
+depends=('snap-confine' 'squashfs-tools' 'libseccomp' 'libsystemd')
+replaces=('snap-confine')
+provides=('snap-confine' $_pkgname)
+conflicts=($_pkgname 'snap-confine')
+_gourl=github.com/snapcore/snapd
pkgver() {
cd "$srcdir/snapd"
git describe --tag | sed -r 's/([^-]*-g)/r\1/; s/-/./g'
}
prepare() {
- cd "$pkgname"
+ cd "$_pkgname"
# Use $srcdir/go as our GOPATH
export GOPATH="$srcdir/go"
@@ -35,9 +43,9 @@ prepare() {
# 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}"
+ ln --no-target-directory -fs "$srcdir/$_pkgname" "$GOPATH/src/${_gourl}"
# Patch snap-seccomp build flags not to link libseccomp statically.
- sed -i -e 's/-Wl,-Bstatic -lseccomp -Wl,-Bdynamic/-lseccomp/' "$srcdir/$pkgname/cmd/snap-seccomp/main.go"
+ sed -i -e 's/-Wl,-Bstatic -lseccomp -Wl,-Bdynamic/-lseccomp/' "$srcdir/$_pkgname/cmd/snap-seccomp/main.go"
}
build() {
@@ -54,12 +62,18 @@ build() {
# Generate the real systemd units out of the available templates
make -C data/systemd all
+ export CGO_ENABLED="1"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+
# Build/install snap and snapd
- go install "${_gourl}/cmd/snap"
- go install "${_gourl}/cmd/snapctl"
- go install "${_gourl}/cmd/snapd"
- go install "${_gourl}/cmd/snap-update-ns"
- go install "${_gourl}/cmd/snap-seccomp"
+ go install -x -v "${_gourl}/cmd/snap"
+ go install -x -v "${_gourl}/cmd/snapctl"
+ go install -x -v "${_gourl}/cmd/snapd"
+ go install -x -v "${_gourl}/cmd/snap-update-ns"
+ go install -x -v "${_gourl}/cmd/snap-seccomp"
# Build snap-confine
cd cmd
@@ -89,16 +103,12 @@ check() {
# here as they are designed to pass on a clean tree, before anything else is
# done, not after building the tree.
# ./run-checks --static
- make -C cmd -k check
+ make -C cmd -k check
mv $srcdir/xxx-info data/info
}
package() {
- pkgdesc="Service and tools for management of snap packages."
- depends=('snap-confine' 'squashfs-tools' 'libseccomp' 'libsystemd')
- replaces=('snap-confine')
- provides=('snap-confine')
export GOPATH="$srcdir/go"
# Ensure that we have /var/lib/snapd/{hostfs,lib/gl}/ as they are required by snap-confine

0 comments on commit 1ac38e2

Please sign in to comment.