github.com/duglin/docker@v1.13.1/hack/make/.build-rpm/docker-engine.spec (about) 1 Name: docker-engine 2 Version: %{_version} 3 Release: %{_release}%{?dist} 4 Summary: The open-source application container engine 5 Group: Tools/Docker 6 7 License: ASL 2.0 8 Source: %{name}.tar.gz 9 10 URL: https://dockerproject.org 11 Vendor: Docker 12 Packager: Docker <support@docker.com> 13 14 # is_systemd conditional 15 %if 0%{?fedora} >= 21 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210 16 %global is_systemd 1 17 %endif 18 19 # required packages for build 20 # most are already in the container (see contrib/builder/rpm/ARCH/generate.sh) 21 # only require systemd on those systems 22 %if 0%{?is_systemd} 23 %if 0%{?suse_version} >= 1210 24 BuildRequires: systemd-rpm-macros 25 %{?systemd_requires} 26 %else 27 %if 0%{?fedora} >= 25 28 # Systemd 230 and up no longer have libsystemd-journal (see https://bugzilla.redhat.com/show_bug.cgi?id=1350301) 29 BuildRequires: pkgconfig(systemd) 30 Requires: systemd-units 31 %else 32 BuildRequires: pkgconfig(systemd) 33 Requires: systemd-units 34 BuildRequires: pkgconfig(libsystemd-journal) 35 %endif 36 %endif 37 %else 38 Requires(post): chkconfig 39 Requires(preun): chkconfig 40 # This is for /sbin/service 41 Requires(preun): initscripts 42 %endif 43 44 # required packages on install 45 Requires: /bin/sh 46 Requires: iptables 47 %if !0%{?suse_version} 48 Requires: libcgroup 49 %else 50 Requires: libcgroup1 51 %endif 52 Requires: tar 53 Requires: xz 54 %if 0%{?fedora} >= 21 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?oraclelinux} >= 7 55 # Resolves: rhbz#1165615 56 Requires: device-mapper-libs >= 1.02.90-1 57 %endif 58 %if 0%{?oraclelinux} >= 6 59 # Require Oracle Unbreakable Enterprise Kernel R4 and newer device-mapper 60 Requires: kernel-uek >= 4.1 61 Requires: device-mapper >= 1.02.90-2 62 %endif 63 64 # docker-selinux conditional 65 %if 0%{?fedora} >= 20 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?oraclelinux} >= 7 66 %global with_selinux 1 67 %endif 68 69 # DWZ problem with multiple golang binary, see bug 70 # https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12 71 %if 0%{?fedora} >= 20 || 0%{?rhel} >= 7 || 0%{?oraclelinux} >= 7 72 %global _dwz_low_mem_die_limit 0 73 %endif 74 75 # start if with_selinux 76 %if 0%{?with_selinux} 77 # Version of SELinux we were using 78 %if 0%{?fedora} == 20 79 %global selinux_policyver 3.12.1-197 80 %endif # fedora 20 81 %if 0%{?fedora} == 21 82 %global selinux_policyver 3.13.1-105 83 %endif # fedora 21 84 %if 0%{?fedora} >= 22 85 %global selinux_policyver 3.13.1-128 86 %endif # fedora 22 87 %if 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?oraclelinux} >= 7 88 %global selinux_policyver 3.13.1-23 89 %endif # centos,oraclelinux 7 90 %endif # with_selinux 91 92 # RE: rhbz#1195804 - ensure min NVR for selinux-policy 93 %if 0%{?with_selinux} 94 Requires: selinux-policy >= %{selinux_policyver} 95 Requires(pre): %{name}-selinux >= %{version}-%{release} 96 %endif # with_selinux 97 98 # conflicting packages 99 Conflicts: docker 100 Conflicts: docker-io 101 Conflicts: docker-engine-cs 102 103 %description 104 Docker is an open source project to build, ship and run any application as a 105 lightweight container. 106 107 Docker containers are both hardware-agnostic and platform-agnostic. This means 108 they can run anywhere, from your laptop to the largest EC2 compute instance and 109 everything in between - and they don't require you to use a particular 110 language, framework or packaging system. That makes them great building blocks 111 for deploying and scaling web apps, databases, and backend services without 112 depending on a particular stack or provider. 113 114 %prep 115 %if 0%{?centos} <= 6 || 0%{?oraclelinux} <=6 116 %setup -n %{name} 117 %else 118 %autosetup -n %{name} 119 %endif 120 121 %build 122 export DOCKER_GITCOMMIT=%{_gitcommit} 123 ./hack/make.sh dynbinary 124 # ./man/md2man-all.sh runs outside the build container (if at all), since we don't have go-md2man here 125 126 %check 127 ./bundles/%{_origversion}/dynbinary-client/docker -v 128 ./bundles/%{_origversion}/dynbinary-daemon/dockerd -v 129 130 %install 131 # install binary 132 install -d $RPM_BUILD_ROOT/%{_bindir} 133 install -p -m 755 bundles/%{_origversion}/dynbinary-client/docker-%{_origversion} $RPM_BUILD_ROOT/%{_bindir}/docker 134 install -p -m 755 bundles/%{_origversion}/dynbinary-daemon/dockerd-%{_origversion} $RPM_BUILD_ROOT/%{_bindir}/dockerd 135 136 # install proxy 137 install -p -m 755 /usr/local/bin/docker-proxy $RPM_BUILD_ROOT/%{_bindir}/docker-proxy 138 139 # install containerd 140 install -p -m 755 /usr/local/bin/docker-containerd $RPM_BUILD_ROOT/%{_bindir}/docker-containerd 141 install -p -m 755 /usr/local/bin/docker-containerd-shim $RPM_BUILD_ROOT/%{_bindir}/docker-containerd-shim 142 install -p -m 755 /usr/local/bin/docker-containerd-ctr $RPM_BUILD_ROOT/%{_bindir}/docker-containerd-ctr 143 144 # install runc 145 install -p -m 755 /usr/local/bin/docker-runc $RPM_BUILD_ROOT/%{_bindir}/docker-runc 146 147 # install tini 148 install -p -m 755 /usr/local/bin/docker-init $RPM_BUILD_ROOT/%{_bindir}/docker-init 149 150 # install udev rules 151 install -d $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d 152 install -p -m 644 contrib/udev/80-docker.rules $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d/80-docker.rules 153 154 # add init scripts 155 install -d $RPM_BUILD_ROOT/etc/sysconfig 156 install -d $RPM_BUILD_ROOT/%{_initddir} 157 158 159 %if 0%{?is_systemd} 160 install -d $RPM_BUILD_ROOT/%{_unitdir} 161 install -p -m 644 contrib/init/systemd/docker.service.rpm $RPM_BUILD_ROOT/%{_unitdir}/docker.service 162 %else 163 install -p -m 644 contrib/init/sysvinit-redhat/docker.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/docker 164 install -p -m 755 contrib/init/sysvinit-redhat/docker $RPM_BUILD_ROOT/%{_initddir}/docker 165 %endif 166 # add bash, zsh, and fish completions 167 install -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions 168 install -d $RPM_BUILD_ROOT/usr/share/zsh/vendor-completions 169 install -d $RPM_BUILD_ROOT/usr/share/fish/vendor_completions.d 170 install -p -m 644 contrib/completion/bash/docker $RPM_BUILD_ROOT/usr/share/bash-completion/completions/docker 171 install -p -m 644 contrib/completion/zsh/_docker $RPM_BUILD_ROOT/usr/share/zsh/vendor-completions/_docker 172 install -p -m 644 contrib/completion/fish/docker.fish $RPM_BUILD_ROOT/usr/share/fish/vendor_completions.d/docker.fish 173 174 # install manpages 175 install -d %{buildroot}%{_mandir}/man1 176 install -p -m 644 man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1 177 install -d %{buildroot}%{_mandir}/man5 178 install -p -m 644 man/man5/*.5 $RPM_BUILD_ROOT/%{_mandir}/man5 179 install -d %{buildroot}%{_mandir}/man8 180 install -p -m 644 man/man8/*.8 $RPM_BUILD_ROOT/%{_mandir}/man8 181 182 # add vimfiles 183 install -d $RPM_BUILD_ROOT/usr/share/vim/vimfiles/doc 184 install -d $RPM_BUILD_ROOT/usr/share/vim/vimfiles/ftdetect 185 install -d $RPM_BUILD_ROOT/usr/share/vim/vimfiles/syntax 186 install -p -m 644 contrib/syntax/vim/doc/dockerfile.txt $RPM_BUILD_ROOT/usr/share/vim/vimfiles/doc/dockerfile.txt 187 install -p -m 644 contrib/syntax/vim/ftdetect/dockerfile.vim $RPM_BUILD_ROOT/usr/share/vim/vimfiles/ftdetect/dockerfile.vim 188 install -p -m 644 contrib/syntax/vim/syntax/dockerfile.vim $RPM_BUILD_ROOT/usr/share/vim/vimfiles/syntax/dockerfile.vim 189 190 # add nano 191 install -d $RPM_BUILD_ROOT/usr/share/nano 192 install -p -m 644 contrib/syntax/nano/Dockerfile.nanorc $RPM_BUILD_ROOT/usr/share/nano/Dockerfile.nanorc 193 194 # list files owned by the package here 195 %files 196 %doc AUTHORS CHANGELOG.md CONTRIBUTING.md LICENSE MAINTAINERS NOTICE README.md 197 /%{_bindir}/docker 198 /%{_bindir}/dockerd 199 /%{_bindir}/docker-containerd 200 /%{_bindir}/docker-containerd-shim 201 /%{_bindir}/docker-containerd-ctr 202 /%{_bindir}/docker-proxy 203 /%{_bindir}/docker-runc 204 /%{_bindir}/docker-init 205 /%{_sysconfdir}/udev/rules.d/80-docker.rules 206 %if 0%{?is_systemd} 207 /%{_unitdir}/docker.service 208 %else 209 %config(noreplace,missingok) /etc/sysconfig/docker 210 /%{_initddir}/docker 211 %endif 212 /usr/share/bash-completion/completions/docker 213 /usr/share/zsh/vendor-completions/_docker 214 /usr/share/fish/vendor_completions.d/docker.fish 215 %doc 216 /%{_mandir}/man1/* 217 /%{_mandir}/man5/* 218 /%{_mandir}/man8/* 219 /usr/share/vim/vimfiles/doc/dockerfile.txt 220 /usr/share/vim/vimfiles/ftdetect/dockerfile.vim 221 /usr/share/vim/vimfiles/syntax/dockerfile.vim 222 /usr/share/nano/Dockerfile.nanorc 223 224 %post 225 %if 0%{?is_systemd} 226 %systemd_post docker 227 %else 228 # This adds the proper /etc/rc*.d links for the script 229 /sbin/chkconfig --add docker 230 %endif 231 if ! getent group docker > /dev/null; then 232 groupadd --system docker 233 fi 234 235 %preun 236 %if 0%{?is_systemd} 237 %systemd_preun docker 238 %else 239 if [ $1 -eq 0 ] ; then 240 /sbin/service docker stop >/dev/null 2>&1 241 /sbin/chkconfig --del docker 242 fi 243 %endif 244 245 %postun 246 %if 0%{?is_systemd} 247 %systemd_postun_with_restart docker 248 %else 249 if [ "$1" -ge "1" ] ; then 250 /sbin/service docker condrestart >/dev/null 2>&1 || : 251 fi 252 %endif 253 254 %changelog