# Contributor: David Huffman <storedbox@outlook.com>
# Maintainer: David Huffman <storedbox@outlook.com>

setvar _gosu_repo = ''github.com/tianon/gosu''
setvar _gosu_ver = '1.9'
setvar _gosu_src = ""gosu-$_gosu_ver""

setvar _runc_repo = ''github.com/opencontainers/runc''
setvar _runc_ver = '0.1.0'
setvar _runc_src = ""runc-$_runc_ver""

setvar pkgname = 'gosu'
setvar pkgver = "$_gosu_ver"
setvar pkgrel = '0'
setvar pkgdesc = ""Simple Go-based setuid+setgid+setgroups+exec""
setvar url = ""https://github.com/tianon/gosu""
setvar arch = ""all""
setvar license = ""GPL3""
setvar depends = """"
setvar depends_dev = """"
setvar makedepends = ""$depends_dev coreutils go""
setvar install = """"
setvar subpackages = """"
setvar source = ""https://github.com/tianon/gosu/archive/$_gosu_ver/$_gosu_src.tar.gz
        https://github.com/opencontainers/runc/archive/v$_runc_ver/$_runc_src.tar.gz""

setvar builddir = ""$srcdir"/$_gosu_repo"
proc prepare {
	mkdir -p $_gosu_repo $_runc_repo
	mv -T $_gosu_src $_gosu_repo || return 1
	mv -T $_runc_src $_runc_repo || return 1

	default_prepare
}

proc build {
	cd $builddir'
	CGO_ENABLED=0'" GOPATH="$startdir:$srcdir/$_runc_repo/Godeps/_workspace"" \
		go build -v -ldflags '-s -w' || return 1
}

proc package {
	cd $builddir
	local bindir="$pkgdir/usr/bin"
	mkdir -p $bindir || return 1
	cp gosu $bindir || return 1
}

setvar md5sums = ""9c0dfb590c317cde7592652764f2c341  gosu-1.9.tar.gz
73971b4020a39445f071c3b3d5361a30  runc-0.1.0.tar.gz""
setvar sha256sums = ""12770f2127ec436a6e368750258631d1eda3f5fe647059f2219fbd27d5d6d838  gosu-1.9.tar.gz
681d6d89541ae2e06757f999a242a1f97bbcb1ad6e10f4cdee287ec4a9d2bff9  runc-0.1.0.tar.gz""
setvar sha512sums = ""f4bc1fa812f7588b657fbab3394407133a42422e54500c9e9adb9010f550b45839d7bfa3bbb79241a7c00e67292ba3ff9ffcf5ce7c000d88e6b64ac6f88fb169  gosu-1.9.tar.gz
8a9ff02b0161eda0a730194b0fbf7ad76e8f379992e74061ef49302da3492fd0c53f06db9153ded4d934d67bbf6f4291d6154254f1b924ef73c97c44cd14ffcf  runc-0.1.0.tar.gz""