commit 20d54c20724a8480446e4beeff50df839554f234
Author: Lokesh Mandvekar <[email protected]>
Date:   Mon Jan 5 20:07:11 2015 +0000

    Resolves: rhbz#1175144 - update to v1.4.1
    
    NVR: docker-io-1.4.1-1
    
    - subpackages for fish, vim, zsh and logrotate cron job
    - patch for 'docker exec' via Vincent Batts <[email protected]>
    
    Signed-off-by: Lokesh Mandvekar <[email protected]>

 0001-docker-exec-patch-for-older-kernels.patch |   33 +++++++
 README.docker-logrotate                        |   17 ++++
 docker-io.spec                                 |  112 ++++++++++++++++++++----
 docker-logrotate.sh                            |   11 +++
 sources                                        |    2 +-
 5 files changed, 155 insertions(+), 20 deletions(-)
---
diff --git a/0001-docker-exec-patch-for-older-kernels.patch 
b/0001-docker-exec-patch-for-older-kernels.patch
new file mode 100644
index 0000000..59b572d
--- /dev/null
+++ b/0001-docker-exec-patch-for-older-kernels.patch
@@ -0,0 +1,33 @@
+From 9728ad1030f5374addd30753762fe2add4c9f11d Mon Sep 17 00:00:00 2001
+From: Lokesh Mandvekar <[email protected]>
+Date: Mon, 5 Jan 2015 18:36:43 +0000
+Subject: [PATCH] docker exec patch for older kernels
+
+https://github.com/docker/libcontainer/issues/309
+
+From: Vincent Batts <[email protected]>
+Signed-off-by: Lokesh Mandvekar <[email protected]>
+---
+ vendor/src/github.com/docker/libcontainer/namespaces/nsenter/nsenter.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git 
a/vendor/src/github.com/docker/libcontainer/namespaces/nsenter/nsenter.c 
b/vendor/src/github.com/docker/libcontainer/namespaces/nsenter/nsenter.c
+index f060f63..02e4649 100644
+--- a/vendor/src/github.com/docker/libcontainer/namespaces/nsenter/nsenter.c
++++ b/vendor/src/github.com/docker/libcontainer/namespaces/nsenter/nsenter.c
+@@ -89,10 +89,12 @@ void nsenter()
+               return;
+       }
+
++#ifdef PR_SET_CHILD_SUBREAPER
+       if (prctl(PR_SET_CHILD_SUBREAPER, 1, 0, 0, 0) == -1) {
+                 fprintf(stderr, "nsenter: failed to set child subreaper: %s", 
strerror(errno));
+                 exit(1);
+         }
++#endif
+
+       static const struct option longopts[] = {
+               {"nspid", required_argument, NULL, 'n'},
+-- 
+2.2.0
+
diff --git a/README.docker-logrotate b/README.docker-logrotate
new file mode 100644
index 0000000..e142ad1
--- /dev/null
+++ b/README.docker-logrotate
@@ -0,0 +1,17 @@
+This package will install the 'docker-logrotate' script to
+/etc/cron.daily. This script will run logrotate on all running
+containers and ignore all failures.
+
+This script is enabled by default. To disable it,
+uncomment the line "LOGROTATE=false" in /etc/sysconfig/docker.
+
+Possible issues:
+1. This assumes that logrotate is installed on containers to run
+successfully.
+
+2. A race condition occurs if a container exits before 'docker
+exec' run (though it's ignored)
+
+3. Not all containers may need this (whether logrotate is installed or not)
+
+Suggestions to improve this are welcome.
diff --git a/docker-io.spec b/docker-io.spec
index b6f0056..2b8d670 100644
--- a/docker-io.spec
+++ b/docker-io.spec
@@ -10,12 +10,12 @@
 %global repo            %{project}
 
 %global import_path %{provider}.%{provider_tld}/%{project}/%{repo}
-%global commit      4595d4fb03093acf87b905bebc5ba4964d7c0707
+%global commit      5bc2ff8a36e9a768e8b479de4fe3ea9c9daf4121
 %global shortcommit %(c=%{commit}; echo ${c:0:7})
 
 Name:       %{repo}-io
-Version:    1.4.0
-Release:    2%{?dist}
+Version:    1.4.1
+Release:    1%{?dist}
 Summary:    Automates deployment of containerized applications
 License:    ASL 2.0
 URL:        http://www.docker.com
@@ -24,13 +24,17 @@ ExclusiveArch:  x86_64
 Source0:        https://github.com/docker/docker/archive/v%{version}.tar.gz
 # though final name for sysconf file is simply 'docker',
 # having .sysconfig makes things clear
