summaryrefslogtreecommitdiff
path: root/packages/sys-apps/runc/runc-1.0.0-rc8.exheres-0
blob: 31f02a248207f9b16690cd1af1e82694b2379225 (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
56
57
58
59
60
61
62
63
64
65
66
67
# Copyright 2016 Marc-Antoine Perennou <marc-antoine.perennou@clever-cloud.com>
# Copyright 2016 Arnaud Lefebvre <arnaud.lefebvre@clever-cloud.com>
# Distributed under the terms of the GNU General Public License v2

SUMMARY="runc container cli tools"
DESCRIPTION="
runc is a CLI tool for spawning and running containers according to the OCI specification.
"
BUGS_TO="marc-antoine.perennou@clever-cloud.com"
LICENCES="Apache-2.0"

COMMIT="425e105d5a03fabd737a126ad93d62a9eeede87f"

require bash-completion
require github [ user="opencontainers" ]

HOMEPAGE="https://www.opencontainers.org/ ${HOMEPAGE}"
DOWNLOADS="https://github.com/opencontainers/${PN}/releases/download/v${PV}/${PN}.tar.xz -> ${PNV}.tar.xz"

SLOT="0"
PLATFORMS="~amd64 ~armv7 ~armv8"

# tests need to be run in docker
# Do not strip Go binaries
RESTRICT="test strip"

MYOPTIONS="
    man-pages [[ description = [ Build and install man pages ] ]]
    seccomp [[ description = [ Syscall filtering ] ]]
    selinux [[ description = [ selinux process and mount labeling ] ]]
"

DEPENDENCIES="
    build:
        dev-lang/go[>=1.10]
        man-pages? ( dev-golang/go-md2man )
    build+run:
        seccomp? ( sys-libs/libseccomp )
"

GOWORK=src/github.com/opencontainers

src_prepare() {
    default

    edo mkdir -p ${GOWORK}
    edo ln -s ${WORK} ${GOWORK}/${PN}
    edo sed -i "s/^COMMIT :=/COMMIT ?=/" Makefile
}

src_compile() {
    local options=(
        $(optionq seccomp && echo seccomp)
        $(optionq selinux && echo selinux)
    )

    cd ${GOWORK}/runc
    GOPATH="$(pwd)" emake BUILDTAGS="$(echo ${options[@]})" COMMIT="${COMMIT}"

    optionq man-pages && edo man/md2man-all.sh
}

src_install() {
    dobin runc
    optionq man-pages && doman man/man8/*.8
    dobashcompletion contrib/completions/bash/runc
}