6fd958a
%if 0%{?fedora} || 0%{?rhel} == 6
6fd958a
%global with_devel 1
eb3ad72
# TODO: package new deps
eb3ad72
%global with_bundled 1
6fd958a
%global with_debug 1
6fd958a
%global with_check 1
6fd958a
%global with_unit_test 1
6fd958a
%else
6fd958a
%global with_devel 0
611ae45
%global with_bundled 1
6fd958a
%global with_debug 0
6fd958a
%global with_check 0
6fd958a
%global with_unit_test 0
6fd958a
%endif
6fd958a
6fd958a
%if 0%{?with_debug}
6fd958a
%global _dwz_low_mem_die_limit 0
6fd958a
%else
1ad8428
%global	debug_package	%{nil}
6fd958a
%endif
6fd958a
1ad8428
%global	provider github
1ad8428
%global	provider_tld com
1ad8428
%global project opencontainers
1ad8428
%global repo runc
6fd958a
# https://github.com/opencontainers/runc
6fd958a
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
1ad8428
%global import_path %{provider_prefix}
6f5db54
%global commit c91b5bea4830a57eac7882d7455d59518cdf70ec
1ad8428
%global shortcommit %(c=%{commit}; echo ${c:0:7})
6fd958a
1ad8428
Name: %{repo}
2700494
%if 0%{?fedora} || 0%{?rhel} == 6
1ad8428
Epoch: 1
611ae45
%endif
1ad8428
Version: 1.0.0
fc0b54c
Release: 4.rc2.git%{shortcommit}%{?dist}
1ad8428
Summary: CLI for running Open Containers
1ad8428
License: ASL 2.0
1ad8428
URL: https://%{provider_prefix}
1ad8428
Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
6f5db54
Patch0: 0001-Set-init-processes-as-non-dumpable.patch
6fd958a
46375ab
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
f2c2bfa
#ExclusiveArch: %%{?go_arches:%%{go_arches}}%%{!?go_arches:%%{ix86} x86_64 %{arm}}
fc0b54c
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le %{mips} s390x
6fd958a
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
1ad8428
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
6fd958a
Colin Walters 2ae0aa0
BuildRequires: pkgconfig(libseccomp)
1ad8428
BuildRequires: go-md2man
55d26f3
6fd958a
%if ! 0%{?with_bundled}
6fd958a
BuildRequires: golang(github.com/Sirupsen/logrus)
6fd958a
BuildRequires: golang(github.com/codegangsta/cli)
c42c627
BuildRequires: golang(github.com/coreos/go-systemd/activation)
6fd958a
BuildRequires: golang(github.com/coreos/go-systemd/dbus)
6fd958a
BuildRequires: golang(github.com/coreos/go-systemd/util)
6fd958a
BuildRequires: golang(github.com/docker/docker/pkg/mount)
6fd958a
BuildRequires: golang(github.com/docker/docker/pkg/symlink)
6fd958a
BuildRequires: golang(github.com/docker/docker/pkg/term)
e8b7a6a
BuildRequires: golang(github.com/docker/go-units)
6fd958a
BuildRequires: golang(github.com/godbus/dbus)
6fd958a
BuildRequires: golang(github.com/golang/protobuf/proto)
be85767
BuildRequires: golang(github.com/opencontainers/runtime-spec/specs-go)
ac8f53b
BuildRequires: golang(github.com/opencontainers/specs/specs-go)
c42c627
BuildRequires: golang(github.com/seccomp/libseccomp-golang)
6fd958a
BuildRequires: golang(github.com/syndtr/gocapability/capability)
c42c627
BuildRequires: golang(github.com/vishvananda/netlink)
c42c627
BuildRequires: golang(github.com/vishvananda/netlink/nl)
6fd958a
%endif
6fd958a
6fd958a
%description
6fd958a
The runc command can be used to start containers which are packaged
6fd958a
in accordance with the Open Container Initiative's specifications,
6fd958a
and to manage containers running under runc.
6fd958a
6fd958a
%if 0%{?with_devel}
6fd958a
%package devel
1ad8428
Summary: %{summary}
1ad8428
BuildArch: noarch
6fd958a
6fd958a
%if 0%{?with_check}
6fd958a
BuildRequires: golang(github.com/Sirupsen/logrus)
6fd958a
BuildRequires: golang(github.com/coreos/go-systemd/dbus)
6fd958a
BuildRequires: golang(github.com/coreos/go-systemd/util)
6fd958a
BuildRequires: golang(github.com/docker/docker/pkg/mount)
6fd958a
BuildRequires: golang(github.com/docker/docker/pkg/symlink)
c42c627
BuildRequires: golang(github.com/docker/go-units)
6fd958a
BuildRequires: golang(github.com/godbus/dbus)
6fd958a
BuildRequires: golang(github.com/golang/protobuf/proto)
be85767
BuildRequires: golang(github.com/opencontainers/runtime-spec/specs-go)
611ae45
BuildRequires: golang(github.com/seccomp/libseccomp-golang)
6fd958a
BuildRequires: golang(github.com/syndtr/gocapability/capability)
611ae45
BuildRequires: golang(github.com/vishvananda/netlink)
c42c627
BuildRequires: golang(github.com/vishvananda/netlink/nl)
6fd958a
%endif
6fd958a
1ad8428
Requires: golang(github.com/Sirupsen/logrus)
1ad8428
Requires: golang(github.com/coreos/go-systemd/dbus)
1ad8428
Requires: golang(github.com/coreos/go-systemd/util)
1ad8428
Requires: golang(github.com/docker/docker/pkg/mount)
1ad8428
Requires: golang(github.com/docker/docker/pkg/symlink)
1ad8428
Requires: golang(github.com/docker/go-units)
1ad8428
Requires: golang(github.com/godbus/dbus)
1ad8428
Requires: golang(github.com/golang/protobuf/proto)
1ad8428
Requires: golang(github.com/opencontainers/runtime-spec/specs-go)
1ad8428
Requires: golang(github.com/seccomp/libseccomp-golang)
1ad8428
Requires: golang(github.com/syndtr/gocapability/capability)
1ad8428
Requires: golang(github.com/vishvananda/netlink)
1ad8428
Requires: golang(github.com/vishvananda/netlink/nl)
1ad8428
1ad8428
Provides: golang(%{import_path}/libcontainer) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/apparmor) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/cgroups) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/cgroups/fs) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/cgroups/systemd) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/configs) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/configs/validate) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/criurpc) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/devices) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/integration) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/keys) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/label) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/nsenter) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/seccomp) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/selinux) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/specconv) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/stacktrace) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/system) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/user) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/utils) = %{version}-%{release}
1ad8428
Provides: golang(%{import_path}/libcontainer/xattr) = %{version}-%{release}
6fd958a
6fd958a
%description devel
6fd958a
The runc command can be used to start containers which are packaged
6fd958a
in accordance with the Open Container Initiative's specifications,
6fd958a
and to manage containers running under runc.
6fd958a
6fd958a
This package contains library source intended for
6fd958a
building other packages which use import path with
6fd958a
%{import_path} prefix.
6fd958a
%endif
6fd958a
6fd958a
%if 0%{?with_unit_test} && 0%{?with_devel}
6fd958a
%package unit-test
1ad8428
Summary: Unit tests for %{name} package
6fd958a
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
1ad8428
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
6fd958a
6fd958a
%if 0%{?with_check}
6fd958a
#Here comes all BuildRequires: PACKAGE the unit tests
6fd958a
#in %%check section need for running
6fd958a
%endif
6fd958a
6fd958a
# test subpackage tests code from devel subpackage
1ad8428
Requires: %{name}-devel = %{epoch}:%{version}-%{release}
6fd958a
6fd958a
%description unit-test
6fd958a
The runc command can be used to start containers which are packaged
6fd958a
in accordance with the Open Container Initiative's specifications,
6fd958a
and to manage containers running under runc.
6fd958a
6fd958a
This package contains unit tests for project
6fd958a
providing packages with %{import_path} prefix.
6fd958a
%endif
6fd958a
6fd958a
%prep
6fd958a
%setup -q -n %{repo}-%{commit}
6fd958a
6fd958a
%build
6fd958a
mkdir -p src/github.com/opencontainers
6fd958a
ln -s ../../../ src/github.com/opencontainers/runc
6fd958a
6fd958a
%if ! 0%{?with_bundled}
6fd958a
export GOPATH=$(pwd):%{gopath}
6fd958a
%else
6fd958a
export GOPATH=$(pwd):$(pwd)/Godeps/_workspace:%{gopath}
6fd958a
%endif
6fd958a
0fbeef9
BUILDTAGS="seccomp selinux"
6fd958a
%if ! 0%{?gobuild:1}
5334909
%define gobuild() go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{**};
5334909
6fd958a
%endif
6fd958a
5334909
%gobuild -tags "$BUILDTAGS" -o bin/%{name} %{import_path}
6fd958a
6fd958a
%install
6fd958a
install -d -p %{buildroot}%{_bindir}
6fd958a
install -p -m 755 bin/%{name} %{buildroot}%{_bindir}
6fd958a
55d26f3
# generate man pages
55d26f3
man/md2man-all.sh
55d26f3
55d26f3
# install man pages
55d26f3
install -d -p %{buildroot}%{_mandir}/man8
55d26f3
install -p -m 0644 man/man8/*.8 %{buildroot}%{_mandir}/man8/.
9cbb404
# install bash completion
9cbb404
install -d -p %{buildroot}%{_sysconfdir}/bash_completion.d/
9cbb404
install -p -m 0644 contrib/completions/bash/runc %{buildroot}%{_sysconfdir}/bash_completion.d/.
55d26f3
6fd958a
# source codes for building projects
6fd958a
%if 0%{?with_devel}
6fd958a
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
6fd958a
# find all *.go but no *_test.go files and generate devel.file-list
6fd958a
for file in $(find . -iname "*.go" \! -iname "*_test.go" | grep -v "^./Godeps") ; do
6fd958a
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
6fd958a
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
6fd958a
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
6fd958a
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
6fd958a
done
6fd958a
for file in $(find . -iname "*.proto" | grep -v "^./Godeps") ; do
6fd958a
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
6fd958a
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
6fd958a
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
6fd958a
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
6fd958a
done
6fd958a
%endif
6fd958a
6fd958a
# testing files for this project
6fd958a
%if 0%{?with_unit_test} && 0%{?with_devel}
6fd958a
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
6fd958a
# find all *_test.go files and generate unit-test.file-list
6fd958a
for file in $(find . -iname "*_test.go" | grep -v "^./Godeps"); do
6fd958a
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
6fd958a
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
6fd958a
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
6fd958a
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list
6fd958a
done
6fd958a
%endif
6fd958a
6fd958a
%if 0%{?with_devel}
6fd958a
sort -u -o devel.file-list devel.file-list
6fd958a
%endif
6fd958a
6fd958a
%check
6fd958a
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
6fd958a
%if ! 0%{?with_bundled}
6fd958a
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
6fd958a
%else
6fd958a
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}
6fd958a
%endif
6fd958a
6fd958a
%if ! 0%{?gotest:1}
6fd958a
%global gotest go test
6fd958a
%endif
6fd958a
6fd958a
# FAIL: TestFactoryNewTmpfs (0.00s), factory_linux_test.go:59: operation not permitted
6fd958a
#%%gotest %%{import_path}/libcontainer
6fd958a
%gotest %{import_path}/libcontainer/cgroups
6559188
# --- FAIL: TestInvalidCgroupPath (0.00s)
6559188
#	apply_raw_test.go:16: couldn't get cgroup root: mountpoint for cgroup not found
6559188
#	apply_raw_test.go:25: couldn't get cgroup data: mountpoint for cgroup not found
1ad8428
#%%gotest %%{import_path}/libcontainer/cgroups/fs
6fd958a
%gotest %{import_path}/libcontainer/configs
6fd958a
%gotest %{import_path}/libcontainer/devices
6fd958a
# undefined reference to `nsexec'
6fd958a
#%%gotest %%{import_path}/libcontainer/integration
6fd958a
%gotest %{import_path}/libcontainer/label
6fd958a
# Unable to create tstEth link: operation not permitted
6fd958a
#%%gotest %%{import_path}/libcontainer/netlink
6fd958a
# undefined reference to `nsexec'
6fd958a
#%%gotest %%{import_path}/libcontainer/nsenter
6fd958a
%gotest %{import_path}/libcontainer/selinux
6fd958a
%gotest %{import_path}/libcontainer/stacktrace
46375ab
#constant 2147483648 overflows int
1ad8428
#%%gotest %%{import_path}/libcontainer/user
0fbeef9
#%%gotest %%{import_path}/libcontainer/utils
1ad8428
#%%gotest %%{import_path}/libcontainer/xattr
6fd958a
%endif
6fd958a
6fd958a
#define license tag if not already defined
6fd958a
%{!?_licensedir:%global license %doc}
6fd958a
6fd958a
%files
6fd958a
%license LICENSE
6fd958a
%doc MAINTAINERS_GUIDE.md PRINCIPLES.md README.md CONTRIBUTING.md
6fd958a
%{_bindir}/%{name}
55d26f3
%{_mandir}/man8/.
9cbb404
%{_sysconfdir}/bash_completion.d/runc
6fd958a
6fd958a
%if 0%{?with_devel}
6fd958a
%files devel -f devel.file-list
6fd958a
%license LICENSE
6fd958a
%doc MAINTAINERS_GUIDE.md PRINCIPLES.md README.md CONTRIBUTING.md
6fd958a
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
6fd958a
%dir %{gopath}/src/%{import_path}
6fd958a
%endif
6fd958a
6fd958a
%if 0%{?with_unit_test} && 0%{?with_devel}
6fd958a
%files unit-test -f unit-test.file-list
6fd958a
%license LICENSE
6fd958a
%doc MAINTAINERS_GUIDE.md PRINCIPLES.md README.md CONTRIBUTING.md
6fd958a
%endif
6fd958a
6fd958a
%changelog
fc0b54c
* Wed Jan 18 2017 Dennis Gilmore <dennis@ausil.us> - 1:1.0.0-4.rc2
fc0b54c
- enable aarch64
fc0b54c
6f5db54
* Wed Jan 11 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1:1.0.0-3.rc2
6f5db54
- Resolves: #1412238 - *CVE-2016-9962* - set init processes as non-dumpable,
6f5db54
runc patch from Michael Crosby <crosbymichael@gmail.com>
6f5db54
5334909
* Fri Jan 06 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1:1.0.0-2.rc2.git47ea5c7
5334909
- patch to enable seccomp
6f5bfdc
- Pass $BUILDTAGS to the compiler in cases where we don't have to define
6f5bfdc
gobuild for ourselves.
5334909
- From: Nalin Dahyabhai <nalin@redhat.com>
5334909
eb3ad72
* Wed Dec 21 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1:1.0.0-1.rc2.git47ea5c7
eb3ad72
- bump to 1.0.0 rc2
eb3ad72
- built commit 47ea5c7
eb3ad72
- build with bundled sources for now (some new dependencies need to be packaged)
eb3ad72
1ad8428
* Wed Aug 24 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1:1.0.0-1.rc1.git04f275d
1ad8428
- Resolves: #1342707 - bump to v1.0.0-rc1
1ad8428
- built commit 04f275d
1ad8428
- cosmetic changes to make rpmlint happy
1ad8428
0dbf799
* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.1.1-4.git57b9972
0dbf799
- https://fedoraproject.org/wiki/Changes/golang1.7
0dbf799
9cbb404
* Thu May 26 2016 jchaloup <jchaloup@redhat.com> - 1:0.1.1-3.git57b9972
9cbb404
- Add bash completion
9cbb404
  resolves: #1340119
9cbb404
0fbeef9
* Thu May 19 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1:0.1.1-2.gitbaf6536
0fbeef9
- add selinux to BUILDTAGS in addition to the default seccomp tag
0fbeef9
be85767
* Tue Apr 26 2016 jchaloup <jchaloup@redhat.com> - 1:0.1.1-0.1.gitbaf6536
be85767
- Update to v0.1.1
be85767
  resolves: #1330378
be85767
55d26f3
* Tue Apr 12 2016 jchaloup <jchaloup@redhat.com> - 1:0.0.9-0.3.git94dc520
55d26f3
- Ship man pages too
55d26f3
  resolves: #1326115
55d26f3
46375ab
* Wed Apr 06 2016 jchaloup <jchaloup@redhat.com> - 1:0.0.9-0.2.git94dc520
46375ab
- Extend supported architectures to golang_arches
46375ab
  Disable failing test
46375ab
  related: #1290943
46375ab
d449988
* Wed Mar 16 2016 jchaloup <jchaloup@redhat.com> - 1:0.0.9-0.1.git94dc520
ac8f53b
- Update to 0.0.9
ac8f53b
  resolves: #1290943
ac8f53b
c42c627
* Wed Mar 02 2016 jchaloup <jchaloup@redhat.com> - 1:0.0.8-0.1.git1a124e9
c42c627
- Update to 0.0.8
c42c627
997895b
* Mon Feb 22 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.0.5-0.4.git97bc9a7
997895b
- https://fedoraproject.org/wiki/Changes/golang1.6
997895b
bd8787f
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.0.5-0.3.git97bc9a7
bd8787f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
bd8787f
a67578c
* Wed Dec 02 2015 jchaloup <jchaloup@redhat.com> - 1:0.0.5-0.2.git97bc9a7
a67578c
- unit-test-devel subpackage requires devel with correct epoch
a67578c
611ae45
* Wed Nov 25 2015 jchaloup <jchaloup@redhat.com> - 1:0.0.5-0.1.git97bc9a7
611ae45
- Update to 0.0.5, introduce Epoch for Fedora due to 0.2 version instead of 0.0.2
2700494
  resolves: #1286114
611ae45
6fd958a
* Fri Aug 21 2015 Jan Chaloupka <jchaloup@redhat.com> - 0.2-0.2.git90e6d37
6fd958a
- First package for Fedora
6fd958a
  resolves: #1255179