summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 832f60f37e3d1c30ccc4cbdcb5f422b49297e2aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Maintainer: Wei Li <liwei@anbutu.com>
pkgname=hyperd-git
pkgver=v1.0.0.r5.f2baf06
pkgrel=1
pkgdesc="HyperContainer Daemon"
arch=('i686' 'x86_64')
url="https://github.com/hyperhq/hyperd"
license=('Apache')
depends=('libvirt')
makedepends=('git' 'go' 'device-mapper' 'sqlite3' 'libvirt' 'btrfs-progs')
optdepends=('hyperstart: boot files for hyperd instances')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
options=('!strip' '!emptydirs')
source=("${pkgname%-git}::git+${url}.git"
	'btrfs-progs-4.5.diff')
md5sums=('SKIP'
	 '4858adb29a450c9e5775e4cae875fae7')

pkgver() {
	cd "$srcdir/${pkgname%-git}"
	printf "%s" "$(git describe --tags --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

prepare() {
	cd "$srcdir/${pkgname%-git}"
	# https://github.com/hyperhq/hyperd/issues/643
	# https://github.com/moby/moby/commit/a038cccf88998814249a7a40b71a33a680e3f02f
	patch -Np0 -i "$srcdir/btrfs-progs-4.5.diff"
}

build() {
	cd "$srcdir/${pkgname%-git}"
	local _srcpath="src/github.com/hyperhq/"
	export GOPATH="${srcdir}"
	install -d "$GOPATH/$_srcpath"
	ln -sf "$(pwd)" "$GOPATH/$_srcpath/hyperd"
	cd "$GOPATH/$_srcpath/hyperd"

	./autogen.sh
	./configure --prefix=/usr
	make
}

package() {
	cd "$srcdir/${pkgname%-git}"
	install -D cmd/hyperctl/hyperctl "${pkgdir}/usr/bin/hyperctl"
	install    cmd/hyperd/hyperd     "${pkgdir}/usr/bin/hyperd"
	install    cmd/vmlogd/vmlogd     "${pkgdir}/usr/bin/vmlogd"
	install -D -m644 package/dist/etc/hyper/config "${pkgdir}/etc/hyper/config"
	install -D -m644 package/dist/lib/systemd/system/hyperd.service \
		"${pkgdir}/usr/lib/systemd/system/hyperd.service"
	install    -m644 package/dist/lib/systemd/system/hyper-vmlogd.service \
		"${pkgdir}/usr/lib/systemd/system/hyper-vmlogd.service"
}