bae5f5
%global with_debug 1
bae5f5
%global with_check 0
bae5f5
bae5f5
%if 0%{?with_debug}
bae5f5
%global _find_debuginfo_dwz_opts %{nil}
bae5f5
%global _dwz_low_mem_die_limit 0
bae5f5
%else
bae5f5
%global debug_package %{nil}
bae5f5
%endif
bae5f5
bae5f5
%if 0%{?rhel} > 7 && ! 0%{?fedora}
bae5f5
%define gobuild(o:) \
6a0200
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 -x %{?**};
6a0200
%endif
bae5f5
bae5f5
%global provider github
bae5f5
%global provider_tld com
bae5f5
%global project containers
bae5f5
%global repo skopeo
bae5f5
# https://github.com/containers/skopeo
bae5f5
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
bae5f5
%global import_path %{provider_prefix}
bae5f5
%global git0 https://%{import_path}
2d4258
%global branch master
bae5f5
bae5f5
Epoch: 1
6a0200
Name: %{repo}
2d4258
Version: 1.0.0
2d4258
Release: 1%{?dist}
c7b324
Summary: Inspect container images and repositories on registries
bae5f5
License: ASL 2.0
bae5f5
URL: %{git0}
2d4258
Source0: %{git0}/archive/v%{version}.tar.gz
2d4258
#Source1: https://raw.githubusercontent.com/containers/storage/%%{branch}/storage.conf
2d4258
Source1: https://src.fedoraproject.org/rpms/skopeo/raw/master/f/storage.conf
2d4258
Source2: https://raw.githubusercontent.com/containers/storage/%{branch}/docs/containers-storage.conf.5.md
bae5f5
Source3: mounts.conf
2d4258
Source4: https://raw.githubusercontent.com/containers/image/%{branch}/docs/containers-registries.conf.5.md
bae5f5
Source5: registries.conf
2d4258
Source6: https://raw.githubusercontent.com/containers/image/%{branch}/docs/containers-policy.json.5.md
2d4258
#Source7: https://raw.githubusercontent.com/containers/libpod/%%{branch}/seccomp.json
2d4258
Source7: https://src.fedoraproject.org/rpms/skopeo/raw/master/f/seccomp.json
2d4258
Source8: https://raw.githubusercontent.com/containers/libpod/%{branch}/docs/source/markdown/containers-mounts.conf.5.md
2d4258
Source9: https://raw.githubusercontent.com/containers/image/%{branch}/docs/containers-signature.5.md
2d4258
Source10: https://raw.githubusercontent.com/containers/image/%{branch}/docs/containers-transports.5.md
2d4258
Source11: https://raw.githubusercontent.com/containers/image/%{branch}/docs/containers-certs.d.5.md
2d4258
Source12: https://raw.githubusercontent.com/containers/image/%{branch}/docs/containers-registries.d.5.md
2d4258
Source13: https://raw.githubusercontent.com/containers/common/%{branch}/pkg/config/containers.conf
2d4258
Source14: https://raw.githubusercontent.com/containers/common/%{branch}/docs/containers.conf.5.md
2d4258
Source15: https://raw.githubusercontent.com/containers/image/%{branch}/docs/containers-auth.json.5.md
bae5f5
BuildRequires: git
6a0200
BuildRequires: golang >= 1.12.12-4
6a0200
BuildRequires: go-md2man
bae5f5
BuildRequires: gpgme-devel
bae5f5
BuildRequires: libassuan-devel
bae5f5
BuildRequires: pkgconfig(devmapper)
bae5f5
BuildRequires: ostree-devel
bae5f5
BuildRequires: glib2-devel
6a0200
BuildRequires: make
bae5f5
Requires: containers-common = %{epoch}:%{version}-%{release}
bae5f5
bae5f5
%description
bae5f5
Command line utility to inspect images and repositories directly on Docker
bae5f5
registries without the need to pull them
bae5f5
bae5f5
%package -n containers-common
bae5f5
Summary: Configuration files for working with image signatures
bae5f5
Obsoletes: atomic <= 1:1.13.1-2
bae5f5
Conflicts: atomic-registries <= 1:1.22.1-1
bae5f5
Obsoletes: docker-rhsubscription <= 2:1.13.1-31
bae5f5
Provides: %{name}-containers = %{epoch}:%{version}-%{release}
bae5f5
Obsoletes: %{name}-containers <= 1:0.1.31-3
bae5f5
Recommends: fuse-overlayfs
bae5f5
Recommends: slirp4netns
d8f6d1
Recommends: subscription-manager
bae5f5
bae5f5
%description -n containers-common
bae5f5
This package installs a default signature store configuration and a default
bae5f5
policy under `/etc/containers/`.
bae5f5
c7b324
%package tests
c7b324
Summary:         Tests for %{name}
c7b324
Requires: %{name} = %{epoch}:%{version}-%{release}
c7b324
#Requires: bats  (which RHEL8 doesn't have. If it ever does, un-comment this)
c7b324
Requires: gnupg
c7b324
Requires: jq
c7b324
Requires: podman
c7b324
c7b324
%description tests
c7b324
%{summary}
c7b324
c7b324
This package contains system tests for %{name}
c7b324
bae5f5
%prep
2d4258
%autosetup -Sgit
bae5f5
bae5f5
%build
bae5f5
mkdir -p src/github.com/containers
bae5f5
ln -s ../../../ src/%{import_path}
bae5f5
bae5f5
mkdir -p vendor/src
bae5f5
for v in vendor/*; do
bae5f5
    if test ${v} = vendor/src; then continue; fi
bae5f5
    if test -d ${v}; then
6a0200
      mv ${v} vendor/src/
bae5f5
    fi
bae5f5
done
bae5f5
bae5f5
export GOPATH=$(pwd):$(pwd)/vendor:%{gopath}
6a0200
export GO111MODULE=off
6a0200
export BUILDTAGS="exclude_graphdriver_btrfs btrfs_noversion $(hack/libdm_tag.sh) $(hack/ostree_tag.sh)"
bae5f5
%gobuild -o %{name} ./cmd/%{name}
6a0200
%{__make} docs
bae5f5
bae5f5
%install
6a0200
make \
6a0200
   DESTDIR=%{buildroot} \
6a0200
   SIGSTOREDIR=%{buildroot}%{_sharedstatedir}/containers/sigstore \
6a0200
   install
bae5f5
mkdir -p %{buildroot}%{_sysconfdir}
c7b324
mkdir -p %{buildroot}%{_sysconfdir}/containers/{certs.d,oci/hooks.d}
bae5f5
mkdir -p %{buildroot}%{_mandir}/man5
6a0200
install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/containers/storage.conf
bae5f5
install -p -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/containers/
6a0200
go-md2man -in %{SOURCE2} -out %{buildroot}%{_mandir}/man5/containers-storage.conf.5
6a0200
go-md2man -in %{SOURCE4} -out %{buildroot}%{_mandir}/man5/containers-registries.conf.5
6a0200
go-md2man -in %{SOURCE6} -out %{buildroot}%{_mandir}/man5/containers-policy.json.5
6a0200
go-md2man -in %{SOURCE8} -out %{buildroot}%{_mandir}/man5/containers-mounts.conf.5
6a0200
go-md2man -in %{SOURCE9} -out %{buildroot}%{_mandir}/man5/containers-signature.5
6a0200
go-md2man -in %{SOURCE10} -out %{buildroot}%{_mandir}/man5/containers-transports.5
6a0200
go-md2man -in %{SOURCE11} -out %{buildroot}%{_mandir}/man5/containers-certs.d.5
6a0200
go-md2man -in %{SOURCE12} -out %{buildroot}%{_mandir}/man5/containers-registries.d.5
2d4258
go-md2man -in %{SOURCE14} -out %{buildroot}%{_mandir}/man5/containers.conf.5
2d4258
go-md2man -in %{SOURCE15} -out %{buildroot}%{_mandir}/man5/containers-auth.json.5
bae5f5
bae5f5
mkdir -p %{buildroot}%{_datadir}/containers
bae5f5
install -m0644 %{SOURCE3} %{buildroot}%{_datadir}/containers/mounts.conf
bae5f5
install -m0644 %{SOURCE7} %{buildroot}%{_datadir}/containers/seccomp.json
2d4258
install -m0644 %{SOURCE13} %{buildroot}%{_datadir}/containers/containers.conf
bae5f5
bae5f5
# install secrets patch directory
c7b324
install -d -p -m 755 %{buildroot}/%{_datadir}/rhel/secrets
bae5f5
# rhbz#1110876 - update symlinks for subscription management
bae5f5
ln -s %{_sysconfdir}/pki/entitlement %{buildroot}%{_datadir}/rhel/secrets/etc-pki-entitlement
bae5f5
ln -s %{_sysconfdir}/rhsm %{buildroot}%{_datadir}/rhel/secrets/rhsm
6a0200
ln -s %{_sysconfdir}/yum.repos.d/redhat.repo %{buildroot}%{_datadir}/rhel/secrets/redhat.repo
bae5f5
c7b324
# system tests
c7b324
install -d -p %{buildroot}/%{_datadir}/%{name}/test/system
c7b324
cp -pav systemtest/* %{buildroot}/%{_datadir}/%{name}/test/system/
c7b324
bae5f5
%check
bae5f5
%if 0%{?with_check}
bae5f5
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
6a0200
bae5f5
%gotest %{import_path}/integration
bae5f5
%endif
bae5f5
bae5f5
#define license tag if not already defined
bae5f5
%{!?_licensedir:%global license %doc}
bae5f5
bae5f5
%files -n containers-common
bae5f5
%dir %{_sysconfdir}/containers
c7b324
%dir %{_sysconfdir}/containers/certs.d
bae5f5
%dir %{_sysconfdir}/containers/registries.d
c7b324
%dir %{_sysconfdir}/containers/oci
c7b324
%dir %{_sysconfdir}/containers/oci/hooks.d
bae5f5
%config(noreplace) %{_sysconfdir}/containers/policy.json
bae5f5
%config(noreplace) %{_sysconfdir}/containers/registries.d/default.yaml
6a0200
%config(noreplace) %{_sysconfdir}/containers/storage.conf
bae5f5
%config(noreplace) %{_sysconfdir}/containers/registries.conf
2d4258
%ghost %{_sysconfdir}/containers/containers.conf
6a0200
%dir %{_sharedstatedir}/containers/sigstore
bae5f5
%{_mandir}/man5/*
bae5f5
%dir %{_datadir}/containers
bae5f5
%{_datadir}/containers/mounts.conf
bae5f5
%{_datadir}/containers/seccomp.json
2d4258
%{_datadir}/containers/containers.conf
bae5f5
%dir %{_datadir}/rhel/secrets
6a0200
%{_datadir}/rhel/secrets/*
bae5f5
bae5f5
%files
bae5f5
%license LICENSE
bae5f5
%doc README.md
bae5f5
%{_bindir}/%{name}
6a0200
%{_mandir}/man1/%{name}*
bae5f5
%dir %{_datadir}/bash-completion
bae5f5
%dir %{_datadir}/bash-completion/completions
bae5f5
%{_datadir}/bash-completion/completions/%{name}
bae5f5
c7b324
%files tests
c7b324
%license LICENSE
c7b324
%{_datadir}/%{name}/test
c7b324
bae5f5
%changelog
2d4258
* Tue May 19 2020 Jindrich Novy <jnovy@redhat.com> - 1:1.0.0-1
2d4258
- update to https://github.com/containers/skopeo/releases/tag/v1.0.0
2d4258
- Related: RHELPLAN-39206
bae5f5
2d4258
* Fri Apr 24 2020 Jindrich Novy <jnovy@redhat.com> - 1:0.2.0-5
2d4258
- follow Dan's suggestion to deliver seccomp.json and storage.conf
2d4258
  from Fedora and not directly from upstream yet
2d4258
- Related: RHELPLAN-39206
bae5f5
2d4258
* Fri Apr 24 2020 Jindrich Novy <jnovy@redhat.com> - 1:0.2.0-4
2d4258
- re-include ppc64 arch, golang doesn't seem broken there any more
2d4258
- synchronize man pages and config files with upstream
2d4258
- Related: RHELPLAN-39206
bae5f5
2d4258
* Thu Apr 23 2020 Jindrich Novy <jnovy@redhat.com> - 1:0.2.0-3
2d4258
- include and ship containers.conf
2d4258
- Resolves: #1826486
bae5f5
2d4258
* Tue Apr 21 2020 Jindrich Novy <jnovy@redhat.com> - 1:0.2.0-2
2d4258
- add docker.io into the default registry list
2d4258
- Related: RHELPLAN-39206
bae5f5
2d4258
* Fri Apr 10 2020 Jindrich Novy <jnovy@redhat.com> - 1:0.2.0-1
2d4258
- update to https://github.com/containers/skopeo/releases/tag/v0.2.0
2d4258
- initial rhel8-8.2.1 build
2d4258
- Related: RHELPLAN-39206
bae5f5