diff --git a/apply-patches b/apply-patches new file mode 100755 index 0000000000000000000000000000000000000000..d86820d3bb9a486fc61c546e11e8362e761d9445 --- /dev/null +++ b/apply-patches @@ -0,0 +1,37 @@ +#!/bin/bash + +# Description: This shell script is used to apply patches for the project +# Author: xulei@xfusion.com +# Create: 2021-12-24 + +set -ex + +pkg=moby-20.10.21 +cwd=$PWD +src=$cwd/$pkg + +tar -xzvf moby-20.10.21.tar.gz +if [! -d patch];then + tar -zxf patch.tar.gz +fi + +cd $src +git init +git add . +git config user.name 'build' +git config user.email 'build@obs.com' +git commit -m 'init build' +cd $cwd + +series=$cwd/series.conf +while IPF= read -r line +do + if [[ "$line" =~ ^patch* ]]; then + echo git apply $cwd/$line + cd $src && git apply $cwd/$line + fi +done <"$series" + +cd $cwd + +mv $src/.git $src/git diff --git a/moby.spec b/moby.spec index 8db65cf28b714fea0116d68265e861f9ea2c6d22..0710f4e26c55e3a1648ed7f9c4cd43a776fde1cf 100644 --- a/moby.spec +++ b/moby.spec @@ -7,7 +7,7 @@ Name: docker Version: 20.10.21 -Release: 3 +Release: 4 Summary: The open-source application container engine License: ASL 2.0 URL: https://www.docker.com @@ -21,8 +21,9 @@ Source2: tini-0.19.0.tar.gz Source3: libnetwork-dcdf8f17.tar.gz Source4: docker.service Source5: docker.socket - -Patch0001: 0001-revert-any-to-interface-temporarily-allow-builtable.patch +Source6: patch.tar.gz +Source7: apply-patches +Source8: series.conf Requires: %{name}-engine = %{version}-%{release} Requires: %{name}-client = %{version}-%{release} @@ -85,13 +86,23 @@ BuildRequires: libtool-ltdl-devel Docker client binary and related utilities %prep +cp %{SOURCE0} . +cp %{SOURCE1} . +cp %{SOURCE2} . +cp %{SOURCE3} . +cp %{SOURCE4} . +cp %{SOURCE5} . +cp %{SOURCE6} . +cp %{SOURCE7} . +cp %{SOURCE8} . %setup -q -n %{_source_client} %setup -q -T -n %{_source_engine} -b 1 -%patch0001 -p1 %setup -q -T -n %{_source_docker_init} -b 2 %setup -q -T -n %{_source_docker_proxy} -b 3 %build +sh ./apply-patches + export GO111MODULE=off # build docker daemon export DOCKER_GITCOMMIT=%{_gitcommit_engine} @@ -197,6 +208,9 @@ fi %systemd_postun_with_restart docker.service %changelog +* Tue Dec 29 2022 xulei - 20.10.21-4 +- DESC: add apply-patches tool, and move patch files to patch directory + * Wed Dec 28 2022 xulei - 20.10.21-3 - DESC: change to BuildRequires golang-1.17.3 diff --git a/0001-revert-any-to-interface-temporarily-allow-builtable.patch b/patch/0000-revert-any-to-interface-temporarily-allow-builtable.patch similarity index 100% rename from 0001-revert-any-to-interface-temporarily-allow-builtable.patch rename to patch/0000-revert-any-to-interface-temporarily-allow-builtable.patch diff --git a/patch/0001-xxx.patch b/patch/0001-xxx.patch new file mode 100644 index 0000000000000000000000000000000000000000..8f01f5d211bb0c433513f4cfcd198fd8d83dcea9 --- /dev/null +++ b/patch/0001-xxx.patch @@ -0,0 +1 @@ +11111111111111111111111111111111111111111111111111111111 \ No newline at end of file diff --git a/series.conf b/series.conf new file mode 100644 index 0000000000000000000000000000000000000000..0d6b996eb007ac0a83688f679013a0a2066851b0 --- /dev/null +++ b/series.conf @@ -0,0 +1 @@ +patch/0000-revert-any-to-interface-temporarily-allow-builtable.patch