999688
%global with_check 0
999688
999688
%global _find_debuginfo_dwz_opts %{nil}
999688
%global _dwz_low_mem_die_limit 0
999688
999688
%if 0%{?rhel} > 7 && ! 0%{?fedora}
999688
%define gobuild(o:) \
999688
go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -linkmode=external -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v %{?**};
999688
%else
999688
%if ! 0%{?gobuild:1}
999688
%define gobuild(o:) GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -linkmode=external -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 %{?**};
999688
%endif
999688
%endif
999688
999688
%global provider github
999688
%global provider_tld com
999688
%global project containers
999688
%global repo oci-seccomp-bpf-hook
999688
# https://github.com/containers/oci-seccomp-bpf-hook
999688
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
999688
%global import_path %{provider_prefix}
999688
%global git0 https://%{provider}.%{provider_tld}/%{project}/%{repo}
999688
999688
# https://fedoraproject.org/wiki/PackagingDrafts/Go#Go_Language_Architectures
999688
ExclusiveArch: %{go_arches}
999688
999688
Name: oci-seccomp-bpf-hook
49a94c
Version: 1.2.5
15de40
Release: 2%{?dist}
999688
Summary: OCI Hook to generate seccomp json files based on EBF syscalls used by container
999688
License: ASL 2.0
999688
URL: %{git0}
999688
Source0: %{git0}/archive/v%{version}.tar.gz
15de40
Patch0: https://github.com/containers/oci-seccomp-bpf-hook/commit/245cc45ad45f8024c602696f58ae163d0dc745d5.patch
999688
BuildRequires: golang
999688
BuildRequires: go-md2man
999688
BuildRequires: glib2-devel
999688
BuildRequires: glibc-devel
999688
BuildRequires: bcc-devel
999688
BuildRequires: git
999688
BuildRequires: gpgme-devel
999688
BuildRequires: libseccomp-devel
999688
BuildRequires: make
999688
Conflicts: crun < 0.17
999688
Enhances: podman
999688
Enhances: cri-o
999688
999688
%description
999688
%{summary}
999688
%{repo} provides a library for applications looking to use
999688
the Container Pod concept popularized by Kubernetes.
999688
999688
%prep
999688
%autosetup -Sgit
999688
sed -i '/$(MAKE) -C docs install/d' Makefile
999688
sed -i 's/HOOK_BIN_DIR/\%{_usr}\/libexec\/oci\/hooks.d/' %{name}.json
999688
sed -i '/$(HOOK_DIR)\/%{name}.json/d' Makefile
999688
999688
%build
999688
export GO111MODULE=off
999688
export GOPATH=$(pwd):$(pwd)/_build
999688
export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
999688
999688
mkdir _build
999688
pushd _build
999688
mkdir -p src/%{provider}.%{provider_tld}/%{project}
999688
ln -s ../../../../ src/%{import_path}
999688
popd
999688
ln -s vendor src
999688
999688
export GOPATH=$(pwd)/_build:$(pwd)
999688
export LDFLAGS="-X main.version=%{version}"
999688
%gobuild -o bin/%{name} %{import_path}
999688
999688
pushd docs
999688
go-md2man -in %{name}.md -out %{name}.1
999688
popd
999688
999688
%install
999688
%{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} install-nobuild
999688
%{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} GOMD2MAN=go-md2man -C docs install-nobuild
999688
999688
%check
999688
%if 0%{?with_check}
999688
# Since we aren't packaging up the vendor directory we need to link
999688
# back to it somehow. Hack it up so that we can add the vendor
999688
# directory from BUILD dir as a gopath to be searched when executing
999688
# tests from the BUILDROOT dir.
999688
ln -s ./ ./vendor/src # ./vendor/src -> ./vendor
999688
999688
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
999688
999688
%if ! 0%{?gotest:1}
999688
%global gotest go test
999688
%endif
999688
999688
%gotest %{import_path}/src/%{name}
999688
%endif
999688
999688
#define license tag if not already defined
999688
%{!?_licensedir:%global license %doc}
999688
999688
%files
999688
%license LICENSE
999688
%doc README.md
999688
%dir %{_libexecdir}/oci/hooks.d
999688
%{_libexecdir}/oci/hooks.d/%{name}
999688
%{_datadir}/containers/oci/hooks.d/%{name}.json
999688
%{_mandir}/man1/%{name}.1*
999688
999688
%changelog
15de40
* Mon Feb 06 2023 Jindrich Novy <jnovy@redhat.com> - 1.2.5-2
15de40
- fix compatibility with the new bcc
15de40
- Related: #2123641
15de40
49a94c
* Wed Mar 16 2022 Jindrich Novy <jnovy@redhat.com> - 1.2.5-1
49a94c
- update to https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.2.5
49a94c
- Related: #2061390
49a94c
999688
* Wed May 26 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.3-3
999688
- change runc dependency to conflict
999688
- Related: #1934415
999688
999688
* Wed May 19 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.3-2
999688
- remove unneeded patch
999688
- Related: #1934415
999688
999688
* Wed May 19 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.3-1
999688
- update to https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.2.3
999688
- fix build
999688
- Related: #1934415
999688
999688
* Mon Feb 22 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.0-2
999688
- revert back to 1.2.0 - build issues
999688
- Related: #1883490
999688
999688
* Fri Feb 19 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.1-1
999688
- update to
999688
  https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.2.1
999688
- require crun >= 0.17
999688
- Related: #1883490
999688
999688
* Thu Jan 28 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.0-1
999688
- revert back to 1.2.0 due to build issues
999688
- Related: #1883490
999688
999688
* Thu Jan 28 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.1-1
999688
- update to https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.2.1
999688
- Related: #1883490
999688
999688
* Tue Dec 08 2020 Jindrich Novy <jnovy@redhat.com> - 1.2.0-2
999688
- sync with RHEL8 devel branch
999688
- Related: #1883490
999688
999688
* Wed Oct 21 2020 Jindrich Novy <jnovy@redhat.com> - 1.2.0-1
999688
- synchronize with stream-container-tools-rhel8
999688
- Related: #1883490
999688
999688
* Tue Aug 11 2020 Jindrich Novy <jnovy@redhat.com> - 1.1.2-3
999688
- propagate proper CFLAGS to CGO_CFLAGS to assure code hardening and optimization
999688
- Related: #1821193
999688
999688
* Thu Jul 23 2020 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.1.2-2
999688
- Resolves: #1857606
999688
999688
* Fri Jul 17 2020 Jindrich Novy <jnovy@redhat.com> - 1.1.2-1
999688
- update to https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.1.2
999688
- Related: #1821193
999688
999688
* Thu Jun 18 2020 Jindrich Novy <jnovy@redhat.com> - 1.1.1-1
999688
- update to https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.1.1
999688
- Related: #1821193
999688
999688
* Tue May 12 2020 Jindrich Novy <jnovy@redhat.com> - 1.1.0-2
999688
- exclude i686 arch as bcc, the build dependency is not built
999688
  for it
999688
- Related: #1821193
999688
999688
* Tue May 12 2020 Jindrich Novy <jnovy@redhat.com> - 1.1.0-1
999688
- initial build for container-tools-rhel8
999688
- Related: #1821193