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