2021-04-21 20:55:29 +00:00
|
|
|
%global with_debug 0
|
2015-09-19 17:46:02 +00:00
|
|
|
|
|
|
|
%if 0%{?with_debug}
|
2018-07-20 19:30:47 +00:00
|
|
|
%global _find_debuginfo_dwz_opts %{nil}
|
2015-09-19 17:46:02 +00:00
|
|
|
%global _dwz_low_mem_die_limit 0
|
|
|
|
%else
|
2017-12-18 11:30:05 +00:00
|
|
|
%global debug_package %{nil}
|
2015-09-19 17:46:02 +00:00
|
|
|
%endif
|
|
|
|
|
2017-12-18 11:30:05 +00:00
|
|
|
%global provider github
|
|
|
|
%global provider_tld com
|
2016-08-25 01:11:27 +00:00
|
|
|
%global project opencontainers
|
|
|
|
%global repo runc
|
2015-09-19 17:46:02 +00:00
|
|
|
# https://github.com/opencontainers/runc
|
|
|
|
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
|
2016-08-25 01:11:27 +00:00
|
|
|
%global import_path %{provider_prefix}
|
2017-03-24 14:05:17 +00:00
|
|
|
%global git0 https://github.com/opencontainers/runc
|
2021-04-21 20:08:20 +00:00
|
|
|
|
2023-04-06 01:14:13 +00:00
|
|
|
%global built_tag v1.1.5
|
2021-09-10 13:56:29 +00:00
|
|
|
%global built_tag_strip %(b=%{built_tag}; echo ${b:1})
|
2022-03-29 19:32:40 +00:00
|
|
|
%global gen_version %(b=%{built_tag_strip}; echo ${b/-/"~"})
|
2015-09-19 17:46:02 +00:00
|
|
|
|
2016-08-25 01:11:27 +00:00
|
|
|
Name: %{repo}
|
2017-09-05 19:48:22 +00:00
|
|
|
Epoch: 2
|
2022-03-29 19:32:40 +00:00
|
|
|
Version: %{gen_version}
|
2023-04-11 20:13:45 +00:00
|
|
|
Release: %autorelease
|
2016-08-25 01:11:27 +00:00
|
|
|
Summary: CLI for running Open Containers
|
2023-03-06 11:47:20 +00:00
|
|
|
License: Apache-2.0 and BSD-2-Clause and BSD-3-Clause and MIT
|
2017-03-24 14:05:17 +00:00
|
|
|
URL: %{git0}
|
2022-08-09 02:26:20 +00:00
|
|
|
Source0: %{git0}/archive/%{built_tag}/%{name}-%{version}.tar.gz
|
2023-04-11 20:13:45 +00:00
|
|
|
ExclusiveArch: %{golang_arches_future}
|
2015-09-19 17:46:02 +00:00
|
|
|
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
|
2021-04-21 20:42:35 +00:00
|
|
|
%if 0%{?fedora}
|
2016-08-25 01:11:27 +00:00
|
|
|
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
|
2021-04-21 20:42:35 +00:00
|
|
|
%else
|
|
|
|
BuildRequires: golang
|
|
|
|
%endif
|
2016-12-16 14:06:42 +00:00
|
|
|
BuildRequires: pkgconfig(libseccomp)
|
2016-08-25 01:11:27 +00:00
|
|
|
BuildRequires: go-md2man
|
2018-01-28 17:11:58 +00:00
|
|
|
BuildRequires: make
|
2021-04-21 20:08:20 +00:00
|
|
|
Provides: oci-runtime
|
2022-03-29 19:32:40 +00:00
|
|
|
# vendored libraries
|
|
|
|
# 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'
|
|
|
|
Provides: bundled(golang(github.com/checkpoint_restore/go_criu/v5)) = v5.3.0
|
|
|
|
Provides: bundled(golang(github.com/cilium/ebpf)) = v0.7.0
|
|
|
|
Provides: bundled(golang(github.com/containerd/console)) = v1.0.3
|
|
|
|
Provides: bundled(golang(github.com/coreos/go_systemd/v22)) = v22.3.2
|
|
|
|
Provides: bundled(golang(github.com/cyphar/filepath_securejoin)) = v0.2.3
|
|
|
|
Provides: bundled(golang(github.com/docker/go_units)) = v0.4.0
|
|
|
|
Provides: bundled(golang(github.com/godbus/dbus/v5)) = v5.0.6
|
|
|
|
Provides: bundled(golang(github.com/moby/sys/mountinfo)) = v0.5.0
|
|
|
|
Provides: bundled(golang(github.com/mrunalp/fileutils)) = v0.5.0
|
|
|
|
Provides: bundled(golang(github.com/opencontainers/runtime_spec)) = v1.0.3_0.20210326190908_1c3f411f0417
|
|
|
|
Provides: bundled(golang(github.com/opencontainers/selinux)) = v1.10.0
|
2022-10-16 16:00:14 +00:00
|
|
|
Provides: bundled(golang(github.com/seccomp/libseccomp_golang)) = v0.9.2_0.20220502022130_f33da4d89646
|
2022-03-29 19:32:40 +00:00
|
|
|
Provides: bundled(golang(github.com/sirupsen/logrus)) = v1.8.1
|
|
|
|
Provides: bundled(golang(github.com/syndtr/gocapability)) = v0.0.0_20200815063812_42c35b437635
|
|
|
|
Provides: bundled(golang(github.com/urfave/cli)) = v1.22.1
|
|
|
|
Provides: bundled(golang(github.com/vishvananda/netlink)) = v1.1.0
|
2019-03-11 19:31:48 +00:00
|
|
|
Recommends: container-selinux >= 2:2.85-1
|
2015-09-19 17:46:02 +00:00
|
|
|
|
2017-06-26 23:03:12 +00:00
|
|
|
%ifnarch s390x
|
|
|
|
Recommends: criu
|
|
|
|
%endif
|
2017-02-01 21:23:06 +00:00
|
|
|
|
2015-09-19 17:46:02 +00:00
|
|
|
%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
|
2022-05-22 22:50:02 +00:00
|
|
|
%autosetup -p1 -n %{name}-%{built_tag_strip}
|
2021-09-10 13:56:29 +00:00
|
|
|
sed -i 's/ -trimpath//g' Makefile
|
2015-09-19 17:46:02 +00:00
|
|
|
|
|
|
|
%build
|
2022-03-29 19:32:40 +00:00
|
|
|
%set_build_flags
|
|
|
|
export CGO_CFLAGS=$CFLAGS
|
|
|
|
# These extra flags present in $CFLAGS have been skipped for now as they break the build
|
|
|
|
CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-flto=auto//g')
|
|
|
|
CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-Wp,D_GLIBCXX_ASSERTIONS//g')
|
|
|
|
CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-annobin-cc1//g')
|
|
|
|
|
|
|
|
%ifarch x86_64
|
|
|
|
export CGO_CFLAGS+=" -m64 -mtune=generic -fcf-protection=full"
|
|
|
|
%endif
|
|
|
|
|
2017-03-24 14:05:17 +00:00
|
|
|
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}
|
2023-04-11 20:13:45 +00:00
|
|
|
export GOPATH=$(pwd)/GOPATH
|
2017-01-06 19:59:06 +00:00
|
|
|
|
2019-04-19 08:42:07 +00:00
|
|
|
make BUILDTAGS="seccomp selinux" all
|
2015-09-19 17:46:02 +00:00
|
|
|
|
2017-12-26 06:08:39 +00:00
|
|
|
sed -i '/\#\!\/bin\/bash/d' contrib/completions/bash/%{name}
|
|
|
|
|
2015-09-19 17:46:02 +00:00
|
|
|
%install
|
|
|
|
install -d -p %{buildroot}%{_bindir}
|
2017-09-05 19:48:22 +00:00
|
|
|
install -p -m 755 %{name} %{buildroot}%{_bindir}
|
2015-09-19 17:46:02 +00:00
|
|
|
|
2016-04-12 10:31:39 +00:00
|
|
|
# generate man pages
|
|
|
|
man/md2man-all.sh
|
|
|
|
|
|
|
|
# install man pages
|
|
|
|
install -d -p %{buildroot}%{_mandir}/man8
|
|
|
|
install -p -m 0644 man/man8/*.8 %{buildroot}%{_mandir}/man8/.
|
2016-05-26 13:35:18 +00:00
|
|
|
# install bash completion
|
2017-12-26 06:08:39 +00:00
|
|
|
install -d -p %{buildroot}%{_datadir}/bash-completion/completions
|
|
|
|
install -p -m 0644 contrib/completions/bash/%{name} %{buildroot}%{_datadir}/bash-completion/completions
|
2016-04-12 10:31:39 +00:00
|
|
|
|
2015-09-19 17:46:02 +00:00
|
|
|
#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}
|
2017-12-26 06:08:39 +00:00
|
|
|
%{_mandir}/man8/%{name}*
|
|
|
|
%{_datadir}/bash-completion/completions/%{name}
|
2015-09-19 17:46:02 +00:00
|
|
|
|
|
|
|
%changelog
|
2023-04-11 20:13:45 +00:00
|
|
|
%autochangelog
|