<commit_before>HOMEPAGE = "https://github.com/projectatomic/skopeo"
SUMMARY = "Work with remote images registries - retrieving information, images, signing content"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7e611105d3e369954840a6668c438584"

DEPENDS = "\
           go-urfave \
           containers-image \
           go-digest \
           go-cheggaaa-pb.v1 \
           containers-storage \
           go-logrus \
           go-check \
           go-testify \
           go-spew \
           go-difflib \	
           go-errors \
           crypto \
           go-connections \
           go-tar-split \
           go-context \
           go-mux \
           go-units \
           go-net \
           go-distribution \
           go-libtrust \
           oci-image-spec \
           go-gpgme \
           go-glog \
           go-client-go \
           go-yaml \
           go-yaml.v2 \
           go-mergo \
           go-zfs \
           go-uuid \
           gpgme \
           multipath-tools \
           btrfs-tools \
          "

inherit go

RDEPENDS_${PN} = "gpgme \
                  lvm2 \
                  libgpg-error \
                  libassuan \
                 "

SRC_URI = "git://github.com/projectatomic/skopeo"
SRCREV = "f89bd82dcd05a8e09b770bac00d5731c33db5cb1"
PV = "v0.1.19-dev+git${SRCPV}"

S = "${WORKDIR}/git"

inherit goarch

# 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}/vendor/src"
	mkdir -p "${S}/vendor/src/github.com/projectatomic/skopeo"
	ln -sfn "${S}/skopeo" "${S}/vendor/src/github.com/projectatomic/skopeo"
	ln -sfn "${S}/version" "${S}/vendor/src/github.com/projectatomic/skopeo/version"
	export GOPATH="${S}/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="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
	export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"

	oe_runmake binary-local
}

do_install() {
	install -d ${D}/${sbindir}
	install -d ${D}/${sysconfdir}/containers

	install ${S}/skopeo ${D}/${sbindir}/
	install ${S}/default-policy.json ${D}/${sysconfdir}/containers/policy.json
}

INSANE_SKIP_${PN} += "ldflags"
<commit_msg>skopeo: stash: upgrade to the latest skopeo. needs ostree<commit_after>HOMEPAGE = "https://github.com/projectatomic/skopeo"
SUMMARY = "Work with remote images registries - retrieving information, images, signing content"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7e611105d3e369954840a6668c438584"

DEPENDS = "\
           go-urfave \
           containers-image \
           go-digest \
           go-cheggaaa-pb.v1 \
           containers-storage \
           go-logrus \
           go-check \
           go-testify \
           go-spew \
           go-difflib \	
           go-errors \
           crypto \
           go-connections \
           go-tar-split \
           go-context \
           go-mux \
           go-units \
           go-net \
           go-distribution \
           go-libtrust \
           oci-image-spec \
           go-gpgme \
           go-glog \
           go-client-go \
           go-yaml \
           go-yaml.v2 \
           go-mergo \
           go-zfs \
           go-uuid \
           gpgme \
           multipath-tools \
           btrfs-tools \
           glib-2.0 \
          "

inherit go

RDEPENDS_${PN} = "gpgme \
                  lvm2 \
                  libgpg-error \
                  libassuan \
                 "

SRC_URI = "git://github.com/projectatomic/skopeo"
SRCREV = "2ada6b20a2952765bf6f387b3646adb38c57c3db"
PV = "v0.1.23-dev+git${SRCPV}"

S = "${WORKDIR}/git"

inherit goarch
inherit pkgconfig

# 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}/vendor/src"
	mkdir -p "${S}/vendor/src/github.com/projectatomic/skopeo"
	ln -sfn "${S}/skopeo" "${S}/vendor/src/github.com/projectatomic/skopeo"
	ln -sfn "${S}/version" "${S}/vendor/src/github.com/projectatomic/skopeo/version"
	export GOPATH="${S}/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="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
	export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"

	oe_runmake binary-local
}

do_install() {
	install -d ${D}/${sbindir}
	install -d ${D}/${sysconfdir}/containers

	install ${S}/skopeo ${D}/${sbindir}/
	install ${S}/default-policy.json ${D}/${sysconfdir}/containers/policy.json
}

INSANE_SKIP_${PN} += "ldflags"

{'fraction_non_alphanumeric': 0.12408759124087591, 'fraction_numerical': 0.022627737226277374, 'mean_word_length': 2.0382483370288247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1881755', 'n_tokens_mistral': 1978, 'n_tokens_neox': 1893, 'n_words': 407}