1f5593
%global with_debug 1
1f5593
%global with_bundled 1
1f5593
%global with_check 0
1f5593
1f5593
%if 0%{?with_debug}
1f5593
%global _find_debuginfo_dwz_opts %{nil}
1f5593
%global _dwz_low_mem_die_limit 0
1f5593
%else
1f5593
%global debug_package   %{nil}
1f5593
%endif
1f5593
1f5593
%if 0%{?rhel} > 7 && ! 0%{?fedora}
1f5593
%define gobuild(o:) \
1f5593
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 %{?**};
1f5593
%endif # distro
1f5593
1f5593
%global provider github
1f5593
%global provider_tld com
1f5593
%global project opencontainers
1f5593
%global repo runc
1f5593
# https://github.com/opencontainers/runc
1f5593
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
1f5593
%global import_path %{provider_prefix}
1f5593
%global git0 https://github.com/opencontainers/runc
1f5593
%global commit0 2abd837c8c25b0102ac4ce14f17bc0bc7ddffba7
1f5593
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
1f5593
1f5593
Name: %{repo}
1f5593
Version: 1.0.0
fda0f9
Release: 56.rc5.dev.git%{shortcommit0}%{?dist}
1f5593
Summary: CLI for running Open Containers
1f5593
ExcludeArch: %{ix86}
1f5593
License: ASL 2.0
1f5593
URL: http//%{provider_prefix}
1f5593
Source0: %{git0}/archive/%{commit0}/%{repo}-%{shortcommit0}.tar.gz
1f5593
Source1: 99-containers.conf
1f5593
Patch0: change-default-root.patch
1f5593
Patch1: 0001-Revert-Apply-cgroups-earlier.patch
1f5593
Patch2: 1807.patch
1f5593
Patch3: 0001-nsenter-clone-proc-self-exe-to-avoid-exposing-host-b-runc.patch
1f5593
Patch4: pivot-root.patch
1f5593
Requires: criu
1f5593
Requires(pre): container-selinux >= 2:2.2-2
1f5593
1f5593
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
1f5593
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} >= 1.6.2
1f5593
BuildRequires: git
1f5593
BuildRequires: go-md2man
1f5593
BuildRequires: libseccomp-devel
1f5593
1f5593
%description
1f5593
The runc command can be used to start containers which are packaged
1f5593
in accordance with the Open Container Initiative's specifications,
1f5593
and to manage containers running under runc.
1f5593
1f5593
%prep
1f5593
%autosetup -Sgit -n %{repo}-%{commit0}
1f5593
sed -i '/\#\!\/bin\/bash/d' contrib/completions/bash/%{name}
1f5593
1f5593
%build
1f5593
mkdir -p GOPATH
1f5593
pushd GOPATH
1f5593
    mkdir -p src/%{provider}.%{provider_tld}/%{project}
1f5593
    ln -s $(dirs +1 -l) src/%{import_path}