-Source1:        docker.sysconfig
-Source2:        docker-storage.sysconfig
+Source1:    docker.sysconfig
+Source2:    docker-storage.sysconfig
 # have init script wait up to 5 mins before forcibly terminating docker daemon
 # 
https://github.com/docker/docker/commit/640d2ef6f54d96ac4fc3f0f745cb1e6a35148607
-Source3:        docker.sysvinit
+Source3:    docker.sysvinit
+Source4:    docker-network.sysconfig
+Source5:    docker-logrotate.sh
+Source6:    README.%{repo}-logrotate
+Patch0:     0001-docker-exec-patch-for-older-kernels.patch 
 BuildRequires:  glibc-static
-#BuildRequires:  golang >= 1.3.3
+BuildRequires:  golang >= 1.3.3
 # for gorilla/mux and kr/pty https://github.com/dotcloud/docker/pull/5950
 #BuildRequires:  golang(github.com/gorilla/mux) >= 0-0.13
 #BuildRequires:  golang(github.com/kr/pty) >= 0-0.19
@@ -176,14 +180,46 @@ Provides:   golang(%{import_path}/pkg/version) = 
%{version}-%{release}
 These source librariees are provided by docker, but are independent of docker 
specific logic.
 The import paths of %{import_path}/pkg/...
 
+%package fish-completion
+Summary:    fish completion files for docker
+Requires:   %{name} = %{version}-%{release}
+Requires:   fish
+Provides:   %{repo}-fish-completion = %{version}-%{release}
+
+%description fish-completion
+This package installs %{summary}.
+
+%package logrotate
+Summary:    cron job to run logrotate on docker containers
+Requires:   %{name} = %{version}-%{release}
+Provides:   %{repo}-logrotate = %{version}-%{release}
+
+%description logrotate
+This package installs %{summary}. logrotate is assumed to be installed on
+containers for this to work, failures are silently ignored.
+
+%package vim
+Summary:    vim syntax highlighting files for docker
+Requires:   %{name} = %{version}-%{release}
+Requires:   vim
+Provides:   %{repo}-vim = %{version}-%{release}
+
+%description vim
+This package installs %{summary}.
+
+%package zsh-completion
+Summary:    zsh completion files for docker
+Requires:   %{name} = %{version}-%{release}
+Requires:   zsh
+Provides:   %{repo}-zsh-completion = %{version}-%{release}
+
+%description zsh-completion
+This package installs %{summary}.
+
 %prep
 %setup -q -n docker-%{version}
-#rm -rf vendor
-#find . -name "*.go" \
-#        -print |\
-#        xargs sed -i 
's/github.com\/docker\/docker\/vendor\/src\/code.google.com\/p\/go\/src\/pkg\///g'
-sed -i '/getopt.h/a\\n\#ifndef PR_SET_CHILD_SUBREAPER\n\#define 
PR_SET_CHILD_SUBREAPER 36\n\#endif' \
-        vendor/src/github.com/docker/libcontainer/namespaces/nsenter/nsenter.c
+cp %{SOURCE6} .
+%patch0 -p1
 
 %build
 # set up temporary build gopath, and put our directory there
@@ -218,6 +254,16 @@ install -p -m 644 docs/man/man5/Dockerfile.5 
%{buildroot}%{_mandir}/man5
 install -dp %{buildroot}%{_datadir}/bash-completion/completions
 install -p -m 644 contrib/completion/bash/docker 
%{buildroot}%{_datadir}/bash-completion/completions
 
+# install fish completion
+# create, install and own /usr/share/fish/vendor_completions.d until
+# upstream fish provides it
+install -dp %{buildroot}%{_datadir}/fish/vendor_completions.d
+install -p -m 644 contrib/completion/fish/%{repo}.fish 
%{buildroot}%{_datadir}/fish/vendor_completions.d
+
+# install container logrotate cron script
+install -dp %{buildroot}%{_sysconfdir}/cron.daily/
+install -p -m 755 %{SOURCE5} 
%{buildroot}%{_sysconfdir}/cron.daily/%{repo}-logrotate
+
 # install zsh completion
 # zsh completion has been upstreamed into docker and
 # this will be removed once it enters the zsh rpm
@@ -242,6 +288,7 @@ install -d -m 700 %{buildroot}%{_sharedstatedir}/docker
 install -d %{buildroot}%{_sysconfdir}/sysconfig/
 install -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/docker
 install -p -m 644 %{SOURCE2} 
