2018-07-24 14:01:40 +00:00
|
|
|
%global with_debug 1
|
|
|
|
|
2018-05-30 12:24:37 +00:00
|
|
|
%if 0%{?with_debug}
|
|
|
|
%global _find_debuginfo_dwz_opts %{nil}
|
|
|
|
%global _dwz_low_mem_die_limit 0
|
|
|
|
%else
|
2022-02-04 21:38:38 +00:00
|
|
|
%global debug_package %{nil}
|
2022-02-04 20:15:08 +00:00
|
|
|
%endif
|
|
|
|
|
2023-07-06 19:28:16 +00:00
|
|
|
# RHEL 8's default %%gobuild macro doesn't account for the BUILDTAGS variable, so we
|
|
|
|
# set it separately here and do not depend on RHEL 8's go-srpm-macros package.
|
|
|
|
%if %{defined rhel} && 0%{?rhel} == 8
|
|
|
|
%define gobuild(o:) go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl ${BUILDTAGS:-}" -ldflags "-linkmode=external -compressdwarf=false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};
|
2023-04-25 01:23:02 +00:00
|
|
|
%endif
|
|
|
|
|
2023-07-06 19:28:16 +00:00
|
|
|
%global gomodulesmode GO111MODULE=on
|
|
|
|
|
|
|
|
# No btrfs on RHEL
|
|
|
|
%if %{defined fedora}
|
|
|
|
%define build_with_btrfs 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Only used in official koji builds
|
|
|
|
# Copr builds set a separate epoch for all environments
|
|
|
|
%if %{defined fedora}
|
2022-02-04 20:15:08 +00:00
|
|
|
%define conditional_epoch 1
|
|
|
|
%else
|
|
|
|
%define conditional_epoch 2
|
2018-05-30 12:24:37 +00:00
|
|
|
%endif
|
2016-02-03 16:54:55 +00:00
|
|
|
|
2023-07-06 19:28:16 +00:00
|
|
|
Name: skopeo
|
|
|
|
%if %{defined copr_username}
|
|
|
|
Epoch: 102
|
|
|
|
%else
|
2022-02-04 20:15:08 +00:00
|
|
|
Epoch: %{conditional_epoch}
|
2023-07-06 19:28:16 +00:00
|
|
|
%endif
|
|
|
|
# DO NOT TOUCH the Version string!
|
|
|
|
# The TRUE source of this specfile is:
|
|
|
|
# https://github.com/containers/skopeo/blob/main/rpm/skopeo.spec
|
|
|
|
# If that's what you're reading, Version must be 0, and will be updated by Packit for
|
|
|
|
# copr and koji builds.
|
|
|
|
# If you're reading this on dist-git, the version is automatically filled in by Packit.
|
|
|
|
Version: 1.13.0
|
2023-03-06 11:59:09 +00:00
|
|
|
License: Apache-2.0 and BSD-2-Clause and BSD-3-Clause and ISC and MIT and MPL-2.0
|
2022-03-17 20:02:26 +00:00
|
|
|
Release: %autorelease
|
2023-07-06 19:28:16 +00:00
|
|
|
%if %{defined golang_arches_future}
|
2023-02-09 11:30:36 +00:00
|
|
|
ExclusiveArch: %{golang_arches_future}
|
2023-07-06 19:28:16 +00:00
|
|
|
%else
|
|
|
|
ExclusiveArch: aarch64 ppc64le s390x x86_64
|
|
|
|
%endif
|
2019-07-18 14:03:30 +00:00
|
|
|
Summary: Inspect container images and repositories on registries
|
2023-07-06 19:28:16 +00:00
|
|
|
URL: https://github.com/containers/%{name}
|
2022-10-05 13:21:39 +00:00
|
|
|
# Tarball fetched from upstream
|
2023-07-06 19:28:16 +00:00
|
|
|
Source0: %{url}/archive/v%{version}.tar.gz
|
|
|
|
BuildRequires: %{_bindir}/go-md2man
|
|
|
|
%if %{defined build_with_btrfs}
|
2022-02-04 18:27:20 +00:00
|
|
|
BuildRequires: btrfs-progs-devel
|
2023-04-25 01:23:02 +00:00
|
|
|
%endif
|
2021-01-12 19:31:58 +00:00
|
|
|
BuildRequires: git-core
|
2023-07-06 19:28:16 +00:00
|
|
|
BuildRequires: golang
|
|
|
|
%if !%{defined gobuild}
|
2021-08-05 17:55:32 +00:00
|
|
|
BuildRequires: go-rpm-macros
|
2023-07-06 19:28:16 +00:00
|
|
|
%endif
|
2018-04-08 02:51:52 +00:00
|
|
|
BuildRequires: gpgme-devel
|
|
|
|
BuildRequires: libassuan-devel
|
|
|
|
BuildRequires: pkgconfig(devmapper)
|
|
|
|
BuildRequires: ostree-devel
|
|
|
|
BuildRequires: glib2-devel
|
2018-04-16 02:42:43 +00:00
|
|
|
BuildRequires: make
|
2023-07-06 19:28:16 +00:00
|
|
|
BuildRequires: shadow-utils-subid-devel
|
2021-06-30 15:17:46 +00:00
|
|
|
Requires: containers-common >= 4:1-21
|
2023-07-06 19:28:16 +00:00
|
|
|
# DO NOT DELETE BELOW LINE - used for updating downstream goimports
|
|
|
|
# vendored libraries
|
|
|
|
Provides: bundled(golang(github.com/containers/common/pkg/auth))
|
|
|
|
Provides: bundled(golang(github.com/containers/common/pkg/flag))
|
|
|
|
Provides: bundled(golang(github.com/containers/common/pkg/report))
|
|
|
|
Provides: bundled(golang(github.com/containers/common/pkg/retry))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/copy))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/directory))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/docker))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/docker/archive))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/docker/reference))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/image))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/manifest))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/oci/layout))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/pkg/blobinfocache))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/pkg/cli))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/pkg/cli/sigstore))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/pkg/compression))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/signature))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/signature/signer))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/signature/sigstore))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/transports))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/transports/alltransports))
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5/types))
|
|
|
|
Provides: bundled(golang(github.com/containers/ocicrypt/config))
|
|
|
|
Provides: bundled(golang(github.com/containers/ocicrypt/helpers))
|
|
|
|
Provides: bundled(golang(github.com/containers/storage/pkg/homedir))
|
|
|
|
Provides: bundled(golang(github.com/containers/storage/pkg/reexec))
|
|
|
|
Provides: bundled(golang(github.com/containers/storage/pkg/unshare))
|
|
|
|
Provides: bundled(golang(github.com/docker/distribution/registry/api/errcode))
|
|
|
|
Provides: bundled(golang(github.com/docker/distribution/registry/api/v2))
|
|
|
|
Provides: bundled(golang(github.com/opencontainers/go-digest))
|
|
|
|
Provides: bundled(golang(github.com/opencontainers/image-spec/specs-go/v1))
|
|
|
|
Provides: bundled(golang(github.com/sirupsen/logrus))
|
|
|
|
Provides: bundled(golang(github.com/spf13/cobra))
|
|
|
|
Provides: bundled(golang(github.com/spf13/pflag))
|
|
|
|
Provides: bundled(golang(github.com/stretchr/testify/assert))
|
|
|
|
Provides: bundled(golang(github.com/stretchr/testify/require))
|
|
|
|
Provides: bundled(golang(github.com/syndtr/gocapability/capability))
|
|
|
|
Provides: bundled(golang(golang.org/x/exp/maps))
|
|
|
|
Provides: bundled(golang(golang.org/x/exp/slices))
|
|
|
|
Provides: bundled(golang(golang.org/x/term))
|
|
|
|
Provides: bundled(golang(gopkg.in/yaml.v3))
|
2018-08-12 03:29:06 +00:00
|
|
|
|
2016-02-03 16:54:55 +00:00
|
|
|
%description
|
|
|
|
Command line utility to inspect images and repositories directly on Docker
|
|
|
|
registries without the need to pull them
|
|
|
|
|
2019-10-15 19:25:53 +00:00
|
|
|
%package tests
|
|
|
|
Summary: Tests for %{name}
|
2022-02-04 21:04:49 +00:00
|
|
|
|
2019-10-15 19:25:53 +00:00
|
|
|
Requires: %{name} = %{epoch}:%{version}-%{release}
|
|
|
|
Requires: bats
|
|
|
|
Requires: gnupg
|
|
|
|
Requires: jq
|
2023-02-03 11:37:58 +00:00
|
|
|
Requires: golang
|
2019-10-15 19:25:53 +00:00
|
|
|
Requires: podman
|
2022-10-20 10:12:53 +00:00
|
|
|
Requires: crun
|
2020-07-20 19:28:33 +00:00
|
|
|
Requires: httpd-tools
|
2021-03-01 19:19:13 +00:00
|
|
|
Requires: openssl
|
2022-03-17 20:02:26 +00:00
|
|
|
Requires: fakeroot
|
2022-03-22 13:10:27 +00:00
|
|
|
Requires: squashfs-tools
|
2019-10-15 19:25:53 +00:00
|
|
|
|
|
|
|
%description tests
|
|
|
|
%{summary}
|
|
|
|
|
|
|
|
This package contains system tests for %{name}
|
|
|
|
|
2016-02-03 16:54:55 +00:00
|
|
|
%prep
|
2023-07-06 19:28:16 +00:00
|
|
|
%autosetup -Sgit %{name}-%{version}
|
|
|
|
# The %%install stage should not rebuild anything but only install what's
|
|
|
|
# built in the %%build stage. So, remove any dependency on build targets.
|
|
|
|
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
|
2016-02-03 16:54:55 +00:00
|
|
|
|
|
|
|
%build
|
2021-10-14 17:54:43 +00:00
|
|
|
%set_build_flags
|
2023-07-06 19:28:16 +00:00
|
|
|
export CGO_CFLAGS=$CFLAGS
|
|
|
|
|
2021-10-14 17:54:43 +00:00
|
|
|
# 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')
|
2016-02-03 16:54:55 +00:00
|
|
|
|
2020-12-05 04:57:25 +00:00
|
|
|
%ifarch x86_64
|
2021-10-14 17:54:43 +00:00
|
|
|
export CGO_CFLAGS="$CGO_CFLAGS -m64 -mtune=generic -fcf-protection=full"
|
2020-12-05 04:57:25 +00:00
|
|
|
%endif
|
2022-05-26 17:41:21 +00:00
|
|
|
|
2023-07-06 19:28:16 +00:00
|
|
|
BASEBUILDTAGS="$(hack/libdm_tag.sh) $(hack/libsubid_tag.sh)"
|
|
|
|
%if %{defined build_with_btrfs}
|
|
|
|
export BUILDTAGS="$BASEBUILDTAGS $(hack/btrfs_tag.sh) $(hack/btrfs_installed_tag.sh)"
|
|
|
|
%else
|
|
|
|
export BUILDTAGS="$BASEBUILDTAGS btrfs_noversion exclude_graphdriver_btrfs"
|
2023-04-25 01:23:02 +00:00
|
|
|
%endif
|
|
|
|
|
2021-10-14 17:54:43 +00:00
|
|
|
# unset LDFLAGS earlier set from set_build_flags
|
|
|
|
LDFLAGS=''
|
|
|
|
|
2023-07-06 19:28:16 +00:00
|
|
|
%gobuild -o bin/%{name} ./cmd/%{name}
|
2022-02-04 21:28:41 +00:00
|
|
|
%{__make} docs
|
2016-02-03 16:54:55 +00:00
|
|
|
|
|
|
|
%install
|
2019-04-26 19:14:03 +00:00
|
|
|
make \
|
2023-07-06 19:28:16 +00:00
|
|
|
DESTDIR=%{buildroot} \
|
|
|
|
PREFIX=%{_prefix} \
|
2021-01-12 15:25:52 +00:00
|
|
|
install-binary install-docs install-completions
|
2017-10-17 12:35:18 +00:00
|
|
|
|
2019-10-15 19:25:53 +00:00
|
|
|
# system tests
|
|
|
|
install -d -p %{buildroot}/%{_datadir}/%{name}/test/system
|
|
|
|
cp -pav systemtest/* %{buildroot}/%{_datadir}/%{name}/test/system/
|
|
|
|
|
2016-02-03 16:54:55 +00:00
|
|
|
#define license tag if not already defined
|
|
|
|
%{!?_licensedir:%global license %doc}
|
|
|
|
|
|
|
|
%files
|
2016-09-21 19:09:54 +00:00
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
2016-08-11 14:24:17 +00:00
|
|
|
%{_bindir}/%{name}
|
2019-03-27 12:38:58 +00:00
|
|
|
%{_mandir}/man1/%{name}*
|
2016-09-21 19:09:54 +00:00
|
|
|
%dir %{_datadir}/bash-completion
|
|
|
|
%dir %{_datadir}/bash-completion/completions
|
2016-08-25 19:34:12 +00:00
|
|
|
%{_datadir}/bash-completion/completions/%{name}
|
2022-07-15 15:48:48 +00:00
|
|
|
%dir %{_datadir}/fish/vendor_completions.d
|
|
|
|
%{_datadir}/fish/vendor_completions.d/%{name}.fish
|
2022-07-15 17:53:35 +00:00
|
|
|
%dir %{_datadir}/zsh/site-functions
|
2022-07-15 15:48:48 +00:00
|
|
|
%{_datadir}/zsh/site-functions/_%{name}
|
2016-02-03 16:54:55 +00:00
|
|
|
|
2019-10-15 19:25:53 +00:00
|
|
|
%files tests
|
|
|
|
%license LICENSE
|
|
|
|
%{_datadir}/%{name}/test
|
|
|
|
|
2016-02-03 16:54:55 +00:00
|
|
|
%changelog
|
2023-07-06 19:28:16 +00:00
|
|
|
%if %{defined autochangelog}
|
2022-05-09 14:44:23 +00:00
|
|
|
%autochangelog
|
2023-07-06 19:28:16 +00:00
|
|
|
%else
|
|
|
|
# NOTE: This changelog will be visible on CentOS 8 Stream builds
|
|
|
|
# Other envs are capable of handling autochangelog
|
|
|
|
* Tue Jun 13 2023 RH Container Bot <rhcontainerbot@fedoraproject.org>
|
|
|
|
- Placeholder changelog for envs that are not autochangelog-ready.
|
|
|
|
- Contact upstream if you need to report an issue with the build.
|
|
|
|
%endif
|