Line 0
Link Here
|
|
|
1 |
# Copyright 2023 Gentoo Authors |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
EAPI=8 |
5 |
inherit go-module linux-info |
6 |
|
7 |
DESCRIPTION="Work with remote container images registries" |
8 |
HOMEPAGE="https://github.com/containers/skopeo" |
9 |
if [[ ${PV} == *9999* ]]; then |
10 |
inherit git-r3 |
11 |
EGIT_REPO_URI="https://github.com/containers/skopeo.git" |
12 |
else |
13 |
SRC_URI="https://github.com/containers/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
14 |
KEYWORDS="~amd64 ~arm64" |
15 |
fi |
16 |
LICENSE="Apache-2.0 BSD BSD-2 CC-BY-SA-4.0 ISC MIT" |
17 |
SLOT="0" |
18 |
IUSE="btrfs device-mapper rootless" |
19 |
|
20 |
RDEPEND=" |
21 |
app-containers/containers-common |
22 |
>=app-crypt/gpgme-1.5.5:= |
23 |
>=dev-libs/libassuan-2.4.3:= |
24 |
btrfs? ( >=sys-fs/btrfs-progs-4.0.1 ) |
25 |
device-mapper? ( >=sys-fs/lvm2-2.02.145:= ) |
26 |
rootless? ( sys-apps/shadow:= ) |
27 |
" |
28 |
# TODO: Is this really needed? |
29 |
# dev-libs/libgpg-error:= |
30 |
DEPEND="${RDEPEND}" |
31 |
BDEPEND="dev-go/go-md2man" |
32 |
|
33 |
RESTRICT="test" |
34 |
PATCHES=( "${FILESDIR}"/makefile-1.13.3.patch ) |
35 |
|
36 |
pkg_setup() { |
37 |
use btrfs && CONFIG_CHECK+=" ~BTRFS_FS" |
38 |
use device-mapper && CONFIG_CHECK+=" ~MD" |
39 |
linux-info_pkg_setup |
40 |
} |
41 |
src_prepare() { |
42 |
default |
43 |
local file |
44 |
for file in btrfs_installed_tag btrfs_tag libdm_tag libsubid_tag; do |
45 |
[[ -f hack/"${file}".sh ]] || die |
46 |
done |
47 |
|
48 |
echo -e "#!/usr/bin/env bash\n echo" > hack/btrfs_installed_tag.sh || die |
49 |
cat <<-EOF > hack/btrfs_tag.sh || die |
50 |
#!/usr/bin/env bash |
51 |
$(usex btrfs echo 'echo exclude_graphdriver_btrfs btrfs_noversion') |
52 |
EOF |
53 |
|
54 |
cat <<-EOF > hack/libdm_tag.sh || die |
55 |
#!/usr/bin/env bash |
56 |
$(usex device-mapper echo "echo libdm_no_deferred_remove") |
57 |
EOF |
58 |
|
59 |
cat <<-EOF > hack/libsubid_tag.sh || die |
60 |
#!/usr/bin/env bash |
61 |
$(usex rootless "echo libsubid" echo) |
62 |
EOF |
63 |
} |
64 |
|
65 |
src_compile() { |
66 |
# export variables which 'make install' is also going to use |
67 |
export PREFIX="${EPREFIX}/usr" \ |
68 |
CONTAINERSCONFDIR="${EPREFIX}/etc/containers" |
69 |
# compile binary, docs, completions |
70 |
emake all completions |
71 |
} |