1f5593
popd
1f5593
1f5593
pushd GOPATH/src/%{import_path}
1f5593
export GOPATH=%{gopath}:$(pwd)/GOPATH
1f5593
export BUILDTAGS="selinux seccomp"
1f5593
%gobuild -o %{name} %{import_path} 
1f5593
1f5593
pushd man
1f5593
./md2man-all.sh
1f5593
popd
1f5593
1f5593
%install
1f5593
install -d -p %{buildroot}%{_bindir}
1f5593
install -p -m 755 %{name} %{buildroot}%{_bindir}
1f5593
1f5593
# install man pages
1f5593
install -d -p %{buildroot}%{_mandir}/man8
1f5593
install -p -m 644 man/man8/* %{buildroot}%{_mandir}/man8
1f5593
# install bash completion
1f5593
install -d -p %{buildroot}%{_datadir}/bash-completion/completions
1f5593
install -p -m 0644 contrib/completions/bash/%{name} %{buildroot}%{_datadir}/bash-completion/completions
1f5593
1f5593
%check
1f5593
1f5593
#define license tag if not already defined
1f5593
%{!?_licensedir:%global license %doc}
1f5593
1f5593
%files
1f5593
%license LICENSE
1f5593
%doc MAINTAINERS_GUIDE.md PRINCIPLES.md README.md CONTRIBUTING.md
1f5593
%{_bindir}/%{name}
1f5593
%{_mandir}/man8/%{name}*
1f5593
%{_datadir}/bash-completion/completions/%{name}
1f5593
1f5593
%changelog
fa1eb4
* Thu Nov 28 2019 Jindrich Novy <jnovy@redhat.com> - 1.0.0-56.rc5.dev.git2abd837
fda0f9
- rebuild because of CVE-2019-9512 and CVE-2019-9514
fa1eb4
- Resolves: #1766328, #1766300
fda0f9
1f5593
* Tue Feb 12 2019 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-55.rc5.dev.git2abd837
1f5593
- Resolves: #1665770 - rootfs: umount all procfs and sysfs with --no-pivot
1f5593
- Resolves: CVE-2019-5736
1f5593
1f5593
* Tue Dec 18 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-54.rc5.dev.git2abd837
1f5593
- re-enable debuginfo
1f5593
1f5593
* Mon Dec 17 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-53.rc5.dev.git2abd837
1f5593
- go toolset not in scl anymore
1f5593
1f5593
* Wed Sep 26 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-52.rc5.dev.git2abd837
1f5593
- rebase
1f5593
1f5593
* Fri Aug 31 2018 Dan Walsh <dwalsh@redhat.name> - 2:1.0.0-51.dev.gitfdd8055
1f5593
- Fix handling of tmpcopyup
1f5593
1f5593
* Fri Aug 24 2018 Lokesh Mandvekar <lsm5@redhat.com> - 2:1.0.0-49.rc5.dev.gitb4e2ecb
1f5593
- %%gobuild uses no_openssl
1f5593
- remove unused devel and unit-test subpackages
1f5593
1f5593
* Tue Aug 07 2018 Lokesh Mandvekar <lsm5@redhat.com> - 2:1.0.0-48.rc5.dev.gitad0f525
1f5593
- build with %%gobuild
1f5593
- exlude i686 temporarily because of go-toolset issues
1f5593
1f5593
* Mon Jul 30 2018 Florian Weimer <fweimer@redhat.com> - 1.0.0-47.dev.gitb4e2ecb
1f5593
- Rebuild with fixed binutils
1f5593
1f5593
* Fri Jul 27 2018 Dan Walsh <dwalsh@redhat.name> - 2:1.0.0-46.dev.gitb4e2ecb
1f5593
- Add patch https://github.com/opencontainers/runc/pull/1807 to allow
1f5593
- runc and podman to work with sd_notify
1f5593
1f5593
* Wed Jul 18 2018 Dan Walsh <dwalsh@redhat.com> - 2:1.0.0-40.rc5.dev.gitad0f525
1f5593
- Remove sysclt handling, not needed in RHEL8
1f5593
- Make sure package built with seccomp flags
1f5593
- Remove rectty
1f5593
- Add completions
1f5593
1f5593
* Fri Jun 15 2018 Dan Walsh <dwalsh@redhat.com> - 2:1.0.0-36.rc5.dev.gitad0f525
1f5593
- Better handling of user namespace
1f5593
1f5593
* Tue May 1 2018 Dan Walsh <dwalsh@redhat.name> - 2:1.0.0-31.rc5.git0cbfd83
1f5593
- Fix issues between SELinux and UserNamespace
1f5593
1f5593
* Tue Apr 17 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-27.rc5.dev.git4bb1fe4
1f5593
- rebuilt, placed missing changelog entry back
1f5593
1f5593
* Tue Feb 27 2018 Dan Walsh <dwalsh@redhat.name> - 2:1.0.0-26.rc5.git4bb1fe4
1f5593
- release v1.0.0~rc5
1f5593
1f5593
* Wed Jan 24 2018 Dan Walsh <dwalsh@redhat.name> - 1.0.0-26.rc4.git9f9c962
1f5593
- Bump to the latest from upstream
1f5593
1f5593
* Mon Dec 18 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-25.rc4.gite6516b3
1f5593
- built commit e6516b3
1f5593
1f5593
* Fri Dec 15 2017 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-24.rc4.dev.gitc6e4a1e.1
1f5593
- rebase to c6e4a1ebeb1a72b529c6f1b6ee2b1ae5b868b14f
1f5593
- https://github.com/opencontainers/runc/pull/1651
1f5593
1f5593
* Tue Dec 12 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-23.rc4.git1d3ab6d
1f5593
- Resolves: #1524654
1f5593
1f5593
* Sun Dec 10 2017 Dan Walsh <dwalsh@redhat.name> - 1.0.0-22.rc4.git1d3ab6d
1f5593
- Many Stability fixes
1f5593
- Many fixes for rootless containers
1f5593
- Many fixes for static builds
1f5593
1f5593
* Thu Nov 09 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-21.rc4.dev.gitaea4f21
1f5593
- enable debuginfo and include -buildmode=pie for go build
1f5593
1f5593
* Tue Nov 07 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-20.rc4.dev.gitaea4f21
1f5593
- use Makefile
1f5593
1f5593
* Tue Nov 07 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-19.rc4.dev.gitaea4f21
1f5593
- disable debuginfo temporarily
1f5593
1f5593
* Fri Nov 03 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-18.rc4.dev.gitaea4f21
1f5593
- enable debuginfo
1f5593
1f5593
* Wed Oct 25 2017 Dan Walsh <dwalsh@redhat.name> - 1.0.0-17.rc4.gitaea4f21
1f5593
- Add container-selinux prerequires to make sure runc is labeled correctly
1f5593
1f5593
* Thu Oct 19 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-16.rc4.dev.gitaea4f21
1f5593
- correct the release tag "rc4dev" -> "rc4.dev" cause I'm OCD
1f5593
1f5593
* Mon Oct 16 2017 Dan Walsh <dwalsh@redhat.com> - 1.0.0-15.rc4dev.gitaea4f21
1f5593
- Use the same checkout as Fedora for lates CRI-O
1f5593
1f5593
* Fri Sep 22 2017 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-14.rc4dev.git84a082b
1f5593
- rebase to 84a082bfef6f932de921437815355186db37aeb1
1f5593
1f5593
* Tue Jun 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-13.rc3.gitd40db12
1f5593
- Resolves: #1479489
1f5593
- built commit d40db12
1f5593
1f5593
* Tue Jun 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-12.1.gitf8ce01d
1f5593
- disable s390x temporarily because of indefinite wait times on brew
1f5593
1f5593
* Tue Jun 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-11.1.gitf8ce01d
1f5593
- correct previous bogus date :\
1f5593
1f5593
* Mon Jun 12 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-10.1.gitf8ce01d
1f5593
- Resolves: #1441737 - run sysctl_apply for sysctl knob
1f5593
1f5593
* Tue May 09 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-9.1.gitf8ce01d
1f5593
- Resolves: #1447078 - change default root path
1f5593
- add commit e800860 from runc @projectatomic/change-root-path
1f5593
1f5593
* Fri May 05 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-8.1.gitf8ce01d
1f5593
- Resolves: #1441737 - enable kernel sysctl knob /proc/sys/fs/may_detach_mounts
1f5593
1f5593
* Thu Apr 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-7.1.gitf8ce01d
1f5593
- Resolves: #1429675
1f5593
- built @opencontainers/master commit f8ce01d
1f5593
1f5593
* Thu Mar 16 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-4.1.gitee992e5
1f5593
- built @projectatomic/master commit ee992e5
1f5593
1f5593
* Fri Feb 24 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-3.rc2
1f5593
- Resolves: #1426674
1f5593
- built projectatomic/runc_rhel_7 commit 5d93f81
1f5593
1f5593
* Mon Feb 06 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-2.rc2
1f5593
- Resolves: #1419702 - rebase to latest upstream master
1f5593
- built commit b263a43
1f5593
1f5593
* Wed Jan 11 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-1.rc2
1f5593
- Resolves: #1412239 - *CVE-2016-9962* - set init processes as non-dumpable,
1f5593
runc patch from Michael Crosby <crosbymichael@gmail.com>
1f5593
1f5593
* Wed Sep 07 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-6
1f5593
- Resolves: #1373980 - rebuild for 7.3.0
1f5593
1f5593
* Sat Jun 25 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-5
1f5593
- build with golang >= 1.6.2
1f5593
1f5593
* Tue May 31 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-4
1f5593
- release tags were inconsistent in the previous build
1f5593
1f5593
* Tue May 31 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-1
1f5593
- Resolves: #1341267 - rebase runc to v0.1.1
1f5593
1f5593
* Tue May 03 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.0-3
1f5593
- add selinux build tag
1f5593
- add BR: libseccomp-devel
1f5593
1f5593
* Tue May 03 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.0-2
1f5593
- Resolves: #1328970 - add seccomp buildtag
1f5593
1f5593
* Tue Apr 19 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.0-1
1f5593
- Resolves: rhbz#1328616 - rebase to v0.1.0
1f5593
1f5593
* Tue Mar 08 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.0.8-1.git4155b68
1f5593
- Resolves: rhbz#1277245 - bump to 0.0.8
1f5593
- Resolves: rhbz#1302363 - criu is a runtime dep
1f5593
- Resolves: rhbz#1302348 - libseccomp-golang is bundled in Godeps
1f5593
- manpages included
1f5593
1f5593
* Wed Nov 25 2015 jchaloup <jchaloup@redhat.com> - 1:0.0.5-0.1.git97bc9a7
1f5593
- Update to 0.0.5, introduce Epoch for Fedora due to 0.2 version instead of 0.0.2
1f5593
1f5593
* Fri Aug 21 2015 Jan Chaloupka <jchaloup@redhat.com> - 0.2-0.2.git90e6d37
1f5593
- First package for Fedora
1f5593
  resolves: #1255179