%global with_devel 0 %global with_bundled 1 %global with_debug 1 %global with_check 0 %global with_unit_test 0 %if 0%{?with_debug} %global _find_debuginfo_dwz_opts %{nil} %global _dwz_low_mem_die_limit 0 %else %global debug_package %{nil} %endif # %if ! 0% {?gobuild:1} %define gobuild(o:) go build -tags="$BUILDTAGS" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; #% endif %global provider github %global provider_tld com %global project containers %global repo oci-seccomp-bpf-hook # https://github.com/containers/oci-seccomp-bpf-hook %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} %global import_path %{provider_prefix} %global git0 https://%{provider}.%{provider_tld}/%{project}/%{repo} %global commit0 3baa603ae910f2aad29ea694b78b2f7f34b5d5ce %global shortcommit0 %(c=%{commit0}; echo ${c:0:8}) Name: oci-seccomp-bpf-hook Version: 0.0.1 Release: 0.3.git%{shortcommit0}%{?dist} Summary: OCI Hook to generate seccomp json files based on EBF syscalls used by container License: ASL 2.0 URL: %{git0} Source0: %{git0}/archive/%{commit0}/%{repo}-%{shortcommit0}.tar.gz # If go_compiler is not set to 1, there is no virtual provide. Use golang instead. BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} BuildRequires: golang-github-cpuguy83-md2man BuildRequires: glib2-devel BuildRequires: glibc-devel BuildRequires: bcc-devel BuildRequires: git BuildRequires: gpgme-devel BuildRequires: libseccomp-devel BuildRequires: make %description %{summary} %{repo} provides a library for applications looking to use the Container Pod concept popularized by Kubernetes. %package remote Summary: Remote Oci-Seccomp-Bpf client %description remote %{summary} %{repo} provides a library for applications looking to use the Container Pod concept popularized by Kubernetes. %prep %autosetup -Sgit -n %{repo}-%{commit0} %build mkdir _build pushd _build mkdir -p src/%{provider}.%{provider_tld}/%{project} ln -s ../../../../ src/%{import_path} popd ln -s vendor src export GOPATH=$(pwd)/_build:$(pwd) export GO111MODULE=off export BUILDTAGS="" BUILDTAGS=$BUILDTAGS %gobuild -o bin/%{name} %{import_path} %{__make} docs %install %{__make} DESTDIR=%{buildroot} PREFIX=%{_prefix} ETCDIR=%{buildroot}%{_sysconfdir} OCI-SECCOMP-BPF_VERSION=%{version} install %check %if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} # Since we aren't packaging up the vendor directory we need to link # back to it somehow. Hack it up so that we can add the vendor # directory from BUILD dir as a gopath to be searched when executing # tests from the BUILDROOT dir. ln -s ./ ./vendor/src # ./vendor/src -> ./vendor export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath} %if ! 0%{?gotest:1} %global gotest go test %endif %gotest %{import_path}/src/%{name} %endif #define license tag if not already defined %{!?_licensedir:%global license %doc} %files %license LICENSE %doc README.md %dir %{_libexecdir}/oci/hooks.d %{_libexecdir}/oci/hooks.d/%{name} %{_datadir}/containers/oci/hooks.d/%{name}.json %{_mandir}/man1/%{name}.1* %changelog * Mon Nov 04 2019 Jindrich Novy - 0.0.1-0.3.git3baa603a - fix the license - should be ASL 2.0 * Mon Nov 04 2019 Jindrich Novy - 0.0.1-0.2.git3baa603a - pull in golang deps as BR * Mon Sep 23 2019 Jindrich Novy - 0.0.1-0.1.git3baa603a - fix spec file and build * Sun Sep 22 2019 Dan Walsh - 0.0.1 - Initial Version