2024-03-28 11:38:22 +00:00
|
|
|
%global with_check 0
|
2018-07-24 14:01:40 +00:00
|
|
|
|
2024-03-28 11:38:22 +00:00
|
|
|
%if 0%{?rhel} > 7 && ! 0%{?fedora}
|
|
|
|
%define gobuild(o:) \
|
|
|
|
go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v %{?**};
|
2018-05-30 12:24:37 +00:00
|
|
|
%else
|
2024-03-28 11:38:22 +00:00
|
|
|
%define gobuild(o:) GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v %{?**};
|
2022-02-04 20:15:08 +00:00
|
|
|
%endif
|
|
|
|
|
2024-03-28 11:38:22 +00:00
|
|
|
%global import_path github.com/containers/%{name}
|
|
|
|
#%%global branch release-1.14
|
|
|
|
%global commit0 99e3c44865d4200bb93f38365622ef1e857c3a61
|
|
|
|
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
|
2016-02-03 16:54:55 +00:00
|
|
|
|
2024-03-28 11:38:22 +00:00
|
|
|
Epoch: 2
|
2023-07-06 19:28:16 +00:00
|
|
|
Name: skopeo
|
2024-03-28 11:38:22 +00:00
|
|
|
Version: 1.15.0
|
|
|
|
Release: 1%{?dist}
|
2019-07-18 14:03:30 +00:00
|
|
|
Summary: Inspect container images and repositories on registries
|
2024-03-28 11:38:22 +00:00
|
|
|
License: ASL 2.0
|
|
|
|
URL: https://%{import_path}
|
|
|
|
# https://fedoraproject.org/wiki/PackagingDrafts/Go#Go_Language_Architectures
|
|
|
|
ExclusiveArch: %{go_arches}
|
|
|
|
%if 0%{?branch:1}
|
|
|
|
Source0: https://%{import_path}/tarball/%{commit0}/%{branch}-%{shortcommit0}.tar.gz
|
|
|
|
%else
|
|
|
|
Source0: https://%{import_path}/archive/%{commit0}/%{name}-%{version}-%{shortcommit0}.tar.gz
|
2023-04-25 01:23:02 +00:00
|
|
|
%endif
|
2021-01-12 19:31:58 +00:00
|
|
|
BuildRequires: git-core
|
2024-03-28 11:38:22 +00:00
|
|
|
BuildRequires: golang >= 1.20.10
|
|
|
|
BuildRequires: /usr/bin/go-md2man
|
2018-04-08 02:51:52 +00:00
|
|
|
BuildRequires: gpgme-devel
|
|
|
|
BuildRequires: libassuan-devel
|
|
|
|
BuildRequires: pkgconfig(devmapper)
|
|
|
|
BuildRequires: glib2-devel
|
2018-04-16 02:42:43 +00:00
|
|
|
BuildRequires: make
|
2024-03-28 11:38:22 +00:00
|
|
|
Requires: containers-common >= 2:1-2
|
|
|
|
Requires: system-release
|
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}
|
2024-03-28 11:38:22 +00:00
|
|
|
#Requires: bats (which RHEL8 doesn't have. If it ever does, un-comment this)
|
2019-10-15 19:25:53 +00:00
|
|
|
Requires: gnupg
|
|
|
|
Requires: jq
|
2024-03-28 11:38:22 +00:00
|
|
|
Requires: golang >= 1.20.10
|
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-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
|
2024-03-28 11:38:22 +00:00
|
|
|
%if 0%{?branch:1}
|
|
|
|
%autosetup -Sgit -n containers-%{name}-%{shortcommit0}
|
2023-07-06 19:28:16 +00:00
|
|
|
%else
|
2024-03-28 11:38:22 +00:00
|
|
|
%autosetup -Sgit -n %{name}-%{commit0}
|
2023-04-25 01:23:02 +00:00
|
|
|
%endif
|
2024-03-28 11:38:22 +00:00
|
|
|
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
|
2023-04-25 01:23:02 +00:00
|
|
|
|
2024-03-28 11:38:22 +00:00
|
|
|
%build
|
|
|
|
mkdir -p src/github.com/containers
|
|
|
|
ln -s ../../../ src/%{import_path}
|
|
|
|
|
|
|
|
mkdir -p vendor/src
|
|
|
|
for v in vendor/*; do
|
|
|
|
if test ${v} = vendor/src; then continue; fi
|
|
|
|
if test -d ${v}; then
|
|
|
|
mv ${v} vendor/src/
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
export GOPATH=$(pwd):$(pwd)/vendor
|
|
|
|
export GO111MODULE=off
|
|
|
|
export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
|
|
|
|
export BUILDTAGS="exclude_graphdriver_btrfs btrfs_noversion $(hack/libdm_tag.sh)"
|
|
|
|
mkdir -p bin
|
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
|
2024-03-28 11:38:22 +00:00
|
|
|
make install-binary install-docs install-completions DESTDIR=%{buildroot} PREFIX=%{_prefix}
|
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/
|
|
|
|
|
2024-03-28 11:38:22 +00:00
|
|
|
%check
|
|
|
|
%if 0%{?with_check}
|
|
|
|
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
|
|
|
|
|
|
|
|
%gotest %{import_path}/integration
|
|
|
|
%endif
|
|
|
|
|
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
|
2024-03-28 11:38:22 +00:00
|
|
|
* Thu Mar 28 2024 Jindrich Novy <jnovy@redhat.com> - 2:1.15.0-2.14.2
|
|
|
|
- Sync with RHEL9
|
|
|
|
- Resolves: RHEL-30637
|