SHA256
1
0
forked from pool/docker

Accepting request 404911 from Virtualization:containers

1

OBS-URL: https://build.opensuse.org/request/show/404911
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/docker?expand=0&rev=36
This commit is contained in:
Dominique Leuenberger 2016-07-01 07:58:42 +00:00 committed by Git OBS Bridge
commit 58aba08085
2 changed files with 75 additions and 83 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jun 24 00:23:57 UTC 2016 - dmueller@suse.com
- readd dropped declaration for patch200
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jun 8 14:42:08 UTC 2016 - asarai@suse.de Wed Jun 8 14:42:08 UTC 2016 - asarai@suse.de
@ -31,6 +36,11 @@ Fri May 20 10:26:39 UTC 2016 - jmassaguerpla@suse.com
- Fix udev files ownership - Fix udev files ownership
-------------------------------------------------------------------
Thu May 19 13:43:44 UTC 2016 - tchvatal@suse.com
- Pass over with spec-cleaner, no factual changes
------------------------------------------------------------------- -------------------------------------------------------------------
Wed May 18 14:21:09 UTC 2016 - asarai@suse.de Wed May 18 14:21:09 UTC 2016 - asarai@suse.de

View File

@ -14,16 +14,16 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via http://bugs.opensuse.org/
# #
# nodebuginfo
%define docker_store /var/lib/docker %define docker_store %{_localstatedir}/lib/docker
%define docker_graph %{docker_store}/graph %define docker_graph %{docker_store}/graph
%define docker_migration_testfile %{docker_store}/.suse-image-migration-v1to2-complete %define docker_migration_testfile %{docker_store}/.suse-image-migration-v1to2-complete
%define git_version 9e83765 %define git_version 9e83765
%define go_arches %ix86 x86_64 aarch64 %define go_arches %ix86 x86_64 aarch64
%define version_unconverted 1.11.2 %define version_unconverted 1.11.2
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
Name: docker Name: docker
Version: 1.11.2 Version: 1.11.2
Release: 0 Release: 0
@ -35,40 +35,24 @@ Source: %{name}-%{version}.tar.xz
Source1: docker.service Source1: docker.service
Source3: 80-docker.rules Source3: 80-docker.rules
Source4: sysconfig.docker Source4: sysconfig.docker
%if 0%{?suse_version} > 1320
Source5: docker.socket
%else
Source5: docker_systemd_lt_214.socket
%endif
Source6: docker-rpmlintrc Source6: docker-rpmlintrc
Source7: README_SUSE.md Source7: README_SUSE.md
Source8: docker-audit.rules Source8: docker-audit.rules
# TODO: remove once we figure out what is wrong with iptables on ppc64le # TODO: remove once we figure out what is wrong with iptables on ppc64le
Source100: sysconfig.docker.ppc64le Source100: sysconfig.docker.ppc64le
# The mount-secrets patch is be a SLE-specific feature. As such, it is disabled by default on openSUSE.
# PATCH-FEATURE-SLE docker-mount-secrets.patch -- pass the SCC machine credentials and the /etc/SUSEConnect file to containers
Patch200: docker-mount-secrets.patch
# Required to overcome some limitations of gcc-go: https://groups.google.com/forum/#!msg/golang-nuts/SlGCPYkjxo4/4DjcjXRCqAkJ # Required to overcome some limitations of gcc-go: https://groups.google.com/forum/#!msg/golang-nuts/SlGCPYkjxo4/4DjcjXRCqAkJ
Patch101: gcc-go-patches.patch Patch101: gcc-go-patches.patch
Patch102: netlink_gcc_go.patch Patch102: netlink_gcc_go.patch
Patch103: netlink_netns_powerpc.patch Patch103: netlink_netns_powerpc.patch
Patch200: docker-mount-secrets.patch
# This fixes bnc#964673. This fix is in boltdb upstream, but has yet to be # This fixes bnc#964673. This fix is in boltdb upstream, but has yet to be
# merged into Docker (in a vendor commit). This patch was cherry-picked from # merged into Docker (in a vendor commit). This patch was cherry-picked from
# bolt#555. # bolt#555.
Patch302: bnc964673-boltdb-metadata-recovery.patch Patch302: bnc964673-boltdb-metadata-recovery.patch
Requires(post): udev
BuildRequires: audit BuildRequires: audit
BuildRequires: bash-completion BuildRequires: bash-completion
BuildRequires: device-mapper-devel >= 1.2.68 BuildRequires: device-mapper-devel >= 1.2.68
BuildRequires: glibc-devel-static BuildRequires: glibc-devel-static
%ifarch %go_arches
BuildRequires: go >= 1.5
BuildRequires: go-go-md2man
%else
BuildRequires: gcc5-go >= 5.0
%endif
BuildRequires: libapparmor-devel BuildRequires: libapparmor-devel
BuildRequires: libbtrfs-devel >= 3.8 BuildRequires: libbtrfs-devel >= 3.8
BuildRequires: procps BuildRequires: procps
@ -78,6 +62,8 @@ BuildRequires: zsh
Requires: apparmor-parser Requires: apparmor-parser
Requires: bridge-utils Requires: bridge-utils
Requires: ca-certificates-mozilla Requires: ca-certificates-mozilla
# Containerd is required as it is the only currently supported execdriver of Docker.
Requires: containerd
# Provides mkfs.ext4 - used by Docker when devicemapper storage driver is used # Provides mkfs.ext4 - used by Docker when devicemapper storage driver is used
Requires: e2fsprogs Requires: e2fsprogs
Requires: git-core >= 1.7 Requires: git-core >= 1.7
@ -88,26 +74,27 @@ Requires: lvm2 >= 2.2.89
Requires: procps Requires: procps
Requires: tar >= 1.26 Requires: tar >= 1.26
Requires: xz >= 4.9 Requires: xz >= 4.9
# Containerd is required as it is the only currently supported execdriver of Docker. Requires(post): %fillup_prereq
Requires: containerd Requires(post): udev
# Not necessary, but must be installed to have a smooth upgrade. # Not necessary, but must be installed to have a smooth upgrade.
Recommends: docker-image-migrator Recommends: docker-image-migrator
Conflicts: lxc < 1.0 Conflicts: lxc < 1.0
PreReq: %fillup_prereq
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExcludeArch: %ix86 ExcludeArch: %ix86 s390 ppc
ExcludeArch: s390 %if 0%{?suse_version} > 1320
Source5: docker.socket
%else
Source5: docker_systemd_lt_214.socket
%endif
%ifarch %{go_arches}
BuildRequires: go >= 1.5
BuildRequires: go-go-md2man
%else
BuildRequires: gcc5-go >= 5.0
%endif
%if 0%{?is_opensuse} %if 0%{?is_opensuse}
ExcludeArch: s390x ExcludeArch: s390x
%endif %endif
ExcludeArch: ppc
# It's a bad idea to strip Go binaries (apart from making debugging impossible,
# it also is known to cause some interesting runtime bugs). However, rpmbuild
# will strip your binaries if it is creating debuginfo packages (as well as
# doing it by default). So we have to manually disable both of these things.
%undefine _build_create_debug
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
%description %description
Docker complements LXC with a high-level API which operates at the process Docker complements LXC with a high-level API which operates at the process
@ -139,37 +126,36 @@ BuildArch: noarch
Zsh command line completion support for %{name}. Zsh command line completion support for %{name}.
%package test %package test
%global __requires_exclude ^libgo.so.*$
Summary: Test package for docker Summary: Test package for docker
Group: System/Management Group: System/Management
Requires: device-mapper-devel >= 1.2.68
Requires: glibc-devel-static
%ifarch %go_arches
Requires: go >= 1.4
%else
Requires: gcc5-go >= 5.0
%endif
BuildRequires: fdupes BuildRequires: fdupes
Requires: apparmor-parser Requires: apparmor-parser
Requires: bash-completion Requires: bash-completion
Requires: device-mapper-devel >= 1.2.68
Requires: glibc-devel-static
Requires: libapparmor-devel Requires: libapparmor-devel
Requires: libbtrfs-devel >= 3.8 Requires: libbtrfs-devel >= 3.8
Requires: procps Requires: procps
Requires: sqlite3-devel Requires: sqlite3-devel
BuildArch: noarch BuildArch: noarch
%ifarch %{go_arches}
%global __requires_exclude ^libgo.so.*$ Requires: go >= 1.4
%else
Requires: gcc5-go >= 5.0
%endif
%description test %description test
Test package for docker. It contains the source code and the tests. Test package for docker. It contains the source code and the tests.
%prep %prep
%setup -q -n %{name}-%{version} %setup -q
%if 0%{?is_opensuse} %if 0%{?is_opensuse}
# nothing # nothing
%else %else
%patch200 -p1 %patch200 -p1
%endif %endif
%ifnarch %go_arches %ifnarch %{go_arches}
%patch101 -p1 %patch101 -p1
%patch102 -p1 %patch102 -p1
%patch103 -p1 %patch103 -p1
@ -179,11 +165,11 @@ Test package for docker. It contains the source code and the tests.
cp %{SOURCE7} . cp %{SOURCE7} .
%build %build
%ifnarch %go_arches %ifnarch %{go_arches}
tmphack=/tmp/dirty-hack tmphack=/tmp/dirty-hack
[ -e $tmphack ] && rm -rf $tmphack [ -e $tmphack ] && rm -rf $tmphack
mkdir $tmphack mkdir $tmphack
ln -s /usr/bin/go-5 $tmphack/go ln -s %{_bindir}/go-5 $tmphack/go
export PATH=$tmphack:$PATH export PATH=$tmphack:$PATH
%endif %endif
@ -195,7 +181,7 @@ EOF
) > docker_build_env ) > docker_build_env
. ./docker_build_env . ./docker_build_env
%ifarch %go_arches %ifarch %{go_arches}
./hack/make.sh dynbinary ./hack/make.sh dynbinary
man/md2man-all.sh man/md2man-all.sh
%else %else
@ -209,47 +195,44 @@ rm -rf hack/make/.build-deb
%install %install
install -d %{buildroot}%{go_contribdir} install -d %{buildroot}%{go_contribdir}
install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_bindir}
%ifarch %go_arches %ifarch %{go_arches}
install -D -m755 bundles/%{version}/dynbinary/%{name}-%{version} %{buildroot}/%{_bindir}/%{name} install -D -m755 bundles/%{version}/dynbinary/%{name}-%{version} %{buildroot}/%{_bindir}/%{name}
%else %else
install -D -m755 bundles/%{version}/dyngccgo/%{name}-%{version} %{buildroot}/%{_bindir}/%{name} install -D -m755 bundles/%{version}/dyngccgo/%{name}-%{version} %{buildroot}/%{_bindir}/%{name}
%endif %endif
install -d %{buildroot}/%{_prefix}/lib/docker install -d %{buildroot}/%{_prefix}/lib/docker
install -Dd -m 0755 \ install -Dd -m 0755 %{buildroot}%{_sbindir}
%{buildroot}%{_sysconfdir}/init.d \
%{buildroot}%{_sbindir}
install -D -m0644 contrib/completion/bash/docker "%{buildroot}/etc/bash_completion.d/%{name}" install -D -m0644 contrib/completion/bash/docker "%{buildroot}%{_sysconfdir}/bash_completion.d/%{name}"
install -D -m0644 contrib/completion/zsh/_docker "%{buildroot}/etc/zsh_completion.d/%{name}" install -D -m0644 contrib/completion/zsh/_docker "%{buildroot}%{_sysconfdir}/zsh_completion.d/%{name}"
# copy all for the test package # copy all for the test package
install -d %{buildroot}/usr/src/docker/ install -d %{buildroot}%{_prefix}/src/docker/
cp -av . %{buildroot}/usr/src/docker/ cp -av . %{buildroot}%{_prefix}/src/docker/
# #
# systemd service # systemd service
# #
install -D -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/%{name}.service install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
install -D -m 0644 %SOURCE5 %{buildroot}%{_unitdir}/%{name}.socket install -D -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/%{name}.socket
ln -sf /sbin/service $RPM_BUILD_ROOT/usr/sbin/rcdocker ln -sf service %{buildroot}%{_sbindir}/rcdocker
# #
# udev rules that prevents dolphin to show all docker devices and slows down # udev rules that prevents dolphin to show all docker devices and slows down
# upstream report https://bugs.kde.org/show_bug.cgi?id=329930 # upstream report https://bugs.kde.org/show_bug.cgi?id=329930
# #
install -D -m 0644 %{SOURCE3} %{buildroot}%{_udevrulesdir}/80-%{name}.rules
install -D -m 0644 %SOURCE3 %{buildroot}%{_prefix}/lib/udev/rules.d/80-%{name}.rules
# audit rules # audit rules
install -D -m 0640 %SOURCE8 %{buildroot}%{_sysconfdir}/audit/rules.d/%{name}.rules install -D -m 0640 %{SOURCE8} %{buildroot}%{_sysconfdir}/audit/rules.d/%{name}.rules
# sysconfig file # sysconfig file
%ifarch ppc64le %ifarch ppc64le
install -D -m 644 %SOURCE100 %{buildroot}/var/adm/fillup-templates/sysconfig.docker install -D -m 644 %{SOURCE100} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.docker
%else %else
install -D -m 644 %SOURCE4 %{buildroot}/var/adm/fillup-templates/sysconfig.docker install -D -m 644 %{SOURCE4} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.docker
%endif %endif
%ifarch %go_arches %ifarch %{go_arches}
# install manpages # install manpages
install -d %{buildroot}%{_mandir}/man1 install -d %{buildroot}%{_mandir}/man1
install -p -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1 install -p -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1
@ -266,9 +249,9 @@ if [[ -z "$BUILD_ROOT" ]]
then then
# In order to make sure we don't print a scary warning when we shouldn't we # In order to make sure we don't print a scary warning when we shouldn't we
# need to test these things (in this order): # need to test these things (in this order):
# 1. Check that /var/lib/docker actually exists (docker daemon has run). # 1. Check that %{_localstatedir}/lib/docker actually exists (docker daemon has run).
# 2. Check that the migrator has *not* finished. # 2. Check that the migrator has *not* finished.
# 3. Check that /var/lib/docker/graph exists (this is a <=1.9.1 thing, but # 3. Check that %{_localstatedir}/lib/docker/graph exists (this is a <=1.9.1 thing, but
# will stick around if it has been migrated -- which is why we need the # will stick around if it has been migrated -- which is why we need the
# MIGRATION_TESTFILE check). # MIGRATION_TESTFILE check).
# 4. Check that there are images in the graph/ directory. # 4. Check that there are images in the graph/ directory.
@ -297,10 +280,10 @@ In order to run this migration tool, please install the 'docker-image-migrator'
package. You can run the migration with this command, which will exit after the package. You can run the migration with this command, which will exit after the
migration has been completed: migration has been completed:
$ /usr/lib/docker-image-migrator/do-image-migration-v1to2.sh $ %{_libexecdir}/docker-image-migrator/do-image-migration-v1to2.sh
Because the migrator requires information about the storage driver used by Docker, Because the migrator requires information about the storage driver used by Docker,
the migration script will source /etc/sysconfig/docker and use \$DOCKER_OPTS as the migration script will source %{_sysconfdir}/sysconfig/docker and use \$DOCKER_OPTS as
arguments to the migrator. If this automated migration fails, it will be re-attempted arguments to the migrator. If this automated migration fails, it will be re-attempted
with every known storage driver. In addition, the script accepts arguments which with every known storage driver. In addition, the script accepts arguments which
will simiarly be appended to the set of arguments (after \$DOCKER_OPTS) to the will simiarly be appended to the set of arguments (after \$DOCKER_OPTS) to the
@ -327,8 +310,7 @@ EOF
touch %{docker_migration_testfile} touch %{docker_migration_testfile}
fi fi
echo "creating group docker..." getent group docker >/dev/null || groupadd -r docker
groupadd -r docker 2>/dev/null || :
%service_add_pre %{name}.service %{name}.socket %service_add_pre %{name}.service %{name}.socket
%post %post
@ -346,16 +328,16 @@ groupadd -r docker 2>/dev/null || :
%doc README.md LICENSE README_SUSE.md %doc README.md LICENSE README_SUSE.md
%{_bindir}/docker %{_bindir}/docker
%{_sbindir}/rcdocker %{_sbindir}/rcdocker
%{_prefix}/lib/docker/ %{_libexecdir}/docker/
%{_unitdir}/%{name}.service %{_unitdir}/%{name}.service
%{_unitdir}/%{name}.socket %{_unitdir}/%{name}.socket
%config %{_sysconfdir}/audit/rules.d/%{name}.rules %config %{_sysconfdir}/audit/rules.d/%{name}.rules
%{_prefix}/lib/udev/rules.d/80-%{name}.rules %{_udevrulesdir}/80-%{name}.rules
/var/adm/fillup-templates/sysconfig.docker %{_localstatedir}/adm/fillup-templates/sysconfig.docker
%ifarch %go_arches %ifarch %{go_arches}
%{_mandir}/man1/docker-*.1.gz %{_mandir}/man1/docker-*.1%{ext_man}
%{_mandir}/man1/docker.1.gz %{_mandir}/man1/docker.1%{ext_man}
%{_mandir}/man5/Dockerfile.5.gz %{_mandir}/man5/Dockerfile.5%{ext_man}
%endif %endif
%files bash-completion %files bash-completion
@ -368,13 +350,13 @@ groupadd -r docker 2>/dev/null || :
%files test %files test
%defattr(-,root,root) %defattr(-,root,root)
/usr/src/docker/ %{_prefix}/src/docker/
# exclude binaries # exclude binaries
%exclude /usr/src/docker/bundles/ %exclude %{_prefix}/src/docker/bundles/
# exclude init configurations other than systemd # exclude init configurations other than systemd
%exclude /usr/src/docker/contrib/init/openrc %exclude %{_prefix}/src/docker/contrib/init/openrc
%exclude /usr/src/docker/contrib/init/sysvinit-debian %exclude %{_prefix}/src/docker/contrib/init/sysvinit-debian
%exclude /usr/src/docker/contrib/init/sysvinit-redhat %exclude %{_prefix}/src/docker/contrib/init/sysvinit-redhat
%exclude /usr/src/docker/contrib/init/upstart %exclude %{_prefix}/src/docker/contrib/init/upstart
%changelog %changelog