%{buildroot}%{_sysconfdir}/sysconfig/docker-storage
+install -p -m 644 %{SOURCE4} 
%{buildroot}%{_sysconfdir}/sysconfig/docker-network
 install -d %{buildroot}%{_initddir}
 install -p -m 755 %{SOURCE3} %{buildroot}%{_initddir}/docker
 
@@ -258,6 +305,12 @@ do
     cp -rpav $dir %{buildroot}/%{gopath}/src/%{import_path}/
 done
 
+# install docker config directory
+install -dp %{buildroot}%{_sysconfdir}/docker/
+
+%check
+[ ! -e /run/docker.sock ] || make test
+
 %pre
 getent group docker > /dev/null || %{_sbindir}/groupadd -r docker
 exit 0
@@ -298,19 +351,16 @@ fi
 %doc LICENSE-vim-syntax README-vim-syntax.md
 %config(noreplace) %{_sysconfdir}/sysconfig/docker
 %config(noreplace) %{_sysconfdir}/sysconfig/docker-storage
+%config(noreplace) %{_sysconfdir}/sysconfig/docker-network
 %{_mandir}/man1/docker*.1.gz
 %{_mandir}/man5/Dockerfile.5.gz
 %{_bindir}/docker
-%dir %{_libexecdir}/docker
-%{_libexecdir}/docker/dockerinit
+%{_libexecdir}/docker
 %{_initddir}/docker
 %{_datadir}/bash-completion/completions/docker
-%{_datadir}/zsh/site-functions/_docker
 %dir %{_sharedstatedir}/docker
 %{_sysconfdir}/udev/rules.d/80-docker.rules
-%{_datadir}/vim/vimfiles/doc/dockerfile.txt
-%{_datadir}/vim/vimfiles/ftdetect/dockerfile.vim
-%{_datadir}/vim/vimfiles/syntax/dockerfile.vim
+%{_sysconfdir}/docker
 
 %files devel
 %doc AUTHORS CHANGELOG.md CONTRIBUTING.md LICENSE MAINTAINERS NOTICE README.md 
@@ -325,7 +375,31 @@ fi
 %dir %{gopath}/src/%{import_path}/pkg
 %{gopath}/src/%{import_path}/pkg/*
 
+%files fish-completion
+%dir %{_datadir}/fish/vendor_completions.d/
+%{_datadir}/fish/vendor_completions.d/docker.fish
+
+%files logrotate
+%doc README.%{repo}-logrotate
+%{_sysconfdir}/cron.daily/%{repo}-logrotate
+
+%files vim
+%{_datadir}/vim/vimfiles/doc/dockerfile.txt
+%{_datadir}/vim/vimfiles/ftdetect/dockerfile.vim
+%{_datadir}/vim/vimfiles/syntax/dockerfile.vim
+
+%files zsh-completion
+%{_datadir}/zsh/site-functions/_docker
+
 %changelog
+* Mon Jan 05 2015 Lokesh Mandvekar <[email protected]> - 1.4.1-1
+- Resolves: rhbz#1175144 - update to 1.4.1
+- patch to make 'docker exec' work
+via Vincent Batts <[email protected]>
+https://github.com/docker/libcontainer/issues/309
+- subpackages for fish, zsh completion, vim highlighting and logrotate cron
+job
+
 * Mon Dec 15 2014 Lokesh Mandvekar <[email protected]> - 1.4.0-2
 - Resolves: rhbz#1173950 remove min version requirements on device-mapper-libs
 
diff --git a/docker-logrotate.sh b/docker-logrotate.sh
new file mode 100644
index 0000000..27fb979
--- /dev/null
+++ b/docker-logrotate.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+LOGROTATE=true
+[ -f /etc/sysconfig/docker ] && source /etc/sysconfig/docker
+
+if [ $LOGROTATE == true ]; then
+    for id in $(docker ps -q); do
+        exec $(docker exec $id logrotate -s /var/log/logstatus 
/etc/logrotate.conf > /dev/null 2&>1)
+    done
+fi
+exit 0
diff --git a/docker-network.sysconfig b/docker-network.sysconfig
new file mode 100644
index 0000000..e69de29
diff --git a/sources b/sources
index 519b8fa..d1ed58d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-12cbf5b15af99ff348f574ed7b0847c0  v1.4.0.tar.gz
+70068f2f59e8d4241ca344dcacdd2058  v1.4.1.tar.gz
_______________________________________________
golang mailing list
[email protected]
https://lists.fedoraproject.org/mailman/listinfo/golang

Reply via email to