7f5044
%global with_check 0
7f5044
7f5044
%global _find_debuginfo_dwz_opts %{nil}
7f5044
%global _dwz_low_mem_die_limit 0
7f5044
7f5044
%if 0%{?rhel} > 7 && ! 0%{?fedora}
7f5044
%define gobuild(o:) \
7f5044
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 %{?**};
7f5044
%else
7f5044
%if ! 0%{?gobuild:1}
7f5044
%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 %{?**};
7f5044
%endif
7f5044
%endif
7f5044
7f5044
%global provider github
7f5044
%global provider_tld com
7f5044
%global project opencontainers
7f5044
%global repo runc
7f5044
# https://github.com/opencontainers/runc
7f5044
%global import_path %{provider}.%{provider_tld}/%{project}/%{repo}
7f5044
%global git0 https://%{import_path}
e9b209
%global release_candidate rc95
7f5044
7f5044
Name: %{repo}
7f5044
Version: 1.0.0
e9b209
Release: 73.%{release_candidate}%{?dist}
7f5044
Summary: CLI for running Open Containers
7f5044
# https://fedoraproject.org/wiki/PackagingDrafts/Go#Go_Language_Architectures
7f5044
#ExclusiveArch: %%{go_arches}
7f5044
# still use arch exclude as the macro above still refers %%{ix86} in RHEL8.4:
7f5044
# https://bugzilla.redhat.com/show_bug.cgi?id=1905383
7f5044
ExcludeArch: %{ix86}
7f5044
License: ASL 2.0
7f5044
URL: %{git0}
7f5044
Source0: %{git0}/archive/v1.0.0-%{release_candidate}.tar.gz
7f5044
Provides: oci-runtime = 1
7f5044
BuildRequires: golang >= 1.12.12-4
7f5044
BuildRequires: git
7f5044
BuildRequires: go-md2man
7f5044
BuildRequires: libseccomp-devel
7f5044
Requires: criu
7f5044
7f5044
%description
7f5044
The runc command can be used to start containers which are packaged
7f5044
in accordance with the Open Container Initiative's specifications,
7f5044
and to manage containers running under runc.
7f5044
7f5044
%prep
7f5044
%autosetup -Sgit -n %{repo}-%{version}-%{release_candidate}
7f5044
sed -i '/\#\!\/bin\/bash/d' contrib/completions/bash/%{name}
7f5044
7f5044
%build
7f5044
mkdir -p GOPATH
7f5044
pushd GOPATH
7f5044
    mkdir -p src/%{provider}.%{provider_tld}/%{project}
7f5044
    ln -s $(dirs +1 -l) src/%{import_path}
7f5044
popd
7f5044
7f5044
pushd GOPATH/src/%{import_path}
e9b209
export GO111MODULE=off
7f5044
export GOPATH=%{gopath}:$(pwd)/GOPATH
7f5044
export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
7f5044
export BUILDTAGS="selinux seccomp"
7f5044
%gobuild -o %{name} %{import_path}
7f5044
7f5044
pushd man
7f5044
./md2man-all.sh
7f5044
popd
7f5044
7f5044
%install
7f5044
install -d -p %{buildroot}%{_bindir}
7f5044
install -p -m 755 %{name} %{buildroot}%{_bindir}
7f5044
7f5044
# install man pages
7f5044
install -d -p %{buildroot}%{_mandir}/man8
7f5044
install -p -m 644 man/man8/* %{buildroot}%{_mandir}/man8
7f5044
# install bash completion
7f5044
install -d -p %{buildroot}%{_datadir}/bash-completion/completions
7f5044
install -p -m 0644 contrib/completions/bash/%{name} %{buildroot}%{_datadir}/bash-completion/completions
7f5044
7f5044
%check
7f5044
7f5044
#define license tag if not already defined
7f5044
%{!?_licensedir:%global license %doc}
7f5044
7f5044
%files
7f5044
%license LICENSE
7f5044
%doc MAINTAINERS_GUIDE.md PRINCIPLES.md README.md CONTRIBUTING.md
7f5044
%{_bindir}/%{name}
7f5044
%{_mandir}/man8/%{name}*
7f5044
%{_datadir}/bash-completion/completions/%{name}
7f5044
7f5044
%changelog
e9b209
* Tue Jan 04 2022 Jindrich Novy <jnovy@redhat.com> - 1.0.0-73.rc95
e9b209
- fix podman run --pid=host command causes OCI permission error
e9b209
- rc95 fixes CVE-2021-30465
e9b209
- Related: #2001445
e9b209
e9b209
* Thu Aug 05 2021 Jindrich Novy <jnovy@redhat.com> - 1.0.0-72.rc92
e9b209
- fix "Under load, container failed to be created due to missing cgroup scope"
e9b209
- Resolves: #1990406
e9b209
e9b209
* Fri May 21 2021 Jindrich Novy <jnovy@redhat.com> - 1.0.0-71.rc92
e9b209
- fix CVE-2021-30465
e9b209
- Related: #1955656
e9b209
7f5044
* Fri Feb 19 2021 Jindrich Novy <jnovy@redhat.com> - 1.0.0-70.rc92
7f5044
- add missing Provides: oci-runtime = 1
7f5044
- Related: #1883490
7f5044
7f5044
* Tue Dec 08 2020 Jindrich Novy <jnovy@redhat.com> - 1.0.0-69.rc92
7f5044
- still use ExcludeArch as go_arches macro is broken for 8.4
7f5044
- Related: #1883490
7f5044
7f5044
* Tue Aug 11 2020 Jindrich Novy <jnovy@redhat.com> - 1.0.0-68.rc92
7f5044
- update to https://github.com/opencontainers/runc/releases/tag/v1.0.0-rc92
7f5044
- propagate proper CFLAGS to CGO_CFLAGS to assure code hardening and optimization
7f5044
- Related: #1821193
7f5044
7f5044
* Thu Jul 02 2020 Jindrich Novy <jnovy@redhat.com> - 1.0.0-67.rc91
7f5044
- update to https://github.com/opencontainers/runc/releases/tag/v1.0.0-rc91
7f5044
- Related: #1821193
7f5044
7f5044
* Tue May 12 2020 Jindrich Novy <jnovy@redhat.com> - 1.0.0-66.rc10
7f5044
- synchronize containter-tools 8.3.0 with 8.2.1
7f5044
- Related: #1821193
7f5044
7f5044
* Wed Feb 12 2020 Jindrich Novy <jnovy@redhat.com> - 1.0.0-65.rc10
7f5044
- address CVE-2019-19921 by updating to rc10
7f5044
- Resolves: #1801887
7f5044
7f5044
* Wed Dec 11 2019 Jindrich Novy <jnovy@redhat.com> - 1.0.0-64.rc9
7f5044
- use no_openssl in BUILDTAGS (no vendored crypto in runc)
7f5044
- Related: RHELPLAN-25139
7f5044
7f5044
* Mon Dec 09 2019 Jindrich Novy <jnovy@redhat.com> - 1.0.0-63.rc9
7f5044
- be sure to use golang >= 1.12.12-4
7f5044
- Related: RHELPLAN-25139
7f5044
7f5044
* Thu Nov 28 2019 Jindrich Novy <jnovy@redhat.com> - 1.0.0-62.rc9
7f5044
- rebuild because of CVE-2019-9512 and CVE-2019-9514
7f5044
- Resolves: #1766331, #1766303
7f5044
7f5044
* Thu Nov 21 2019 Jindrich Novy <jnovy@redhat.com> - 1.0.0-61.rc9
7f5044
- update to runc 1.0.0-rc9 release
7f5044
- amend golang deps
7f5044
- fixes CVE-2019-16884
7f5044
- Resolves: #1759651
7f5044
7f5044
* Mon Jun 17 2019 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-60.rc8
7f5044
- Resolves: #1721247 - enable fips mode
7f5044
7f5044
* Mon Jun 17 2019 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-59.rc8
7f5044
- Resolves: #1720654 - rebase to v1.0.0-rc8
7f5044
7f5044
* Thu Apr 11 2019 Eduardo Santiago <santiago@redhat.com> - 1.0.0-57.rc5.dev.git2abd837
7f5044
- Resolves: #1693424 - podman rootless: cannot specify gid= mount options
7f5044
7f5044
* Wed Feb 27 2019 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-56.rc5.dev.git2abd837
7f5044
- change-default-root patch not needed as there's no docker on rhel8
7f5044
7f5044
* Tue Feb 12 2019 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-55.rc5.dev.git2abd837
7f5044
- Resolves: CVE-2019-5736
7f5044
7f5044
* Tue Dec 18 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-54.rc5.dev.git2abd837
7f5044
- re-enable debuginfo
7f5044
7f5044
* Mon Dec 17 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-53.rc5.dev.git2abd837
7f5044
- go toolset not in scl anymore
7f5044
7f5044
* Wed Sep 26 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-52.rc5.dev.git2abd837
7f5044
- rebase
7f5044
7f5044
* Fri Aug 31 2018 Dan Walsh <dwalsh@redhat.name> - 2:1.0.0-51.dev.gitfdd8055
7f5044
- Fix handling of tmpcopyup
7f5044
7f5044
* Fri Aug 24 2018 Lokesh Mandvekar <lsm5@redhat.com> - 2:1.0.0-49.rc5.dev.gitb4e2ecb
7f5044
- %%gobuild uses no_openssl
7f5044
- remove unused devel and unit-test subpackages
7f5044
7f5044
* Tue Aug 07 2018 Lokesh Mandvekar <lsm5@redhat.com> - 2:1.0.0-48.rc5.dev.gitad0f525
7f5044
- build with %%gobuild
7f5044
- exlude i686 temporarily because of go-toolset issues
7f5044
7f5044
* Mon Jul 30 2018 Florian Weimer <fweimer@redhat.com> - 1.0.0-47.dev.gitb4e2ecb
7f5044
- Rebuild with fixed binutils
7f5044
7f5044
* Fri Jul 27 2018 Dan Walsh <dwalsh@redhat.name> - 2:1.0.0-46.dev.gitb4e2ecb
7f5044
- Add patch https://github.com/opencontainers/runc/pull/1807 to allow
7f5044
- runc and podman to work with sd_notify
7f5044
7f5044
* Wed Jul 18 2018 Dan Walsh <dwalsh@redhat.com> - 2:1.0.0-40.rc5.dev.gitad0f525
7f5044
- Remove sysclt handling, not needed in RHEL8
7f5044
- Make sure package built with seccomp flags
7f5044
- Remove rectty
7f5044
- Add completions
7f5044
7f5044
* Fri Jun 15 2018 Dan Walsh <dwalsh@redhat.com> - 2:1.0.0-36.rc5.dev.gitad0f525
7f5044
- Better handling of user namespace
7f5044
7f5044
* Tue May 1 2018 Dan Walsh <dwalsh@redhat.name> - 2:1.0.0-31.rc5.git0cbfd83
7f5044
- Fix issues between SELinux and UserNamespace
7f5044
7f5044
* Tue Apr 17 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-27.rc5.dev.git4bb1fe4
7f5044
- rebuilt, placed missing changelog entry back
7f5044
7f5044
* Tue Feb 27 2018 Dan Walsh <dwalsh@redhat.name> - 2:1.0.0-26.rc5.git4bb1fe4
7f5044
- release v1.0.0~rc5
7f5044
7f5044
* Wed Jan 24 2018 Dan Walsh <dwalsh@redhat.name> - 1.0.0-26.rc4.git9f9c962
7f5044
- Bump to the latest from upstream
7f5044
7f5044
* Mon Dec 18 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-25.rc4.gite6516b3
7f5044
- built commit e6516b3
7f5044
7f5044
* Fri Dec 15 2017 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-24.rc4.dev.gitc6e4a1e.1
7f5044
- rebase to c6e4a1ebeb1a72b529c6f1b6ee2b1ae5b868b14f
7f5044
- https://github.com/opencontainers/runc/pull/1651
7f5044
7f5044
* Tue Dec 12 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-23.rc4.git1d3ab6d
7f5044
- Resolves: #1524654
7f5044
7f5044
* Sun Dec 10 2017 Dan Walsh <dwalsh@redhat.name> - 1.0.0-22.rc4.git1d3ab6d
7f5044
- Many Stability fixes
7f5044
- Many fixes for rootless containers
7f5044
- Many fixes for static builds
7f5044
7f5044
* Thu Nov 09 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-21.rc4.dev.gitaea4f21
7f5044
- enable debuginfo and include -buildmode=pie for go build
7f5044
7f5044
* Tue Nov 07 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-20.rc4.dev.gitaea4f21
7f5044
- use Makefile
7f5044
7f5044
* Tue Nov 07 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-19.rc4.dev.gitaea4f21
7f5044
- disable debuginfo temporarily
7f5044
7f5044
* Fri Nov 03 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-18.rc4.dev.gitaea4f21
7f5044
- enable debuginfo
7f5044
7f5044
* Wed Oct 25 2017 Dan Walsh <dwalsh@redhat.name> - 1.0.0-17.rc4.gitaea4f21
7f5044
- Add container-selinux prerequires to make sure runc is labeled correctly
7f5044
7f5044
* Thu Oct 19 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-16.rc4.dev.gitaea4f21
7f5044
- correct the release tag "rc4dev" -> "rc4.dev" cause I'm OCD
7f5044
7f5044
* Mon Oct 16 2017 Dan Walsh <dwalsh@redhat.com> - 1.0.0-15.rc4dev.gitaea4f21
7f5044
- Use the same checkout as Fedora for lates CRI-O
7f5044
7f5044
* Fri Sep 22 2017 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-14.rc4dev.git84a082b
7f5044
- rebase to 84a082bfef6f932de921437815355186db37aeb1
7f5044
7f5044
* Tue Jun 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-13.rc3.gitd40db12
7f5044
- Resolves: #1479489
7f5044
- built commit d40db12
7f5044
7f5044
* Tue Jun 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-12.1.gitf8ce01d
7f5044
- disable s390x temporarily because of indefinite wait times on brew
7f5044
7f5044
* Tue Jun 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-11.1.gitf8ce01d
7f5044
- correct previous bogus date :\
7f5044
7f5044
* Mon Jun 12 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-10.1.gitf8ce01d
7f5044
- Resolves: #1441737 - run sysctl_apply for sysctl knob
7f5044
7f5044
* Tue May 09 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-9.1.gitf8ce01d
7f5044
- Resolves: #1447078 - change default root path
7f5044
- add commit e800860 from runc @projectatomic/change-root-path
7f5044
7f5044
* Fri May 05 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-8.1.gitf8ce01d
7f5044
- Resolves: #1441737 - enable kernel sysctl knob /proc/sys/fs/may_detach_mounts
7f5044
7f5044
* Thu Apr 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-7.1.gitf8ce01d
7f5044
- Resolves: #1429675
7f5044
- built @opencontainers/master commit f8ce01d
7f5044
7f5044
* Thu Mar 16 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-4.1.gitee992e5
7f5044
- built @projectatomic/master commit ee992e5
7f5044
7f5044
* Fri Feb 24 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-3.rc2
7f5044
- Resolves: #1426674
7f5044
- built projectatomic/runc_rhel_7 commit 5d93f81
7f5044
7f5044
* Mon Feb 06 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-2.rc2
7f5044
- Resolves: #1419702 - rebase to latest upstream master
7f5044
- built commit b263a43
7f5044
7f5044
* Wed Jan 11 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-1.rc2
7f5044
- Resolves: #1412239 - *CVE-2016-9962* - set init processes as non-dumpable,
7f5044
runc patch from Michael Crosby <crosbymichael@gmail.com>
7f5044
7f5044
* Wed Sep 07 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-6
7f5044
- Resolves: #1373980 - rebuild for 7.3.0
7f5044
7f5044
* Sat Jun 25 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-5
7f5044
- build with golang >= 1.6.2
7f5044
7f5044
* Tue May 31 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-4
7f5044
- release tags were inconsistent in the previous build
7f5044
7f5044
* Tue May 31 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-1
7f5044
- Resolves: #1341267 - rebase runc to v0.1.1
7f5044
7f5044
* Tue May 03 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.0-3
7f5044
- add selinux build tag
7f5044
- add BR: libseccomp-devel
7f5044
7f5044
* Tue May 03 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.0-2
7f5044
- Resolves: #1328970 - add seccomp buildtag
7f5044
7f5044
* Tue Apr 19 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.0-1
7f5044
- Resolves: rhbz#1328616 - rebase to v0.1.0
7f5044
7f5044
* Tue Mar 08 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.0.8-1.git4155b68
7f5044
- Resolves: rhbz#1277245 - bump to 0.0.8
7f5044
- Resolves: rhbz#1302363 - criu is a runtime dep
7f5044
- Resolves: rhbz#1302348 - libseccomp-golang is bundled in Godeps
7f5044
- manpages included
7f5044
7f5044
* Wed Nov 25 2015 jchaloup <jchaloup@redhat.com> - 1:0.0.5-0.1.git97bc9a7
7f5044
- Update to 0.0.5, introduce Epoch for Fedora due to 0.2 version instead of 0.0.2
7f5044
7f5044
* Fri Aug 21 2015 Jan Chaloupka <jchaloup@redhat.com> - 0.2-0.2.git90e6d37
7f5044
- First package for Fedora
7f5044
  resolves: #1255179