diff --git a/skopeo.spec b/skopeo.spec new file mode 100644 index 0000000000000000000000000000000000000000..447e97f560b2fe055303ee1b5aea6134786be3c0 --- /dev/null +++ b/skopeo.spec @@ -0,0 +1,165 @@ +%define anolis_release 1 + +%global with_debug 1 + +%if 0%{?with_debug} +%global _find_debuginfo_dwz_opts %{nil} +%global _dwz_low_mem_die_limit 0 +%else +%global debug_package %{nil} +%endif + +%define conditional_epoch 1 + +%global provider github +%global provider_tld com +%global project containers +%global repo skopeo +# https://github.com/containers/skopeo +%global import_path %{provider}.%{provider_tld}/%{project}/%{repo} +%global git0 https://%{import_path} + +%global built_tag v1.11.2 +%global built_tag_strip %(b=%{built_tag}; echo ${b:1}) +%global gen_version %(b=%{built_tag_strip}; echo ${b/-/"~"}) + +Name: %{repo} +Epoch: %{conditional_epoch} +Version: %{gen_version} +License: Apache-2.0 and BSD-2-Clause and BSD-3-Clause and ISC and MIT and MPL-2.0 +Release: %{anolis_release}%{?dist} +Summary: Inspect container images and repositories on registries +URL: %{git0} +# Tarball fetched from upstream +Source0: %{url}/archive/%{built_tag}.tar.gz +BuildRequires: go-md2man +BuildRequires: btrfs-progs-devel +BuildRequires: git-core +BuildRequires: golang >= 1.16.6 +BuildRequires: go-rpm-macros +BuildRequires: gpgme-devel +BuildRequires: libassuan-devel +BuildRequires: pkgconfig(devmapper) +BuildRequires: ostree-devel +BuildRequires: glib2-devel +BuildRequires: make +# awk '{print "Provides: bundled(golang("$1")) = "$2}' go.mod | sort | uniq | sed -e 's/-/_/g' -e '/bundled(golang())/d' -e '/bundled(golang(go\|module\|replace\|require))/d' +# vendored provides +Provides: bundled(golang(github.com/containers/common)) = v0.47.3 +Provides: bundled(golang(github.com/containers/image/v5)) = v5.19.1 +Provides: bundled(golang(github.com/containers/ocicrypt)) = v1.1.2 +Provides: bundled(golang(github.com/containers/storage)) = v1.38.2 +Provides: bundled(golang(github.com/docker/docker)) = v20.10.12+incompatible +Provides: bundled(golang(github.com/dsnet/compress)) = v0.0.2_0.20210315054119_f66993602bf5 +Provides: bundled(golang(github.com/opencontainers/go_digest)) = v1.0.0 +Provides: bundled(golang(github.com/opencontainers/image_spec)) = v1.0.3_0.20211202193544_a5463b7f9c84 +Provides: bundled(golang(github.com/opencontainers/image_tools)) = v1.0.0_rc3 +Provides: bundled(golang(github.com/pkg/errors)) = v0.9.1 +Provides: bundled(golang(github.com/russross/blackfriday)) = v2.0.0+incompatible +Provides: bundled(golang(github.com/sirupsen/logrus)) = v1.8.1 +Provides: bundled(golang(github.com/spf13/cobra)) = v1.3.0 +Provides: bundled(golang(github.com/spf13/pflag)) = v1.0.5 +Provides: bundled(golang(github.com/stretchr/testify)) = v1.7.0 +Provides: bundled(golang(github.com/syndtr/gocapability)) = v0.0.0_20200815063812_42c35b437635 + +%description +Command line utility to inspect images and repositories directly on Docker +registries without the need to pull them + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{epoch}:%{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + +%package tests +Summary: Tests for %{name} + +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: gnupg +Requires: jq +Requires: golang +Requires: httpd-tools +Requires: openssl +Requires: fakeroot +Requires: squashfs-tools + +%description tests +%{summary} + +This package contains system tests for %{name} + +%prep +%autosetup -Sgit %{name}-%{built_tag_strip} +sed -i 's/install-binary: bin\/%{name}/install-binary:/' Makefile +sed -i 's/completions: bin\/%{name}/completions:/' Makefile +sed -i 's/install-docs: docs/install-docs:/' Makefile + +%build +%set_build_flags +# These extra flags present in $CFLAGS have been skipped for now as they break the build +CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-flto=auto//g') +CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-Wp,D_GLIBCXX_ASSERTIONS//g') +CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-annobin-cc1//g') + +%ifarch x86_64 +export CGO_CFLAGS="$CGO_CFLAGS -m64 -mtune=generic -fcf-protection=full" +%endif + +export GOPATH=$(pwd)/_build:$(pwd) +export CGO_CFLAGS=$CFLAGS + +# unset LDFLAGS earlier set from set_build_flags +LDFLAGS='' + +mkdir _build +cd _build +mkdir -p src/%{provider}.%{provider_tld}/%{project} +ln -s ../../../../ src/%{import_path} +cd .. + +mv vendor src + +%gobuild -o bin/%{name} %{import_path}/cmd/%{name} +%{__make} docs + +%install +make \ + PREFIX=%{buildroot}%{_prefix} \ + install-binary install-docs install-completions + +# system tests +install -d -p %{buildroot}/%{_datadir}/%{name}/test/system +cp -pav systemtest/* %{buildroot}/%{_datadir}/%{name}/test/system/ + +%generate_compatibility_deps + +#define license tag if not already defined +%{!?_licensedir:%global license %doc} + +%files +%license LICENSE +%{_bindir}/%{name} +%dir %{abidir} +%{abidir}/skopeo-option.list +%{_mandir}/man1/%{name}* +%dir %{_datadir}/bash-completion +%dir %{_datadir}/bash-completion/completions +%{_datadir}/bash-completion/completions/%{name} +%dir %{_datadir}/fish/vendor_completions.d +%{_datadir}/fish/vendor_completions.d/%{name}.fish +%dir %{_datadir}/zsh/site-functions +%{_datadir}/zsh/site-functions/_%{name} + +%files tests +%license LICENSE +%{_datadir}/%{name}/test + +%files doc +%doc README.md + +%changelog +* Tue Apr 11 2023 mgb01105731 - 1:1.11.2-1 +- Init upstream from version 1.11.2 diff --git a/v1.11.2.tar.gz b/v1.11.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..18e09b8af658c58b158424b93d2d90fb4624b034 Binary files /dev/null and b/v1.11.2.tar.gz differ