f24a48
%if 0%{?fedora} || 0%{?rhel} == 6
f24a48
%global with_devel 1
f24a48
%global with_bundled 0
f24a48
%global with_debug 1
f24a48
%global with_check 1
f24a48
%global with_unit_test 1
f24a48
%else
f24a48
%global with_devel 0
f24a48
%global with_bundled 1
f24a48
%global with_debug 1
f24a48
%global with_check 0
f24a48
%global with_unit_test 0
f24a48
%endif
f24a48
f24a48
%if 0%{?with_debug}
f24a48
%global _dwz_low_mem_die_limit 0
f24a48
%else
f24a48
%global debug_package   %{nil}
f24a48
%endif
f24a48
f24a48
%if ! 0%{?gobuild:1}
f24a48
%define gobuild(o:) go build -buildmode=pie -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -tags "$BUILDTAGS" -a -v -x %{?**};
f24a48
%endif
f24a48
f24a48
%global provider        github
f24a48
%global provider_tld    com
f24a48
%global project         opencontainers
f24a48
%global repo            runc
f24a48
# https://github.com/opencontainers/runc
f24a48
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
f24a48
%global import_path     %{provider_prefix}
f24a48
%global git0 https://github.com/opencontainers/runc
40f8a5
%global commit0 4bb1fe4ace1a32d3676bb98f5d3b6a4e32bf6c58
f24a48
%global shortcommit0    %(c=%{commit0}; echo ${c:0:7})
f24a48
f24a48
Name: %{repo}
f24a48
Version: 1.0.0
40f8a5
Release: 27.rc5.dev.git%{shortcommit0}%{?dist}
f24a48
Summary: CLI for running Open Containers
f24a48
License: ASL 2.0
f24a48
URL: http//%{provider_prefix}
f24a48
Source0: %{git0}/archive/%{commit0}/%{repo}-%{shortcommit0}.tar.gz
f24a48
Source1: 99-containers.conf
f24a48
Patch0: change-default-root.patch
efbbe3
Patch1: 0001-Revert-Apply-cgroups-earlier.patch
f24a48
Requires: criu
f24a48
Requires(pre): container-selinux >= 2:2.2-2
f24a48
f24a48
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
f24a48
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} >= 1.6.2
f24a48
BuildRequires: git
f24a48
BuildRequires: go-md2man
f24a48
BuildRequires: libseccomp-devel
f24a48
f24a48
%if ! 0%{?with_bundled}
f24a48
BuildRequires: golang(github.com/Sirupsen/logrus)
f24a48
BuildRequires: golang(github.com/codegangsta/cli)
f24a48
BuildRequires: golang(github.com/coreos/go-systemd/dbus)
f24a48
BuildRequires: golang(github.com/coreos/go-systemd/util)
f24a48
BuildRequires: golang(github.com/docker/docker/pkg/mount)
f24a48
BuildRequires: golang(github.com/docker/docker/pkg/symlink)
f24a48
BuildRequires: golang(github.com/docker/docker/pkg/term)
f24a48
BuildRequires: golang(github.com/docker/docker/pkg/units)
f24a48
BuildRequires: golang(github.com/godbus/dbus)
f24a48
BuildRequires: golang(github.com/golang/protobuf/proto)
f24a48
BuildRequires: golang(github.com/opencontainers/specs)
f24a48
BuildRequires: golang(github.com/syndtr/gocapability/capability)
f24a48
%endif
f24a48
f24a48
%description
f24a48
The runc command can be used to start containers which are packaged
f24a48
in accordance with the Open Container Initiative's specifications,
f24a48
and to manage containers running under runc.
f24a48
f24a48
%if 0%{?with_devel}
f24a48
%package devel
f24a48
Summary:       %{summary}
f24a48
BuildArch:     noarch
f24a48
f24a48
%if 0%{?with_check}
f24a48
BuildRequires: golang(github.com/Sirupsen/logrus)
f24a48
BuildRequires: golang(github.com/codegangsta/cli)
f24a48
BuildRequires: golang(github.com/coreos/go-systemd/dbus)
f24a48
BuildRequires: golang(github.com/coreos/go-systemd/util)
f24a48
BuildRequires: golang(github.com/docker/docker/pkg/mount)
f24a48
BuildRequires: golang(github.com/docker/docker/pkg/symlink)
f24a48
BuildRequires: golang(github.com/docker/docker/pkg/term)
f24a48
BuildRequires: golang(github.com/docker/docker/pkg/units)
f24a48
BuildRequires: golang(github.com/godbus/dbus)
f24a48
BuildRequires: golang(github.com/golang/protobuf/proto)
f24a48
BuildRequires: golang(github.com/opencontainers/specs)
f24a48
BuildRequires: golang(github.com/seccomp/libseccomp-golang)
f24a48
BuildRequires: golang(github.com/syndtr/gocapability/capability)
f24a48
BuildRequires: golang(github.com/vishvananda/netlink)
f24a48
%endif
f24a48
f24a48
Requires:      golang(github.com/Sirupsen/logrus)
f24a48
Requires:      golang(github.com/coreos/go-systemd/dbus)
f24a48
Requires:      golang(github.com/coreos/go-systemd/util)
f24a48
Requires:      golang(github.com/docker/docker/pkg/mount)
f24a48
Requires:      golang(github.com/docker/docker/pkg/symlink)
f24a48
Requires:      golang(github.com/docker/docker/pkg/units)
f24a48
Requires:      golang(github.com/godbus/dbus)
f24a48
Requires:      golang(github.com/golang/protobuf/proto)
f24a48
Requires:      golang(github.com/seccomp/libseccomp-golang)
f24a48
Requires:      golang(github.com/syndtr/gocapability/capability)
f24a48
Requires:      golang(github.com/vishvananda/netlink)
f24a48
f24a48
Provides:      golang(%{import_path}/libcontainer) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/apparmor) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/cgroups) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/cgroups/fs) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/cgroups/systemd) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/configs) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/configs/validate) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/criurpc) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/devices) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/integration) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/label) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/nsenter) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/seccomp) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/selinux) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/stacktrace) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/system) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/user) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/utils) = %{version}-%{release}
f24a48
Provides:      golang(%{import_path}/libcontainer/xattr) = %{version}-%{release}
f24a48
f24a48
%description devel
f24a48
The runc command can be used to start containers which are packaged
f24a48
in accordance with the Open Container Initiative's specifications,
f24a48
and to manage containers running under runc.
f24a48
f24a48
This package contains library source intended for
f24a48
building other packages which use import path with
f24a48
%{import_path} prefix.
f24a48
%endif
f24a48
f24a48
%if 0%{?with_unit_test} && 0%{?with_devel}
f24a48
%package unit-test
f24a48
Summary:         Unit tests for %{name} package
f24a48
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
f24a48
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
f24a48
f24a48
%if 0%{?with_check}
f24a48
#Here comes all BuildRequires: PACKAGE the unit tests
f24a48
#in %%check section need for running
f24a48
%endif
f24a48
f24a48
# test subpackage tests code from devel subpackage
f24a48
Requires:        %{name}-devel = %{version}-%{release}
f24a48
f24a48
%description unit-test
f24a48
The runc command can be used to start containers which are packaged
f24a48
in accordance with the Open Container Initiative's specifications,
f24a48
and to manage containers running under runc.
f24a48
f24a48
This package contains unit tests for project
f24a48
providing packages with %{import_path} prefix.
f24a48
%endif
f24a48
f24a48
%prep
f24a48
%autosetup -Sgit -n %{repo}-%{commit0}
f24a48
f24a48
%build
f24a48
mkdir -p GOPATH
f24a48
pushd GOPATH
f24a48
    mkdir -p src/%{provider}.%{provider_tld}/%{project}
