diff --git a/golang-github-docker-libcontainer.spec b/golang-github-docker-libcontainer.spec index a5c9a4a..e148bbb 100644 --- a/golang-github-docker-libcontainer.spec +++ b/golang-github-docker-libcontainer.spec @@ -1,56 +1,21 @@ -%if 0%{?fedora} || 0%{?rhel} == 6 -%global with_devel 1 -%global with_bundled 0 -%global with_debug 1 -# some tests are failing -%global with_check 0 -%global with_unit_test 1 -%else -%global with_devel 0 -%global with_bundled 1 -%global with_debug 0 -%global with_check 0 -%global with_unit_test 0 -%endif - -%if 0%{?with_debug} -%global _dwz_low_mem_die_limit 0 -%else -%global debug_package %{nil} -%endif - -%if ! 0%{?gobuild:1} -%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; -%endif - -%global provider github -%global provider_tld com -%global project docker -%global repo libcontainer -# https://github.com/docker/libcontainer -%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} -%global import_path %{provider_prefix} +# http://github.com/docker/libcontainer +%global provider_prefix github.com/docker/libcontainer +%global gobaseipath %{provider_prefix} %global commit c9643688cb73c2588a9c9b14357bda6c3a9df67f -%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global commitdate 20150609 -Name: golang-github-docker-libcontainer +%gocraftmeta -i + +Name: %{goname} Version: 2.1.1 -Release: 0.14.git%{shortcommit}%{?dist} +Release: 0.15.%{commitdate}git%{shortcommit}%{?dist} Summary: Configuration options for containers License: ASL 2.0 -URL: https://%{provider_prefix} -Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz +URL: %{gourl} +Source0:%{gosource} Patch0: update-to-newer-signature-of-systemd.Conn-methods.patch Patch1: libcontainer-fixDup3syscall.patch -# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required -ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}} -# Include ppc64le once updated to newer version -ExcludeArch: ppc64 ppc64le -# If go_compiler is not set to 1, there is no virtual provide. Use golang instead. -BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} - -%if ! 0%{?with_bundled} BuildRequires: golang(github.com/Sirupsen/logrus) BuildRequires: golang(github.com/codegangsta/cli) >= 1.1.0-1 BuildRequires: golang(github.com/coreos/go-systemd/dbus) @@ -61,9 +26,6 @@ BuildRequires: golang(github.com/docker/docker/pkg/term) BuildRequires: golang(github.com/godbus/dbus) BuildRequires: golang(github.com/golang/protobuf/proto) BuildRequires: golang(github.com/syndtr/gocapability/capability) >= 0-0.9 -%endif - -Provides: nsinit = %{version}-%{release} %description libcontainer specifies configuration options for what a container is. It @@ -74,12 +36,10 @@ working with namespaces, networking, and management. This package provides the nsinit binary as well, but it is currently for debugging purposes only and not officially supported. -%if 0%{?with_devel} %package devel Summary: Configuration options for containers BuildArch: noarch -%if 0%{?with_check} BuildRequires: golang(github.com/Sirupsen/logrus) BuildRequires: golang(github.com/coreos/go-systemd/dbus) BuildRequires: golang(github.com/docker/docker/pkg/mount) @@ -87,35 +47,6 @@ BuildRequires: golang(github.com/docker/docker/pkg/symlink) BuildRequires: golang(github.com/godbus/dbus) BuildRequires: golang(github.com/golang/protobuf/proto) BuildRequires: golang(github.com/syndtr/gocapability/capability) >= 0-0.9 -%endif - -Requires: golang(github.com/Sirupsen/logrus) -Requires: golang(github.com/coreos/go-systemd/dbus) -Requires: golang(github.com/docker/docker/pkg/mount) -Requires: golang(github.com/docker/docker/pkg/symlink) -Requires: golang(github.com/godbus/dbus) -Requires: golang(github.com/golang/protobuf/proto) -Requires: golang(github.com/syndtr/gocapability/capability) >= 0-0.9 - -Provides: golang(%{import_path}) = %{version}-%{release} -Provides: golang(%{import_path}/apparmor) = %{version}-%{release} -Provides: golang(%{import_path}/cgroups) = %{version}-%{release} -Provides: golang(%{import_path}/cgroups/fs) = %{version}-%{release} -Provides: golang(%{import_path}/cgroups/systemd) = %{version}-%{release} -Provides: golang(%{import_path}/configs) = %{version}-%{release} -Provides: golang(%{import_path}/configs/validate) = %{version}-%{release} -Provides: golang(%{import_path}/criurpc) = %{version}-%{release} -Provides: golang(%{import_path}/devices) = %{version}-%{release} -Provides: golang(%{import_path}/integration) = %{version}-%{release} -Provides: golang(%{import_path}/label) = %{version}-%{release} -Provides: golang(%{import_path}/netlink) = %{version}-%{release} -Provides: golang(%{import_path}/nsenter) = %{version}-%{release} -Provides: golang(%{import_path}/selinux) = %{version}-%{release} -Provides: golang(%{import_path}/stacktrace) = %{version}-%{release} -Provides: golang(%{import_path}/system) = %{version}-%{release} -Provides: golang(%{import_path}/user) = %{version}-%{release} -Provides: golang(%{import_path}/utils) = %{version}-%{release} -Provides: golang(%{import_path}/xattr) = %{version}-%{release} %description devel libcontainer specifies configuration options for what a container is. It @@ -125,109 +56,25 @@ working with namespaces, networking, and management. This package contains library source intended for building other packages which use libcontainer. -%endif - -%if 0%{?with_unit_test} && 0%{?with_devel} -%package unit-test-devel -Summary: Unit tests for %{name} package -%if 0%{?with_check} -#Here comes all BuildRequires: PACKAGE the unit tests -#in %%check section need for running -%endif - -# test subpackage tests code from devel subpackage -Requires: %{name}-devel = %{version}-%{release} - -%if 0%{?with_check} && ! 0%{?with_bundled} -%endif - -%description unit-test-devel -%{summary} - -This package contains unit tests for project -providing packages with %{import_path} prefix. -%endif %prep -%setup -q -n %{repo}-%{commit} -%if ! 0%{?with_bundled} +%gosetup %patch0 -p1 %patch1 -p1 -b .dup3 -%endif %build -mkdir -p src/github.com/docker -ln -s ../../../ src/github.com/docker/libcontainer - -%if ! 0%{?with_bundled} -export GOPATH=$(pwd):%{gopath} -%else -export GOPATH=$(pwd):$(pwd)/vendor:%{gopath} -%endif - -%gobuild -o bin/nsinit %{import_path}/nsinit +%gobuildroot +%gobuild -o _bin/nsinit %{gobaseipath}/nsinit %install # Install nsinit install -d %{buildroot}%{_bindir} -install -p -m 755 bin/nsinit %{buildroot}%{_bindir}/nsinit - -# source codes for building projects -%if 0%{?with_devel} -install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ -echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list -# find all *.go but no *_test.go files and generate devel.file-list -for file in $(find . -iname "*.go" \! -iname "*_test.go" | egrep -v "./vendor/src") ; do - echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list - install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) - cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file - echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list -done -%endif - -# testing files for this project -%if 0%{?with_unit_test} && 0%{?with_devel} -install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ -# find all *_test.go files and generate unit-test-devel.file-list -for file in $(find . -iname "*_test.go" | egrep -v "./vendor/src") ; do - echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list - install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) - cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file - echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list -done -%endif - -%if 0%{?with_devel} -sort -u -o devel.file-list devel.file-list -%endif +install -p -m 755 _bin/nsinit %{buildroot}%{_bindir}/nsinit + +%goinstall sample_configs %check -%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} -%if ! 0%{?with_bundled} -export GOPATH=%{buildroot}/%{gopath}:%{gopath} -%else -export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath} -%endif - -%if ! 0%{?gotest:1} -%global gotest go test -%endif - -%gotest %{import_path} -%gotest %{import_path}/cgroups -%gotest %{import_path}/cgroups/fs -%gotest %{import_path}/configs -%gotest %{import_path}/devices -%gotest %{import_path}/integration -%gotest %{import_path}/label -%gotest %{import_path}/netlink -%gotest %{import_path}/nsenter -%gotest %{import_path}/selinux -%gotest %{import_path}/stacktrace -%gotest %{import_path}/user -%gotest %{import_path}/utils -%gotest %{import_path}/xattr -%endif +%gochecks %{gobaseipath} %{gobaseipath}/{integration,devices,netlink,nsenter} #define license tag if not already defined %{!?_licensedir:%global license %doc} @@ -238,20 +85,14 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath} %doc PRINCIPLES.md README.md ROADMAP.md %{_bindir}/nsinit -%if 0%{?with_devel} %files devel -f devel.file-list %license LICENSE %doc ROADMAP.md PRINCIPLES.md MAINTAINERS_GUIDE.md CONTRIBUTING.md README.md SPEC.md -%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} -%endif - -%if 0%{?with_unit_test} && 0%{?with_devel} -%files unit-test-devel -f unit-test-devel.file-list -%license LICENSE -%doc ROADMAP.md PRINCIPLES.md MAINTAINERS_GUIDE.md CONTRIBUTING.md README.md SPEC.md -%endif %changelog +* Wed Feb 28 2018 Jan Chaloupka - 2.1.1-0.15.20150609gitc964368 +- Autogenerate some parts using the new macros + * Wed Feb 07 2018 Fedora Release Engineering - 2.1.1-0.14.gitc964368 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild