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