f24a48
    ln -s $(dirs +1 -l) src/%{import_path}
f24a48
popd
f24a48
f24a48
pushd GOPATH/src/%{import_path}
f24a48
export GOPATH=%{gopath}:$(pwd)/GOPATH
f24a48
export BUILDTAGS='selinux seccomp'
f24a48
f24a48
GOPATH=$GOPATH %gobuild -o %{name} %{import_path} 
f24a48
GOPATH=$GOPATH %gobuild -o recvtty %{import_path}/contrib/cmd/recvtty
f24a48
f24a48
pushd man
f24a48
./md2man-all.sh
f24a48
popd
f24a48
f24a48
%install
f24a48
install -d -p %{buildroot}%{_bindir}
f24a48
install -p -m 755 %{name} %{buildroot}%{_bindir}
f24a48
install -p -m 755 recvtty %{buildroot}%{_bindir}
f24a48
f24a48
install -d -p %{buildroot}%{_mandir}/man8
f24a48
install -p -m 644 man/man8/* %{buildroot}%{_mandir}/man8
f24a48
f24a48
install -d -p %{buildroot}%{_usr}/lib/sysctl.d
f24a48
install -p -m 644 %{SOURCE1} %{buildroot}%{_usr}/lib/sysctl.d
f24a48
f24a48
# source codes for building projects
f24a48
%if 0%{?with_devel}
f24a48
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
f24a48
# find all *.go but no *_test.go files and generate devel.file-list
f24a48
for file in $(find . -iname "*.go" \! -iname "*_test.go" | grep -v "^./Godeps") ; do
f24a48
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
f24a48
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
f24a48
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
f24a48
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
f24a48
done
f24a48
for file in $(find . -iname "*.proto" | grep -v "^./Godeps") ; do
f24a48
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
f24a48
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
f24a48
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
f24a48
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
f24a48
done
f24a48
%endif
f24a48
f24a48
# testing files for this project
f24a48
%if 0%{?with_unit_test} && 0%{?with_devel}
f24a48
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
f24a48
# find all *_test.go files and generate unit-test.file-list
f24a48
for file in $(find . -iname "*_test.go" | grep -v "^./Godeps"); do
f24a48
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
f24a48
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
f24a48
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
f24a48
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list
f24a48
done
f24a48
%endif
f24a48
f24a48
%if 0%{?with_devel}
f24a48
sort -u -o devel.file-list devel.file-list
f24a48
%endif
f24a48
f24a48
%check
f24a48
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
f24a48
%if ! 0%{?with_bundled}
f24a48
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
f24a48
%else
f24a48
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}
f24a48
%endif
f24a48
f24a48
%if ! 0%{?gotest:1}
f24a48
%global gotest go test
f24a48
%endif
f24a48
f24a48
# FAIL: TestFactoryNewTmpfs (0.00s), factory_linux_test.go:59: operation not permitted
f24a48
#%%gotest %%{import_path}/libcontainer
f24a48
%gotest %{import_path}/libcontainer/cgroups
f24a48
%gotest %{import_path}/libcontainer/cgroups/fs
f24a48
%gotest %{import_path}/libcontainer/configs
f24a48
%gotest %{import_path}/libcontainer/devices
f24a48
# undefined reference to `nsexec'
f24a48
#%%gotest %%{import_path}/libcontainer/integration
f24a48
%gotest %{import_path}/libcontainer/label
f24a48
# Unable to create tstEth link: operation not permitted
f24a48
#%%gotest %%{import_path}/libcontainer/netlink
f24a48
# undefined reference to `nsexec'
f24a48
#%%gotest %%{import_path}/libcontainer/nsenter
f24a48
%gotest %{import_path}/libcontainer/selinux
f24a48
%gotest %{import_path}/libcontainer/stacktrace
f24a48
%gotest %{import_path}/libcontainer/user
f24a48
%gotest %{import_path}/libcontainer/utils
f24a48
%gotest %{import_path}/libcontainer/xattr
f24a48
%endif
f24a48
f24a48
#define license tag if not already defined
f24a48
%{!?_licensedir:%global license %doc}
f24a48
f24a48
%post
f24a48
%sysctl_apply 99-containers.conf
f24a48
f24a48
%files
f24a48
%license LICENSE
f24a48
%doc MAINTAINERS_GUIDE.md PRINCIPLES.md README.md CONTRIBUTING.md
f24a48
%{_bindir}/%{name}
f24a48
%{_bindir}/recvtty
f24a48
%{_mandir}/man8/%{name}*
f24a48
%{_usr}/lib/sysctl.d/99-containers.conf
f24a48
f24a48
%if 0%{?with_devel}
f24a48
%files devel -f devel.file-list
f24a48
%license LICENSE
f24a48
%doc MAINTAINERS_GUIDE.md PRINCIPLES.md README.md CONTRIBUTING.md
f24a48
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
f24a48
%dir %{gopath}/src/%{import_path}
f24a48
%endif
f24a48
f24a48
%if 0%{?with_unit_test} && 0%{?with_devel}
f24a48
%files unit-test -f unit-test.file-list
f24a48
%license LICENSE
f24a48
%doc MAINTAINERS_GUIDE.md PRINCIPLES.md README.md CONTRIBUTING.md
f24a48
%endif
f24a48
f24a48
%changelog
40f8a5
* Tue Apr 17 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-27.rc5.dev.git4bb1fe4
40f8a5
- rebuilt, placed missing changelog entry back
40f8a5
40f8a5
* Tue Feb 27 2018 Dan Walsh <dwalsh@redhat.name> - 2:1.0.0-26.rc5.git4bb1fe4
40f8a5
- release v1.0.0~rc5
40f8a5
2ffe8f
* Wed Jan 24 2018 Dan Walsh <dwalsh@redhat.name> - 1.0.0-26.rc4.git9f9c962
2ffe8f
- Bump to the latest from upstream
2ffe8f
2ffe8f
* Mon Dec 18 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-25.rc4.gite6516b3
2ffe8f
- built commit e6516b3
2ffe8f
2ffe8f
* Fri Dec 15 2017 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-24.rc4.dev.gitc6e4a1e.1
2ffe8f
- rebase to c6e4a1ebeb1a72b529c6f1b6ee2b1ae5b868b14f
2ffe8f
- https://github.com/opencontainers/runc/pull/1651
2ffe8f
efbbe3
* Tue Dec 12 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-23.rc4.git1d3ab6d
efbbe3
- Resolves: #1524654
efbbe3
efbbe3
* Sun Dec 10 2017 Dan Walsh <dwalsh@redhat.name> - 1.0.0-22.rc4.git1d3ab6d
efbbe3
- Many Stability fixes
efbbe3
- Many fixes for rootless containers
efbbe3
- Many fixes for static builds
efbbe3
f24a48
* Thu Nov 09 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-21.rc4.dev.gitaea4f21
f24a48
- enable debuginfo and include -buildmode=pie for go build
f24a48
f24a48
* Tue Nov 07 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-20.rc4.dev.gitaea4f21
f24a48
- use Makefile
f24a48
f24a48
* Tue Nov 07 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-19.rc4.dev.gitaea4f21
f24a48
- disable debuginfo temporarily
f24a48
f24a48
* Fri Nov 03 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-18.rc4.dev.gitaea4f21
f24a48
- enable debuginfo
f24a48
f24a48
* Wed Oct 25 2017 Dan Walsh <dwalsh@redhat.name> - 1.0.0-17.rc4.gitaea4f21
f24a48
- Add container-selinux prerequires to make sure runc is labeled correctly
f24a48
f24a48
* Thu Oct 19 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-16.rc4.dev.gitaea4f21
f24a48
- correct the release tag "rc4dev" -> "rc4.dev" cause I'm OCD
f24a48
f24a48
* Mon Oct 16 2017 Dan Walsh <dwalsh@redhat.com> - 1.0.0-15.rc4dev.gitaea4f21
f24a48
- Use the same checkout as Fedora for lates CRI-O
f24a48
f24a48
* Fri Sep 22 2017 Frantisek Kluknavsky <fkluknav@redhat.com> - 1.0.0-14.rc4dev.git84a082b
f24a48
- rebase to 84a082bfef6f932de921437815355186db37aeb1
f24a48
f24a48
* Tue Jun 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-13.rc3.gitd40db12
f24a48
- Resolves: #1479489
f24a48
- built commit d40db12
f24a48
f24a48
* Tue Jun 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-12.1.gitf8ce01d
f24a48
- disable s390x temporarily because of indefinite wait times on brew
f24a48
f24a48
* Tue Jun 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-11.1.gitf8ce01d
f24a48
- correct previous bogus date :\
f24a48
f24a48
* Mon Jun 12 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-10.1.gitf8ce01d
f24a48
- Resolves: #1441737 - run sysctl_apply for sysctl knob
f24a48
f24a48
* Tue May 09 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-9.1.gitf8ce01d
f24a48
- Resolves: #1447078 - change default root path
f24a48
- add commit e800860 from runc @projectatomic/change-root-path
f24a48
f24a48
* Fri May 05 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-8.1.gitf8ce01d
f24a48
- Resolves: #1441737 - enable kernel sysctl knob /proc/sys/fs/may_detach_mounts
f24a48
f24a48
* Thu Apr 13 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-7.1.gitf8ce01d
f24a48
- Resolves: #1429675
f24a48
- built @opencontainers/master commit f8ce01d
f24a48
f24a48
* Thu Mar 16 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-4.1.gitee992e5
f24a48
- built @projectatomic/master commit ee992e5
f24a48
f24a48
* Fri Feb 24 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-3.rc2
f24a48
- Resolves: #1426674
f24a48
- built projectatomic/runc_rhel_7 commit 5d93f81
f24a48
f24a48
* Mon Feb 06 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-2.rc2
f24a48
- Resolves: #1419702 - rebase to latest upstream master
f24a48
- built commit b263a43
f24a48
f24a48
* Wed Jan 11 2017 Lokesh Mandvekar <lsm5@redhat.com> - 1.0.0-1.rc2
f24a48
- Resolves: #1412239 - *CVE-2016-9962* - set init processes as non-dumpable,
f24a48
runc patch from Michael Crosby <crosbymichael@gmail.com>
f24a48
f24a48
* Wed Sep 07 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-6
f24a48
- Resolves: #1373980 - rebuild for 7.3.0
f24a48
f24a48
* Sat Jun 25 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-5
f24a48
- build with golang >= 1.6.2
f24a48
f24a48
* Tue May 31 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-4
f24a48
- release tags were inconsistent in the previous build
f24a48
f24a48
* Tue May 31 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.1-1
f24a48
- Resolves: #1341267 - rebase runc to v0.1.1
f24a48
f24a48
* Tue May 03 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.0-3
f24a48
- add selinux build tag
f24a48
- add BR: libseccomp-devel
f24a48
f24a48
* Tue May 03 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.0-2
f24a48
- Resolves: #1328970 - add seccomp buildtag
f24a48
f24a48
* Tue Apr 19 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.1.0-1
f24a48
- Resolves: rhbz#1328616 - rebase to v0.1.0
f24a48
f24a48
* Tue Mar 08 2016 Lokesh Mandvekar <lsm5@redhat.com> - 0.0.8-1.git4155b68
f24a48
- Resolves: rhbz#1277245 - bump to 0.0.8
f24a48
- Resolves: rhbz#1302363 - criu is a runtime dep
f24a48
- Resolves: rhbz#1302348 - libseccomp-golang is bundled in Godeps
f24a48
- manpages included
f24a48
f24a48
* Wed Nov 25 2015 jchaloup <jchaloup@redhat.com> - 1:0.0.5-0.1.git97bc9a7
f24a48
- Update to 0.0.5, introduce Epoch for Fedora due to 0.2 version instead of 0.0.2
f24a48
f24a48
* Fri Aug 21 2015 Jan Chaloupka <jchaloup@redhat.com> - 0.2-0.2.git90e6d37
f24a48
- First package for Fedora
f24a48
  resolves: #1255179