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