%global with_debug 1 %global with_bundled 1 %global with_check 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%{?rhel} > 7 && ! 0%{?fedora} %define gobuild(o:) \ GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback no_openssl ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**}; %endif %global provider github %global provider_tld com %global project opencontainers %global repo runc # https://github.com/opencontainers/runc %global import_path %{provider}.%{provider_tld}/%{project}/%{repo} %global git0 https://%{import_path} %global commit0 e677e8b33930d54b6335ea7db1faab797609c4c6 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) Name: %{repo} Version: 1.0.0 Release: 70.rhaos4.5.git%{shortcommit0}%{?dist} Summary: CLI for running Open Containers ExcludeArch: %{ix86} License: ASL 2.0 URL: https://github.com/projectatomic/runc Source0: %{url}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz BuildRequires: golang >= 1.12.12-4 BuildRequires: git BuildRequires: go-md2man BuildRequires: libseccomp-devel Requires: criu Requires(pre): container-selinux >= 2:2.2-2 %description The runc command can be used to start containers which are packaged in accordance with the Open Container Initiative's specifications, and to manage containers running under runc. %prep %autosetup -Sgit -n %{repo}-%{commit0} sed -i '/\#\!\/bin\/bash/d' contrib/completions/bash/%{name} %build mkdir -p GOPATH pushd GOPATH mkdir -p src/%{provider}.%{provider_tld}/%{project} ln -s $(dirs +1 -l) src/%{import_path} popd pushd GOPATH/src/%{import_path} export GOPATH=%{gopath}:$(pwd)/GOPATH export BUILDTAGS="selinux seccomp" %gobuild -o %{name} %{import_path} pushd man ./md2man-all.sh popd %install install -d -p %{buildroot}%{_bindir} install -p -m 755 %{name} %{buildroot}%{_bindir} # install man pages install -d -p %{buildroot}%{_mandir}/man8 install -p -m 644 man/man8/* %{buildroot}%{_mandir}/man8 # install bash completion install -d -p %{buildroot}%{_datadir}/bash-completion/completions install -p -m 0644 contrib/completions/bash/%{name} %{buildroot}%{_datadir}/bash-completion/completions %check #define license tag if not already defined %{!?_licensedir:%global license %doc} %files %license LICENSE %doc MAINTAINERS_GUIDE.md PRINCIPLES.md README.md CONTRIBUTING.md %{_bindir}/%{name} %{_mandir}/man8/%{name}* %{_datadir}/bash-completion/completions/%{name} %changelog * Mon Jun 15 2020 Peter Hunt - 1.0.0-70.rhaos4.5.gite677e8b - Resolves: #1843470 write to state.json atomically * Tue May 12 2020 Lokesh Mandvekar - 1.0.0-69.rhaos4.5.gita70f354 - build from projectatomc/runc branch rhaos-4.5 * Tue May 05 2020 Jindrich Novy - 1.0.0-68.rc10.rhaos4.5 - use the same release as in rhel7 * Wed Feb 19 2020 Jindrich Novy - 1.0.0-65.rc10.rhaos4.5 - add rhaos4.5 to release - initial RHAOS 4.5 build