docker/docker.spec

252 lines
8 KiB
RPMSpec
Raw Normal View History

2020-01-04 03:15:04 +03:00
%global __requires_exclude '.*/bin/make'
2019-08-14 15:38:32 +03:00
2015-06-25 14:54:37 +03:00
# modifying the dockerinit binary breaks the SHA1 sum check by docker
%global __os_install_post %{_usrlibrpm}/brp-compress
2017-09-11 14:46:27 +03:00
2019-08-14 15:38:32 +03:00
%define debug_package %{nil}
2015-06-25 14:54:37 +03:00
2019-08-14 15:38:32 +03:00
%global commit 89658bed64c2a8fe05a978e5b87dbec409d57a0f
%global shortcommit %(c=%{commit}; echo ${c:0:7})
2019-08-14 15:38:32 +03:00
Summary: Automates deployment of containerized applications
Name: docker
2020-03-24 11:51:42 +00:00
Version: 19.03.8
2019-10-10 18:03:16 +03:00
Release: 1
2019-08-14 15:38:32 +03:00
License: ASL 2.0
2016-06-18 00:02:07 +03:00
Group: System/Kernel and hardware
2019-08-14 15:38:32 +03:00
Url: http://www.docker.com
2015-06-25 14:54:37 +03:00
# only x86_64 for now: https://github.com/docker/docker/issues/136
2019-08-14 15:38:32 +03:00
#ExclusiveArch: x86_64
Source0: https://github.com/docker/docker-ce/archive/v%{version}.tar.gz?/%{name}-ce-%{version}.tar.gz
Source1: %{name}.service
Source2: %{name}.sysconfig
Source3: %{name}-storage.sysconfig
Source6: %{name}-network.sysconfig
Source7: %{name}.socket
Source8: %{name}-network-cleanup.sh
Source9: overlay.conf
2020-03-07 23:51:36 +03:00
# bf2bd42abc0a3734f12b5ec724e571434e42c669
2019-08-14 15:38:32 +03:00
Source10: https://github.com/docker/libnetwork/archive/master.zip?/libnetwork-master.zip
Source11: https://github.com/krallin/tini/archive/v0.18.0.tar.gz?/tini-0.18.0.tar.gz
2016-06-18 00:14:13 +03:00
Source100: %{name}.rpmlintrc
2019-08-14 15:38:32 +03:00
BuildRequires: cmake
BuildRequires: go-md2man
BuildRequires: golang
BuildRequires: systemd
BuildRequires: btrfs-devel
BuildRequires: glibc-devel
BuildRequires: glibc-static-devel
BuildRequires: libtool-devel
BuildRequires: pkgconfig(devmapper)
BuildRequires: pkgconfig(libseccomp)
2017-09-11 14:46:27 +03:00
BuildRequires: pkgconfig(sqlite3)
2019-08-14 15:38:32 +03:00
BuildRequires: pkgconfig(systemd)
Requires: bridge-utils
Requires: %{name}-containerd
2017-09-11 14:46:27 +03:00
Requires: runc
2015-06-25 14:54:37 +03:00
# need xz to work with ubuntu images
# https://bugzilla.redhat.com/show_bug.cgi?id=1045220
2019-08-14 15:38:32 +03:00
Requires: xz
Requires(pre): rpm-helper
Requires(post,preun,postun): systemd
2015-06-25 14:54:37 +03:00
# https://bugzilla.redhat.com/show_bug.cgi?id=1034919
# No longer needed in Fedora because of libcontainer
2019-08-14 15:38:32 +03:00
Provides: lxc-%{name} = %{EVRD}
Provides: %{name}-swarm = %{EVRD}
2015-06-25 14:54:37 +03:00
%description
Docker is an open-source engine that automates the deployment of any
application as a lightweight, portable, self-sufficient container that will
run virtually anywhere.
Docker containers can encapsulate any payload, and will run consistently on
and between virtually any server. The same container that a developer builds
and tests on a laptop will run at scale, in production*, on VMs, bare-metal
servers, OpenStack clusters, public instances, or combinations of the above.
2019-08-14 15:38:32 +03:00
%files
%doc CHANGELOG.md CONTRIBUTING.md README.md
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-network
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-storage
%{_bindir}/%{name}
%{_bindir}/%{name}-proxy
%{_bindir}/%{name}-init
%{_sbindir}/%{name}-network-cleanup
%{_sbindir}/%{name}d
%{_presetdir}/86-%{name}.preset
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}.socket
%{_sysconfdir}/bash_completion.d/%{name}.bash
%dir %{_localstatedir}/lib/%{name}
%{_udevrulesdir}/80-%{name}.rules
%{_sysconfdir}/modules-load.d/overlay.conf
%pre
getent group %{name} > /dev/null || %{_sbindir}/groupadd -r %{name}
exit 0
%post
%systemd_post %{name}
%preun
%systemd_preun %{name}
%postun
%systemd_postun_with_restart %{name}
#------------------------------------------------------------------
2015-06-25 14:54:37 +03:00
2016-06-17 18:03:06 +03:00
%package fish-completion
2019-08-14 15:38:32 +03:00
Summary: Fish completion files for Docker
Group: System/Kernel and hardware
Requires: %{name} = %{EVRD}
2020-01-04 03:15:04 +03:00
Recommends: fish
2019-08-14 15:38:32 +03:00
Provides: %{name}-io-fish-completion = %{EVRD}
2016-06-17 18:03:06 +03:00
%description fish-completion
This package installs %{summary}.
2019-08-14 15:38:32 +03:00
%files fish-completion
%doc README.md
%{_datadir}/fish/vendor_completions.d/%{name}.fish
2016-06-17 18:03:06 +03:00
2019-08-14 15:38:32 +03:00
#------------------------------------------------------------------
2016-06-17 18:03:06 +03:00
%package vim
2019-08-14 15:38:32 +03:00
Summary: Vim syntax highlighting files for Docker
Group: System/Kernel and hardware
Requires: %{name} = %{EVRD}
Requires: vim
Provides: %{name}-io-vim = %{EVRD}
2016-06-17 18:03:06 +03:00
%description vim
This package installs %{summary}.
2019-08-14 15:38:32 +03:00
%files vim
%doc README.md
%{_datadir}/vim/vimfiles/ftdetect/%{name}file.vim
%{_datadir}/vim/vimfiles/syntax/%{name}file.vim
#------------------------------------------------------------------
2016-06-17 18:03:06 +03:00
%package zsh-completion
2019-08-14 15:38:32 +03:00
Summary: Zsh completion files for Docker
Group: System/Kernel and hardware
Requires: %{name} = %{EVRD}
Requires: zsh
Provides: %{name}-io-zsh-completion = %{EVRD}
2016-06-17 18:03:06 +03:00
%description zsh-completion
This package installs %{summary}.
2019-08-14 15:38:32 +03:00
%files zsh-completion
%doc README.md
%{_datadir}/zsh/site-functions/_%{name}
#------------------------------------------------------------------
2016-06-17 18:03:06 +03:00
2015-06-25 14:54:37 +03:00
%prep
2019-08-14 15:38:32 +03:00
%setup -q -n %{name}-ce-%{version} -a10 -a11
mv libnetwork-master libnetwork
mv tini-* tini
2015-06-25 14:54:37 +03:00
%build
2019-08-14 15:38:32 +03:00
# magic again
fake_gopath_pushd() {
mkdir -p "$(pwd)/src/${2%/*}"
rm -f "$(pwd)/src/$2"
ln -rsT "$1" "$(pwd)/src/$2"
pushd "$(pwd)/src/$2" >/dev/null
}
fake_gopath_popd() {
popd >/dev/null
}
2015-06-25 14:54:37 +03:00
2019-08-14 15:38:32 +03:00
export DOCKER_GITCOMMIT="%{shortcommit}"
mkdir -p src/github.com/%{name}
export GOPATH=%{_libdir}/golang:$(pwd)
# MAGIC HERE
ln -s ../../../components/cli src/github.com/%{name}
ln -s ../../../components/engine src/github.com/%{name}/%{name}
# dockerd
pushd components/engine
DOCKER_BUILDTAGS='seccomp journald' VERSION=%{version} hack/make.sh dynbinary
popd
# docker cli
pushd components/cli
DISABLE_WARN_OUTSIDE_CONTAINER=1 make VERSION=%{version} dynbinary
popd
### docker proxy
fake_gopath_pushd libnetwork github.com/%{name}/libnetwork
go build -ldflags='-linkmode=external' github.com/%{name}/libnetwork/cmd/proxy
fake_gopath_popd
### docker-init
fake_gopath_pushd tini github.com/krallin/tini
%cmake
2020-01-13 14:47:15 +03:00
%make tini-static
2019-08-14 15:38:32 +03:00
fake_gopath_popd
2017-09-11 14:46:27 +03:00
2015-06-25 14:54:37 +03:00
%install
2019-08-14 15:38:32 +03:00
# install binaries
2015-06-25 14:54:37 +03:00
install -d %{buildroot}%{_bindir}
2019-08-14 15:38:32 +03:00
install -p -m 755 components/cli/build/%{name}-linux-* %{buildroot}%{_bindir}/%{name}
install -d %{buildroot}%{_sbindir}
install -p -m 755 components/engine/bundles/dynbinary-daemon/%{name}d-%{version} %{buildroot}%{_sbindir}/%{name}d
install -p -m 755 libnetwork/proxy %{buildroot}%{_bindir}/%{name}-proxy
install -p -m 755 tini/build/tini-static %{buildroot}%{_bindir}/%{name}-init
2015-06-25 14:54:37 +03:00
# Place to store images
2019-08-15 09:26:53 +03:00
install -d %{buildroot}%{_localstatedir}/lib/%{name}
2015-06-25 14:54:37 +03:00
# install bash completion
install -d %{buildroot}%{_sysconfdir}/bash_completion.d
2019-08-14 15:38:32 +03:00
install -p -m 644 components/cli/contrib/completion/bash/%{name} %{buildroot}%{_sysconfdir}/bash_completion.d/%{name}.bash
2016-06-17 18:03:06 +03:00
# 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
2019-08-14 15:38:32 +03:00
install -p -m 644 components/cli/contrib/completion/fish/%{name}.fish %{buildroot}%{_datadir}/fish/vendor_completions.d
2016-06-17 18:03:06 +03:00
2015-06-25 14:54:37 +03:00
# install vim syntax highlighting
install -d %{buildroot}%{_datadir}/vim/vimfiles/{doc,ftdetect,syntax}
2019-08-14 15:38:32 +03:00
install -p -m 644 components/engine/contrib/syntax/vim/ftdetect/%{name}file.vim %{buildroot}%{_datadir}/vim/vimfiles/ftdetect
install -p -m 644 components/engine/contrib/syntax/vim/syntax/%{name}file.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax
2016-06-17 18:03:06 +03:00
# install zsh completion
install -d %{buildroot}%{_datadir}/zsh/site-functions
2019-08-14 15:38:32 +03:00
install -p -m 644 components/cli/contrib/completion/zsh/_%{name} %{buildroot}%{_datadir}/zsh/site-functions
2016-06-17 18:03:06 +03:00
2015-06-25 14:54:37 +03:00
# install udev rules
install -d %{buildroot}%{_udevrulesdir}
2019-08-14 15:38:32 +03:00
install -p -m 644 components/engine/contrib/udev/80-%{name}.rules %{buildroot}%{_udevrulesdir}
2015-06-25 14:54:37 +03:00
# install storage dir
2019-08-15 09:26:53 +03:00
install -d -m 700 %{buildroot}%{_localstatedir}/lib/%{name}
2015-06-25 14:54:37 +03:00
# install systemd/init scripts
install -d %{buildroot}%{_unitdir}
2019-08-14 15:38:32 +03:00
install -p -m 644 %{SOURCE1} %{SOURCE7} %{buildroot}%{_unitdir}
2015-06-25 14:54:37 +03:00
2019-08-14 15:38:32 +03:00
# for additional args
install -d %{buildroot}%{_sysconfdir}/sysconfig/
install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
install -p -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-network
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-storage
2015-06-25 14:54:37 +03:00
2019-08-14 15:38:32 +03:00
#network cleanup
install -d %{buildroot}%{_sbindir}
install -p -m 755 %{SOURCE8} %{buildroot}%{_sbindir}/%{name}-network-cleanup
2017-09-11 14:46:27 +03:00
install -d %{buildroot}%{_presetdir}
2019-08-14 15:38:32 +03:00
cat > %{buildroot}%{_presetdir}/86-%{name}.preset << EOF
enable %{name}.socket
2017-09-11 14:46:27 +03:00
EOF
2019-08-14 15:38:32 +03:00
install -d %{buildroot}%{_sysconfdir}/modules-load.d/
install -p -m 644 %{SOURCE9} %{buildroot}%{_sysconfdir}/modules-load.d/overlay.conf