2021-03-18 14:34:47 +08:00
%global with_debug 1
2019-12-30 17:31:15 +08:00
%if 0%{?with_debug}
%global _find_debuginfo_dwz_opts %{nil}
%global _dwz_low_mem_die_limit 0
%else
2024-02-23 19:24:27 +08:00
%global debug_package %{nil}
2019-12-30 17:31:15 +08:00
%endif
ExcludeArch : ppc64
2024-02-23 19:24:27 +08:00
Name : skopeo
2019-12-30 17:31:15 +08:00
Epoch : 1
2024-02-23 19:24:27 +08:00
Version : 1.14.2
2025-02-28 16:03:53 +08:00
Release : 4
2019-12-30 17:31:15 +08:00
Summary : Work with remote images registries - retrieving information, images, signing content
2024-02-23 19:24:27 +08:00
License : Apache-2.0
URL : https://github.com/containers/skopeo
Source0 : https://github.com/containers/skopeo/archive/refs/tags/v1.14.2.tar.gz
Source1 : https://github.com/cpuguy83/go-md2man/archive/refs/tags/v2.0.3.tar.gz
2019-12-30 17:31:15 +08:00
2024-04-12 15:46:26 +08:00
Patch0001 : 0001-fix-CVE-2024-24786.patch
2024-04-12 16:56:10 +08:00
Patch0002 : 0002-fix-CVE-2024-28180.patch
2025-02-28 16:03:53 +08:00
Patch0003 : 0001-add-sw64-support.patch
2024-04-12 15:46:26 +08:00
2022-03-24 02:23:32 +00:00
BuildRequires : go-srpm-macros git-core pkgconfig(devmapper) make
2024-02-23 19:24:27 +08:00
BuildRequires : golang >= 1.19
2019-12-30 17:31:15 +08:00
BuildRequires : gpgme-devel libassuan-devel btrfs-progs-devel ostree-devel glib2-devel
2024-02-23 19:24:27 +08:00
Requires : containers-common shadow-subid-devel
2019-12-30 17:31:15 +08:00
%description
A command line utility that performs various operations on container images and image repositories
2024-02-23 19:24:27 +08:00
%package tests
Summary : Tests for %{name}
Requires : %{name} = %{epoch} :%{version} -%{release}
Requires : bats
Requires : gnupg
Requires : jq
Requires : golang
Requires : podman
Requires : crun
Requires : httpd-tools
Requires : openssl
Requires : fakeroot
Requires : squashfs-tools
%description tests
2019-12-30 17:31:15 +08:00
%{summary}
2024-02-23 19:24:27 +08:00
This package contains system tests for %{name}
2019-12-30 17:31:15 +08:00
%prep
2024-04-12 15:46:26 +08:00
%autosetup -Sgit -n %{name} -%{version} -p1
2024-02-23 19:24:27 +08:00
# 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
tar -zxf %SOURCE1
2019-12-30 17:31:15 +08:00
2025-02-28 16:03:53 +08:00
%ifarch sw_64
grep -r " b u i l d m o d e " | cut -d: -f1 | xargs -I {} sed -i -e 's/buildmode=pie/buildmode=exe/g' -e 's/buildmode pie/buildmode exe/g' {}
sed -i -e 's/riscv64 || sh/riscv64 || sh || sw64/' -e 's/riscv64 sh/riscv64 sh sw64/' vendor/golang.org/x/sys/unix/endian_little.go vendor/golang.org/x/sys/cpu/endian_little.go
sed -i 's/syscall.Pause()/unix.Pause()/g' vendor/github.com/containers/storage/pkg/idmap/idmapped_utils.go
%endif
2019-12-30 17:31:15 +08:00
%build
2022-03-24 02:23:32 +00:00
pushd go-md2man-*
2021-02-19 14:10:08 +08:00
go build -mod=vendor -o go-md2man .
export GOMD2MAN=$(realpath go-md2man)
2022-03-24 02:23:32 +00:00
popd
2019-12-30 17:31:15 +08:00
2024-02-23 19:24:27 +08:00
%set_build_flags
export CGO_CFLAGS=$CFLAGS
2019-12-30 17:31:15 +08:00
2024-02-23 19:24:27 +08:00
%ifarch x86_64
export CGO_CFLAGS=" $ C G O _ C F L A G S - m 6 4 - m t u n e = g e n e r i c - f c f - p r o t e c t i o n = f u l l "
2019-12-30 17:31:15 +08:00
%endif
2024-02-23 19:24:27 +08:00
BASEBUILDTAGS=" $ ( h a c k / l i b d m _ t a g . s h ) $ ( h a c k / l i b s u b i d _ t a g . s h ) "
export BUILDTAGS=" $ B A S E B U I L D T A G S $ ( h a c k / b t r f s _ t a g . s h ) $ ( h a c k / b t r f s _ i n s t a l l e d _ t a g . s h ) "
# unset LDFLAGS earlier set from set_build_flags
LDFLAGS=''
export GO111MODULE=on
export GOFLAGS=-mod=vendor
2019-12-30 17:31:15 +08:00
2025-02-28 16:03:53 +08:00
go build \
%ifnarch sw_64
-buildmode pie \
%else
-buildmode exe \
%endif
-compiler gc -tags=" r p m _ c r a s h t r a c e b a c k $ { B U I L D T A G S : - } " -ldflags " $ { L D F L A G S : - } - B 0 x $ ( h e a d - c 2 0 / d e v / u r a n d o m | o d - A n - t x 1 | t r - d ' \n ' ) - e x t l d f l a g s ' - W l , - z , r e l r o - W l , - z , n o w ' " -a -v -x -o bin/%{name} ./cmd/%{name}
2022-03-24 02:23:32 +00:00
%{__make} docs
2024-02-23 19:24:27 +08:00
2019-12-30 17:31:15 +08:00
%install
2022-03-24 02:23:32 +00:00
make \
2024-02-23 19:24:27 +08:00
DESTDIR=%{buildroot} \
PREFIX=%{_prefix} \
install-binary install-docs install-completions
2019-12-30 17:31:15 +08:00
2024-02-23 19:24:27 +08:00
# system tests
install -d -p %{buildroot} /%{_datadir} /%{name} /test/system
cp -pav systemtest/* %{buildroot} /%{_datadir} /%{name} /test/system/
2019-12-30 17:31:15 +08:00
#define license tag if not already defined
%{!?_licensedir:%global license %doc }
%files
%license LICENSE
%doc README.md
%{_bindir} /%{name}
2024-02-23 19:24:27 +08:00
%{_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
2019-12-30 17:31:15 +08:00
%changelog
2025-02-28 16:03:53 +08:00
* Fri Feb 28 2025 zhangshaoning <zhangshaoning@uniontech.com> - 1:1.14.2-4
- Add sw_64 support
2024-04-12 16:56:10 +08:00
* Fri Apr 12 2024 zhangbowei <zhangbowei@kylinos.cn> - 1:1.14.2-3
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC: fix CVE-2024-28180
2024-04-12 15:46:26 +08:00
* Fri Apr 12 2024 zhangbowei <zhangbowei@kylinos.cn> - 1:1.14.2-2
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC: fix CVE-2024-24786
2024-02-23 19:24:27 +08:00
* Fri Feb 23 2024 lijian <lijian2@kylinos.cn> - 1:1.14.2-1
- Upgrade to 1.14.2
2023-10-17 15:25:57 +08:00
* Tue Oct 17 2023 lijian <lijian2@kylinos.cn> - 1:1.8.0-2
- delete unused files
2023-04-27 08:27:32 +00:00
* Thu Apr 27 2023 Merlin <merlinsun@hust.edu.cn> - 1:1.8.0-1
2023-04-27 15:04:01 +08:00
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Fix infinite loop in parsing
2022-10-28 15:11:22 +08:00
* Mon Nov 07 2022 fushanqing <fushanqing@kylinos.cn> - 1:1.8.0-1
- update to 1.8.0.
2022-03-24 02:23:32 +00:00
* Thu Mar 24 2022 fushanqing <fushanqing@kylinos.cn> - 1:1.5.2-1
- update to 1.5.2 and remove subpackage containers-common
2021-12-10 18:16:31 +08:00
* Fri Dec 10 2021 wangqing <wangqing@uniontech.com> - 1.1.0-8.dev.git63085f5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:install seccomp.json for skopeo
2021-11-25 08:26:04 +00:00
* Thu Nov 25 2021 haozi007<liuhao27@huawei.com> - 1.1.0-7.dev.git63085f5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:install registries.conf for skopeo
2021-03-18 14:34:47 +08:00
* Thu Mar 18 2021 haozi007 <liuhao27@huawei.com> - 1.1.0-6.dev.git63085f5
2021-11-25 08:26:04 +00:00
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:enable debug rpm
2021-02-19 14:10:08 +08:00
* Fri Feb 19 2021 haozi007 <liuhao27@huawei.com> - 1.1.0-5.dev.git63085f5
2021-11-25 08:26:04 +00:00
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Change BuildRequires to source go-md2man
2021-02-08 14:11:02 +08:00
* Mon Feb 8 2021 haozi007 <liuhao27@huawei.com> - 1.1.0-4.dev.git63085f5
2021-11-25 08:26:04 +00:00
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Change BuildRequires to golang