app-emulation/buildah: version bump to 1.7.1
[gentoo.git] / app-emulation / buildah / buildah-1.7.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit bash-completion-r1 golang-vcs-snapshot
6
7 KEYWORDS="~amd64"
8 DESCRIPTION="A tool that facilitates building OCI images"
9 HOMEPAGE="https://github.com/containers/buildah"
10 LICENSE="Apache-2.0"
11 SLOT="0"
12 IUSE="ostree selinux"
13 EGO_PN="${HOMEPAGE#*//}"
14 EGIT_COMMIT="v${PV}"
15 GIT_COMMIT="93747b1"
16 SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
17 RDEPEND="app-crypt/gpgme:=
18         app-emulation/skopeo
19         dev-libs/libgpg-error:=
20         dev-libs/libassuan:=
21         sys-fs/lvm2:=
22         sys-libs/libseccomp:=
23         selinux? ( sys-libs/libselinux:= )"
24 DEPEND="${RDEPEND}"
25 RESTRICT="test"
26 REQUIRED_USE="!selinux? ( !ostree )"
27 S="${WORKDIR}/${P}/src/${EGO_PN}"
28
29 src_prepare() {
30         default
31         sed -e 's|^\(GIT_COMMIT ?= \).*|\1'${GIT_COMMIT}'|' -i Makefile || die
32
33         [[ -f ostree_tag.sh ]] || die
34         use ostree || { echo -e "#!/bin/sh\necho containers_image_ostree_stub" > \
35                 ostree_tag.sh || die; }
36
37         [[ -f selinux_tag.sh ]] || die
38         use selinux || { echo -e "#!/bin/sh\ntrue" > \
39                 selinux_tag.sh || die; }
40 }
41
42 src_compile() {
43         env -u GOCACHE -u XDG_CACHE_HOME GOPATH="${WORKDIR}/${P}" emake all
44 }
45
46 src_install() {
47         dodoc CHANGELOG.md CONTRIBUTING.md README.md install.md troubleshooting.md
48         doman docs/*.1
49         dodoc -r docs/tutorials
50         dobin ${PN} imgtype
51         dobashcomp contrib/completions/bash/buildah
52 }
53
54 src_test() {
55         GOPATH="${WORKDIR}/${P}" emake test-unit
56 }