blob: 8146fe1b9993f69f2ce0d818aa0a565e1885a9c6 (
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
HOMEPAGE = "https://github.com/containers/skopeo"
SUMMARY = "Work with remote images registries - retrieving information, images, signing content"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=7e611105d3e369954840a6668c438584"
DEPENDS = " \
gpgme \
libdevmapper \
lvm2 \
btrfs-tools \
glib-2.0 \
"
inherit go
RDEPENDS:${PN} = " \
gpgme \
libgpg-error \
libassuan \
"
SRC_URI = " \
git://github.com/containers/skopeo;branch=release-1.11;protocol=https \
file://0001-makefile-add-GOBUILDFLAGS-to-go-build-call.patch \
"
SRCREV = "d79588e6c1d2ff2053206a650adc1d30af591908"
PV = "v1.11.2+git${SRCPV}"
GO_IMPORT = "import"
S = "${WORKDIR}/git"
inherit goarch
inherit pkgconfig
inherit container-host
# This CVE was fixed in the container image go library skopeo is using.
# See:
# https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-10214
# https://github.com/containers/image/issues/654
CVE_CHECK_IGNORE += "CVE-2019-10214"
# This disables seccomp and apparmor, which are on by default in the
# go package.
EXTRA_OEMAKE="BUILDTAGS=''"
do_compile() {
export GOARCH="${TARGET_GOARCH}"
# Setup vendor directory so that it can be used in GOPATH.
#
# Go looks in a src directory under any directory in GOPATH but riddler
# uses 'vendor' instead of 'vendor/src'. We can fix this with a symlink.
#
# We also need to link in the ipallocator directory as that is not under
# a src directory.
ln -sfn . "${S}/src/import/vendor/src"
mkdir -p "${S}/src/import/vendor/src/github.com/projectatomic/skopeo"
ln -sfn "${S}/src/import/skopeo" "${S}/src/import/vendor/src/github.com/projectatomic/skopeo"
ln -sfn "${S}/src/import/version" "${S}/src/import/vendor/src/github.com/projectatomic/skopeo/version"
export GOPATH="${S}/src/import/vendor"
# Pass the needed cflags/ldflags so that cgo
# can find the needed headers files and libraries
export CGO_ENABLED="1"
export CFLAGS=""
export LDFLAGS=""
export CGO_CFLAGS="${TARGET_CFLAGS}"
export CGO_LDFLAGS="${TARGET_LDFLAGS}"
cd ${S}/src/import
export GO111MODULE=off
export GOBUILDFLAGS="-trimpath"
export EXTRA_LDFLAGS="-s -w"
oe_runmake bin/skopeo
}
do_install() {
install -d ${D}/${sbindir}
install -d ${D}/${sysconfdir}/containers
install ${S}/src/import/bin/skopeo ${D}/${sbindir}/
}
do_install:append:class-native() {
create_cmdline_wrapper ${D}/${sbindir}/skopeo \
--policy ${sysconfdir}/containers/policy.json
create_wrapper ${D}/${sbindir}/skopeo.real \
LD_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE}
}
do_install:append:class-nativesdk() {
create_cmdline_wrapper ${D}/${sbindir}/skopeo \
--policy ${sysconfdir}/containers/policy.json
}
INSANE_SKIP:${PN} += "ldflags already-stripped"
BBCLASSEXTEND = "native nativesdk"
|