pantry/projects/github.com/containers/skopeo/package.yml
Felipe Santos 0991f949d0
+github.com/containers/skopeo (#3465)
* +github.com/containers/skopeo

Closes #2695

* Speed up test

* Use hello-world image in all tests

* Clarify build instructions

* Disable man pages generation

* make and cc now handled by brewkit

* Use patch instead of git apply

* Pin patch to a commit id

* Use /releases/tags

* ops, alpine.tar

---------

Co-authored-by: Jacob Heider <jacob@tea.xyz>
2023-10-02 00:28:59 -04:00

42 lines
1.3 KiB
YAML

distributable:
url: https://github.com/containers/skopeo/archive/v{{ version }}.tar.gz
strip-components: 1
versions:
github: containers/skopeo/releases/tags
provides:
- bin/skopeo
dependencies:
curl.se/ca-certs: "*"
build:
dependencies:
go.dev: "^1.18"
curl.se: "*"
gnu.org/patch: "*"
env:
DISABLE_DOCS: 1 # disables the generation of man pages with go-md2man
script: |
# bundles default-policy.json into the binary to provide a working out-of-the-box experience
# https://github.com/containers/skopeo/pull/2014
curl -fsSL https://github.com/containers/skopeo/commit/fb180f03ca43ea7a9130a48639f483fa46cffe50.diff |
patch -p1
# https://github.com/containers/skopeo/blob/2d1ae1fdb3d88347eec8a17d4415a964ce86d54f/install.md#building-a-static-binary
CGO_ENABLED=0 make BUILDTAGS=containers_image_openpgp GO_DYN_FLAGS=
mkdir -p '{{prefix}}/bin'
mv -f ./bin/skopeo '{{prefix}}/bin'
test:
script: |
skopeo --version | tee /dev/stderr | grep -q -w '{{ version }}'
skopeo --override-os linux inspect docker://hello-world | tee /dev/stderr |
grep -q -w 'docker.io/library/hello-world'
skopeo --override-os linux copy docker://hello-world docker-archive:hello-world.tar
test -f hello-world.tar