e3f32e1
%global with_debug 0
6fd958a
6fd958a
%if 0%{?with_debug}
5afb1eb
%global _find_debuginfo_dwz_opts %{nil}
6fd958a
%global _dwz_low_mem_die_limit 0
6fd958a
%else
925fc12
%global debug_package   %{nil}
6fd958a
%endif
6fd958a
925fc12
%global provider github
925fc12
%global provider_tld com
1ad8428
%global project opencontainers
1ad8428
%global repo runc
6fd958a
# https://github.com/opencontainers/runc
6fd958a
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
1ad8428
%global import_path %{provider_prefix}
f46e0bb
%global git0 https://github.com/opencontainers/runc
e51b213
1ad8428
Name: %{repo}
44b4def
Epoch: 2
4fa924a
Version: 1.1.12
eb7db04
Release: %autorelease
1ad8428
Summary: CLI for running Open Containers
fba18d1
License: Apache-2.0 and BSD-2-Clause and BSD-3-Clause and MIT
f46e0bb
URL: %{git0}
4fa924a
Source0: %{git0}/archive/v%{version}/%{name}-%{version}.tar.gz
eb7db04
ExclusiveArch:  %{golang_arches_future}
6fd958a
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
1ad8428
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
Colin Walters 2ae0aa0
BuildRequires: pkgconfig(libseccomp)
1ad8428
BuildRequires: go-md2man
e761b9e
BuildRequires: make
e51b213
Provides: oci-runtime
89b8fed
# vendored libraries
89b8fed
# awk '{print "Provides: bundled(golang("$1")) = "$2}' go.mod | sort | uniq | sed -e 's/-/_/g' -e '/bundled(golang())/d' -e '/bundled(golang(go\|module\|replace\|require))/d'
89b8fed
Provides: bundled(golang(github.com/checkpoint_restore/go_criu/v5)) = v5.3.0
89b8fed
Provides: bundled(golang(github.com/cilium/ebpf)) = v0.7.0
89b8fed
Provides: bundled(golang(github.com/containerd/console)) = v1.0.3
89b8fed
Provides: bundled(golang(github.com/coreos/go_systemd/v22)) = v22.3.2
f3283fa
Provides: bundled(golang(github.com/cpuguy83/go_md2man/v2)) = v2.0.0_20190314233015_f79a8a8ca69d
89b8fed
Provides: bundled(golang(github.com/cyphar/filepath_securejoin)) = v0.2.3
89b8fed
Provides: bundled(golang(github.com/docker/go_units)) = v0.4.0
89b8fed
Provides: bundled(golang(github.com/godbus/dbus/v5)) = v5.0.6
89b8fed
Provides: bundled(golang(github.com/moby/sys/mountinfo)) = v0.5.0
89b8fed
Provides: bundled(golang(github.com/mrunalp/fileutils)) = v0.5.0
89b8fed
Provides: bundled(golang(github.com/opencontainers/runtime_spec)) = v1.0.3_0.20210326190908_1c3f411f0417
89b8fed
Provides: bundled(golang(github.com/opencontainers/selinux)) = v1.10.0
f3283fa
Provides: bundled(golang(github.com/russross/blackfriday/v2)) = v2.0.1
1053a0f
Provides: bundled(golang(github.com/seccomp/libseccomp_golang)) = v0.9.2_0.20220502022130_f33da4d89646
f3283fa
Provides: bundled(golang(github.com/shurcooL/sanitized_anchor_name)) = v1.0.0
89b8fed
Provides: bundled(golang(github.com/sirupsen/logrus)) = v1.8.1
89b8fed
Provides: bundled(golang(github.com/syndtr/gocapability)) = v0.0.0_20200815063812_42c35b437635
89b8fed
Provides: bundled(golang(github.com/urfave/cli)) = v1.22.1
89b8fed
Provides: bundled(golang(github.com/vishvananda/netlink)) = v1.1.0
f3283fa
Provides: bundled(golang(github.com/vishvananda/netns)) = v0.0.0_20191106174202_0a2b9b5464df
86a6579
Recommends: container-selinux >= 2:2.85-1
6fd958a
05e0f8e
%ifnarch s390x
05e0f8e
Recommends: criu
05e0f8e
%endif
8ad8db5
6fd958a
%description
6fd958a
The runc command can be used to start containers which are packaged
6fd958a
in accordance with the Open Container Initiative's specifications,
6fd958a
and to manage containers running under runc.
6fd958a
6fd958a
%prep
4fa924a
%autosetup -p1 -n %{name}-%{version}
d5e03a1
sed -i 's/ -trimpath//g' Makefile
6fd958a
6fd958a
%build
89b8fed
%set_build_flags
89b8fed
export CGO_CFLAGS=$CFLAGS
89b8fed
# These extra flags present in $CFLAGS have been skipped for now as they break the build
89b8fed
CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-flto=auto//g')
89b8fed
CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-Wp,D_GLIBCXX_ASSERTIONS//g')
89b8fed
CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-annobin-cc1//g')
89b8fed
89b8fed
%ifarch x86_64
89b8fed
export CGO_CFLAGS+=" -m64 -mtune=generic -fcf-protection=full"
89b8fed
%endif
89b8fed
f46e0bb
mkdir -p GOPATH
f46e0bb
pushd GOPATH
f46e0bb
    mkdir -p src/%{provider}.%{provider_tld}/%{project}
f46e0bb
    ln -s $(dirs +1 -l) src/%{import_path}
f46e0bb
popd
f46e0bb
f46e0bb
pushd GOPATH/src/%{import_path}
eb7db04
export GOPATH=$(pwd)/GOPATH
5334909
295212f
make BUILDTAGS="seccomp selinux" all
6fd958a
f3ff151
sed -i '/\#\!\/bin\/bash/d' contrib/completions/bash/%{name}
f3ff151
6fd958a
%install
6fd958a
install -d -p %{buildroot}%{_bindir}
44b4def
install -p -m 755 %{name} %{buildroot}%{_bindir}
6fd958a
55d26f3
# generate man pages
55d26f3
man/md2man-all.sh
55d26f3
55d26f3
# install man pages
55d26f3
install -d -p %{buildroot}%{_mandir}/man8
55d26f3
install -p -m 0644 man/man8/*.8 %{buildroot}%{_mandir}/man8/.
9cbb404
# install bash completion
f3ff151
install -d -p %{buildroot}%{_datadir}/bash-completion/completions
f3ff151
install -p -m 0644 contrib/completions/bash/%{name} %{buildroot}%{_datadir}/bash-completion/completions
55d26f3
6fd958a
#define license tag if not already defined
6fd958a
%{!?_licensedir:%global license %doc}
6fd958a
6fd958a
%files
6fd958a
%license LICENSE
6fd958a
%doc MAINTAINERS_GUIDE.md PRINCIPLES.md README.md CONTRIBUTING.md
6fd958a
%{_bindir}/%{name}
f3ff151
%{_mandir}/man8/%{name}*
f3ff151
%{_datadir}/bash-completion/completions/%{name}
6fd958a
6fd958a
%changelog
eb7db04
%autochangelog