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