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