0ffccc
%global with_check 0
0ffccc
0ffccc
%global _find_debuginfo_dwz_opts %{nil}
0ffccc
%global _dwz_low_mem_die_limit 0
0ffccc
0ffccc
# https://bugzilla.redhat.com/show_bug.cgi?id=1904567
0ffccc
%global _lto_cflags %%{nil}
0ffccc
0ffccc
%if 0%{?rhel} > 7 && ! 0%{?fedora}
0ffccc
%define gobuild(o:) \
0ffccc
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 %{?**};
0ffccc
%else
0ffccc
%if ! 0%{?gobuild:1}
0ffccc
%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 %{?**};
0ffccc
%endif
0ffccc
%endif
0ffccc
0ffccc
%global provider github
0ffccc
%global provider_tld com
0ffccc
%global project containers
0ffccc
%global repo oci-seccomp-bpf-hook
0ffccc
# https://github.com/containers/oci-seccomp-bpf-hook
0ffccc
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
0ffccc
%global import_path %{provider_prefix}
0ffccc
%global git0 https://%{provider}.%{provider_tld}/%{project}/%{repo}
0ffccc
0ffccc
# https://fedoraproject.org/wiki/PackagingDrafts/Go#Go_Language_Architectures
0ffccc
ExclusiveArch: %{go_arches}
0ffccc
0ffccc
Name: oci-seccomp-bpf-hook
f0e369
Version: 1.2.8
54fd37
Release: 1%{?dist}
0ffccc
Summary: OCI Hook to generate seccomp json files based on EBF syscalls used by container
0ffccc
License: ASL 2.0
0ffccc
URL: %{git0}
0ffccc
Source0: %{git0}/archive/v%{version}.tar.gz
0ffccc
BuildRequires: golang
54fd37
BuildRequires: /usr/bin/go-md2man
0ffccc
BuildRequires: glib2-devel
0ffccc
BuildRequires: glibc-devel
0ffccc
BuildRequires: bcc-devel
0ffccc
BuildRequires: git
0ffccc
BuildRequires: gpgme-devel
0ffccc
BuildRequires: libseccomp-devel
0ffccc
BuildRequires: make
0ffccc
Conflicts: crun < 0.17
0ffccc
Enhances: podman
0ffccc
Enhances: cri-o
0ffccc
0ffccc
%description
0ffccc
%{summary}
0ffccc
%{repo} provides a library for applications looking to use
0ffccc
the Container Pod concept popularized by Kubernetes.
0ffccc
0ffccc
%prep
0ffccc
%autosetup -Sgit
0ffccc
sed -i '/$(MAKE) -C docs install/d' Makefile
0ffccc
sed -i 's/HOOK_BIN_DIR/\%{_usr}\/libexec\/oci\/hooks.d/' %{name}.json
0ffccc
sed -i '/$(HOOK_DIR)\/%{name}.json/d' Makefile
0ffccc
0ffccc
%build
0ffccc
export GO111MODULE=off
0ffccc
export GOPATH=$(pwd):$(pwd)/_build
0ffccc
export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
0ffccc
0ffccc
mkdir _build
0ffccc
pushd _build
0ffccc
mkdir -p src/%{provider}.%{provider_tld}/%{project}
0ffccc
ln -s ../../../../ src/%{import_path}
0ffccc
popd
0ffccc
ln -s vendor src
0ffccc
0ffccc
export GOPATH=$(pwd)/_build:$(pwd)
0ffccc
export LDFLAGS="-X main.version=%{version}"
0ffccc
%gobuild -o bin/%{name} %{import_path}
0ffccc
0ffccc
pushd docs
0ffccc
go-md2man -in %{name}.md -out %{name}.1
0ffccc
popd
0ffccc
0ffccc
%install
0ffccc
%{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} install-nobuild
0ffccc
%{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} GOMD2MAN=go-md2man -C docs install-nobuild
0ffccc
0ffccc
%check
0ffccc
%if 0%{?with_check}
0ffccc
# Since we aren't packaging up the vendor directory we need to link
0ffccc
# back to it somehow. Hack it up so that we can add the vendor
0ffccc
# directory from BUILD dir as a gopath to be searched when executing
0ffccc
# tests from the BUILDROOT dir.
0ffccc
ln -s ./ ./vendor/src # ./vendor/src -> ./vendor
0ffccc
0ffccc
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
0ffccc
0ffccc
%if ! 0%{?gotest:1}
0ffccc
%global gotest go test
0ffccc
%endif
0ffccc
0ffccc
%gotest %{import_path}/src/%{name}
0ffccc
%endif
0ffccc
0ffccc
#define license tag if not already defined
0ffccc
%{!?_licensedir:%global license %doc}
0ffccc
0ffccc
%files
0ffccc
%license LICENSE
0ffccc
%doc README.md
0ffccc
%dir %{_libexecdir}/oci/hooks.d
0ffccc
%{_libexecdir}/oci/hooks.d/%{name}
0ffccc
%{_datadir}/containers/oci/hooks.d/%{name}.json
0ffccc
%{_mandir}/man1/%{name}.1*
0ffccc
0ffccc
%changelog
f0e369
* Tue Oct 18 2022 Jindrich Novy <jnovy@redhat.com> - 1.2.8-1
f0e369
- update to https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.2.8
f0e369
- Related: #2124478
f0e369
54fd37
* Tue Jul 12 2022 Jindrich Novy <jnovy@redhat.com> - 1.2.6-1
54fd37
- update to https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.2.6
54fd37
- Related: #2061316
54fd37
54fd37
* Wed May 11 2022 Jindrich Novy <jnovy@redhat.com> - 1.2.5-2
54fd37
- BuildRequires: /usr/bin/go-md2man
54fd37
- Related: #2061316
54fd37
54fd37
* Wed Mar 16 2022 Jindrich Novy <jnovy@redhat.com> - 1.2.5-1
54fd37
- update to https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.2.5
54fd37
- Related: #2061316
54fd37
0ffccc
* Fri Oct 01 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.3-5
0ffccc
- perform only sanity/installability tests for now
0ffccc
- Related: #2000051
0ffccc
0ffccc
* Wed Sep 29 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.3-4
0ffccc
- add gating.yaml
0ffccc
- Related: #2000051
0ffccc
0ffccc
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.2.3-3
0ffccc
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
0ffccc
  Related: rhbz#1991688
