2022-05-26 17:41:21 +00:00
|
|
|
%if "%{_vendor}" == "debbuild"
|
|
|
|
%define gobuild(o:) GO111MODULE=off go build -buildmode pie -tags=" ${BUILDTAGS:-}" -a -v -x %{?**};
|
|
|
|
%endif
|
|
|
|
|
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
|
|
|
|
|
|
|
|
%if 0%{?fedora} && ! 0%{?rhel}
|
|
|
|
%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
|
|
|
|
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-05-09 13:08:51 +00:00
|
|
|
%global built_tag v1.8.0
|
2017-04-25 19:12:23 +00:00
|
|
|
|
2018-04-08 02:51:52 +00:00
|
|
|
Name: %{repo}
|
2022-02-04 20:15:08 +00:00
|
|
|
Epoch: %{conditional_epoch}
|
2022-05-26 17:41:21 +00:00
|
|
|
Version: 1.8.0
|
|
|
|
%if "%{_vendor}" == "debbuild"
|
|
|
|
Maintainer: Lokesh Mandvekar <lsm5@fedoraproject.org>
|
|
|
|
License: ASL-2.0+
|
|
|
|
Release: 0%{?dist}
|
|
|
|
%else
|
|
|
|
License: ASL 2.0 and BSD and ISC and MIT
|
2022-03-17 20:02:26 +00:00
|
|
|
Release: %autorelease
|
2022-05-26 17:41:21 +00:00
|
|
|
%endif
|
2019-07-18 14:03:30 +00:00
|
|
|
Summary: Inspect container images and repositories on registries
|
2018-04-08 02:51:52 +00:00
|
|
|
URL: %{git0}
|
2021-08-03 19:31:26 +00:00
|
|
|
Source0: %{git0}/archive/%{built_tag}.tar.gz
|
2022-05-26 17:41:21 +00:00
|
|
|
BuildRequires: go-md2man
|
|
|
|
%if "%{_vendor}" == "debbuild"
|
|
|
|
BuildRequires: git
|
2022-05-30 19:26:33 +00:00
|
|
|
%if (0%{?debian} && 0%{?debian} <= 11) || (0%{?ubuntu} && 0%{?ubuntu} <= 2004)
|
2022-05-30 19:24:34 +00:00
|
|
|
BuildRequires: golang-1.16
|
|
|
|
%else
|
2022-05-26 17:41:21 +00:00
|
|
|
BuildRequires: golang
|
2022-05-30 19:24:34 +00:00
|
|
|
%endif
|
2022-05-26 17:41:21 +00:00
|
|
|
BuildRequires: libassuan-dev
|
|
|
|
BuildRequires: libbtrfs-dev
|
|
|
|
BuildRequires: libglib2.0-dev
|
|
|
|
BuildRequires: libgpgme-dev
|
|
|
|
BuildRequires: pkg-config
|
|
|
|
BuildRequires: libdevmapper-dev
|
|
|
|
Requires: containers-common >= 4:1
|
|
|
|
%else
|
|
|
|
ExclusiveArch: %{go_arches}
|
2022-02-04 18:27:20 +00:00
|
|
|
BuildRequires: btrfs-progs-devel
|
2021-01-12 19:31:58 +00:00
|
|
|
BuildRequires: git-core
|
2021-08-03 19:31:26 +00:00
|
|
|
BuildRequires: golang >= 1.16.6
|
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-04 21:22:00 +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 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
|
2022-05-26 17:41:21 +00:00
|
|
|
%endif
|
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
|
|
|
|
Requires: podman
|
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
|
2022-05-26 17:41:21 +00:00
|
|
|
%autosetup -Sgit
|
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
|
2022-05-26 17:41:21 +00:00
|
|
|
%if "%{_vendor}" != "debbuild"
|
2021-10-14 17:54:43 +00:00
|
|
|
%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')
|
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
|
|
|
%endif
|
|
|
|
|
|
|
|
export GOPATH=$(pwd)/_build:$(pwd)
|
|
|
|
export CGO_CFLAGS=$CFLAGS
|
2021-10-14 17:54:43 +00:00
|
|
|
|
|
|
|
# unset LDFLAGS earlier set from set_build_flags
|
|
|
|
LDFLAGS=''
|
|
|
|
|
2022-02-04 21:28:41 +00:00
|
|
|
mkdir _build
|
2022-05-26 17:41:21 +00:00
|
|
|
cd _build
|
2022-02-04 21:28:41 +00:00
|
|
|
mkdir -p src/%{provider}.%{provider_tld}/%{project}
|
2022-05-26 17:41:21 +00:00
|
|
|
ln -s ../../../../ src/%{import_path}
|
|
|
|
cd ..
|
2022-02-04 20:15:08 +00:00
|
|
|
|
2022-02-04 21:28:41 +00:00
|
|
|
mv vendor src
|
2022-02-04 21:04:49 +00:00
|
|
|
|
2022-02-04 21:28:41 +00:00
|
|
|
%gobuild -o bin/%{name} %{import_path}/cmd/%{name}
|
|
|
|
%{__make} docs
|
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-05-26 17:41:21 +00:00
|
|
|
%if "%{_vendor}" != "debbuild"
|
2022-05-09 14:44:23 +00:00
|
|
|
%autochangelog
|
2022-05-26 17:41:21 +00:00
|
|
|
%endif
|