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