0ffccc
0ffccc
* Tue Jun 22 2021 Mohan Boddu <mboddu@redhat.com> - 1.2.3-2
0ffccc
- Rebuilt for RHEL 9 BETA for openssl 3.0
0ffccc
  Related: rhbz#1971065
0ffccc
0ffccc
* Mon Jun 14 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.3-1
0ffccc
- convert crun dependency to a conflict
0ffccc
- Related: #1970747
0ffccc
0ffccc
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.2.1-2
0ffccc
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
0ffccc
0ffccc
* Fri Feb 19 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.1-1
0ffccc
- update to
0ffccc
  https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.2.1
0ffccc
- require crun >= 0.17
0ffccc
0ffccc
* Thu Jan 28 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.0-6
0ffccc
- revert back to 1.2.0 due to build issues
0ffccc
0ffccc
* Thu Jan 28 2021 Jindrich Novy <jnovy@redhat.com> - 1.2.1-1
0ffccc
- update to
0ffccc
  https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.2.1
0ffccc
0ffccc
* Tue Dec 08 2020 Jindrich Novy <jnovy@redhat.com> - 1.2.0-5
0ffccc
- use go_arches macro
0ffccc
0ffccc
* Fri Oct 02 2020 Jindrich Novy <jnovy@redhat.com> - 1.2.0-4
0ffccc
- use the same arch definitions as present in the bcc package
0ffccc
0ffccc
* Fri Oct 02 2020 Jindrich Novy <jnovy@redhat.com> - 1.2.0-3
0ffccc
- exclude also armv7hl arch as bcc is not built there
0ffccc
0ffccc
* Wed Sep 30 2020 Jindrich Novy <jnovy@redhat.com> - 1.2.0-2
0ffccc
- fix spec file to accommodate the new upstream release
0ffccc
0ffccc
* Wed Sep 30 2020 Jindrich Novy <jnovy@redhat.com> - 1.2.0-1
0ffccc
- update to
0ffccc
  https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.2.0
0ffccc
0ffccc
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-3
0ffccc
- Second attempt - Rebuilt for
0ffccc
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
0ffccc
0ffccc
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-2
0ffccc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
0ffccc
0ffccc
* Fri Jul 17 2020 Jindrich Novy <jnovy@redhat.com> - 1.1.1-1
0ffccc
- update to
0ffccc
  https://github.com/containers/oci-seccomp-bpf-hook/releases/tag/v1.1.1
0ffccc
0ffccc
* Fri Jul 17 2020 Jindrich Novy <jnovy@redhat.com> - 1.1.0-2
0ffccc
- switch to mainline releases
0ffccc
0ffccc
* Tue May 19 2020 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.1.0-1.1.git05a82a1
0ffccc
- bump version
0ffccc
- reuse Makefile targets
0ffccc
0ffccc
* Mon Feb 17 2020 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.0.1-0.6.gitba7bbb16
0ffccc
- Resolves: #1799105 - solve ftbfs and build latest upstream commit
0ffccc
0ffccc
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-0.5.git3baa603a
0ffccc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
0ffccc
0ffccc
* Tue Nov 05 2019 Jindrich Novy <jnovy@redhat.com> - 0.0.1-0.4.git3baa603a
0ffccc
- limit arches to only those supported by bcc so that this can be built
0ffccc
0ffccc
* Mon Nov 04 2019 Jindrich Novy <jnovy@redhat.com> - 0.0.1-0.3.git3baa603a
0ffccc
- fix the license - should be ASL 2.0
0ffccc
- use %%gobuild
0ffccc
0ffccc
* Mon Nov 04 2019 Jindrich Novy <jnovy@redhat.com> - 0.0.1-0.2.git3baa603a
0ffccc
- pull in golang deps as BR
0ffccc
0ffccc
* Mon Sep 23 2019 Jindrich Novy <jnovy@redhat.com> - 0.0.1-0.1.git3baa603a
0ffccc
- fix spec file and build
0ffccc
0ffccc
* Sun Sep 22 2019 Dan Walsh <dwalsh@redhat.com> - 0.0.1
0ffccc
- Initial Version