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
|
2016-02-03 16:54:55 +00:00
|
|
|
%global debug_package %{nil}
|
2018-05-30 12:24:37 +00:00
|
|
|
%endif
|
2016-02-03 16:54:55 +00:00
|
|
|
|
2018-04-08 02:51:52 +00:00
|
|
|
%global provider github
|
|
|
|
%global provider_tld com
|
2018-11-08 03:58:06 +00:00
|
|
|
%global project containers
|
2018-04-08 02:51:52 +00:00
|
|
|
%global repo skopeo
|
2018-11-08 03:58:06 +00:00
|
|
|
# https://github.com/containers/skopeo
|
2020-12-05 04:57:25 +00:00
|
|
|
%global import_path %{provider}.%{provider_tld}/%{project}/%{repo}
|
2018-04-08 02:51:52 +00:00
|
|
|
%global git0 https://%{import_path}
|
2016-02-03 16:54:55 +00:00
|
|
|
|
2022-02-03 20:57:33 +00:00
|
|
|
%global built_tag v1.6.0
|
2021-08-09 13:14:34 +00:00
|
|
|
%global built_tag_strip %(b=%{built_tag}; echo ${b:1})
|
2022-01-27 14:16:30 +00:00
|
|
|
%global gen_version %(b=%{built_tag_strip}; echo ${b/-/"~"})
|
2017-04-25 19:12:23 +00:00
|
|
|
|
2018-04-08 02:51:52 +00:00
|
|
|
Name: %{repo}
|
2022-02-04 15:58:46 +00:00
|
|
|
%if 0%{?fedora} && ! 0%{?rhel}
|
|
|
|
Epoch: 1
|
|
|
|
%else
|
|
|
|
Epoch: 2
|
|
|
|
%endif
|
2022-01-27 14:16:30 +00:00
|
|
|
Version: %{gen_version}
|
|
|
|
Release: %autorelease
|
2019-07-18 14:03:30 +00:00
|
|
|
Summary: Inspect container images and repositories on registries
|
2022-01-27 14:16:30 +00:00
|
|
|
License: ASL 2.0 and BSD and ISC and MIT
|
2018-04-08 02:51:52 +00:00
|
|
|
URL: %{git0}
|
2021-10-07 13:09:53 +00:00
|
|
|
ExclusiveArch: %{go_arches}
|
2021-08-03 19:31:26 +00:00
|
|
|
Source0: %{git0}/archive/%{built_tag}.tar.gz
|
2016-06-21 18:18:32 +00:00
|
|
|
%if 0%{?fedora}
|
2021-06-14 19:43:18 +00:00
|
|
|
BuildRequires: btrfs-progs-devel
|
2016-06-21 18:18:32 +00:00
|
|
|
%endif
|
2021-01-12 19:31:58 +00:00
|
|
|
BuildRequires: git-core
|
2021-08-03 19:31:26 +00:00
|
|
|
BuildRequires: golang >= 1.16.6
|
2019-07-18 14:03:30 +00:00
|
|
|
BuildRequires: go-md2man
|
2021-08-05 17:55:32 +00:00
|
|
|
BuildRequires: go-rpm-macros
|
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
|
2021-06-30 15:17:46 +00:00
|
|
|
Requires: containers-common >= 4:1-21
|
2022-02-03 20:57:33 +00:00
|
|
|
# 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 libraries
|
|
|
|
Provides: bundled(golang(github.com/containers/common)) = v0.47.3
|
|
|
|
Provides: bundled(golang(github.com/containers/image/v5)) = v5.19.1
|
2022-01-27 14:16:30 +00:00
|
|
|
Provides: bundled(golang(github.com/containers/ocicrypt)) = v1.1.2
|
2022-02-03 20:57:33 +00:00
|
|
|
Provides: bundled(golang(github.com/containers/storage)) = v1.38.2
|
|
|
|
Provides: bundled(golang(github.com/docker/docker)) = v20.10.12+incompatible
|
2022-01-27 14:16:30 +00:00
|
|
|
Provides: bundled(golang(github.com/dsnet/compress)) = v0.0.2_0.20210315054119_f66993602bf5
|
|
|
|
Provides: bundled(golang(github.com/opencontainers/go_digest)) = v1.0.0
|
2022-02-03 20:57:33 +00:00
|
|
|
Provides: bundled(golang(github.com/opencontainers/image_spec)) = v1.0.3_0.20211202193544_a5463b7f9c84
|
2022-01-27 14:16:30 +00:00
|
|
|
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
|
2022-02-03 20:57:33 +00:00
|
|
|
Provides: bundled(golang(github.com/spf13/cobra)) = v1.3.0
|
2022-01-27 14:16:30 +00:00
|
|
|
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
|
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}
|
|
|
|
|
|
|
|
Requires: %{name} = %{epoch}:%{version}-%{release}
|
|
|
|
Requires: bats
|
|
|
|
Requires: gnupg
|
|
|
|
Requires: jq
|
|
|
|
Requires: podman
|
2020-07-20 19:28:33 +00:00
|
|
|
Requires: httpd-tools
|
2021-03-01 19:19:13 +00:00
|
|
|
Requires: openssl
|
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
|
2021-06-30 15:17:46 +00:00
|
|
|
%autosetup -Sgit -n %{name}-%{built_tag_strip}
|
2020-08-25 19:22:03 +00:00
|
|
|
sed -i 's/install-binary: bin\/%{name}/install-binary:/' 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
|
|
|
|
export CGO_CFLAGS=$CFLAGS
|
|
|
|
# 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
|
2021-10-14 17:54:43 +00:00
|
|
|
|
|
|
|
# unset LDFLAGS earlier set from set_build_flags
|
|
|
|
LDFLAGS=''
|
|
|
|
|
|
|
|
mkdir -p src/github.com/containers
|
|
|
|
ln -s ../../../ src/%{import_path}
|
2020-12-05 04:57:25 +00:00
|
|
|
|
2016-02-03 16:54:55 +00:00
|
|
|
mkdir -p vendor/src
|
2016-05-05 14:35:57 +00:00
|
|
|
for v in vendor/*; do
|
|
|
|
if test ${v} = vendor/src; then continue; fi
|
2019-02-13 11:03:45 +00:00
|
|
|
if test -d ${v}; then
|
|
|
|
mv ${v} vendor/src/
|
2016-04-21 18:34:52 +00:00
|
|
|
fi
|
2016-05-31 07:12:02 +00:00
|
|
|
done
|
2016-02-03 16:54:55 +00:00
|
|
|
|
2019-04-26 19:14:03 +00:00
|
|
|
export GOPATH=$(pwd):$(pwd)/vendor
|
2016-02-03 16:54:55 +00:00
|
|
|
|
2020-08-25 19:22:03 +00:00
|
|
|
mkdir -p bin
|
2021-10-07 15:47:06 +00:00
|
|
|
%if 0%{?rhel} >= 8
|
2020-12-02 19:32:36 +00:00
|
|
|
export BUILDTAGS='exclude_graphdriver_btrfs btrfs_noversion'
|
|
|
|
%endif
|
2020-08-25 19:22:03 +00:00
|
|
|
%gobuild -o bin/%{name} ./cmd/%{name}
|
|
|
|
pushd docs
|
|
|
|
for file in $(ls | grep 1.md)
|
|
|
|
do
|
|
|
|
export FILE_OUT=$(echo $file | sed -e 's/\.md//')
|
|
|
|
go-md2man -in $file -out $FILE_OUT
|
|
|
|
done
|
|
|
|
popd
|
2016-02-03 16:54:55 +00:00
|
|
|
|
|
|
|
%install
|
2019-04-26 19:14:03 +00:00
|
|
|
make \
|
2021-05-21 13:50:20 +00:00
|
|
|
PREFIX=%{buildroot}%{_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}
|
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
|
2022-01-27 14:16:30 +00:00
|
|
|
%autochangelog
|