docker-compose.spec 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ##
  2. ## docker-compose.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2019 OpenPKG Project <http://openpkg.org/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package versions
  24. %define V_docker_compose_base 1.25.0
  25. %define V_docker_compose_snap 20191215
  26. %define V_python 3.8
  27. # package information
  28. Name: docker-compose
  29. Summary: Docker Container Composition
  30. URL: https://docs.docker.com/compose/
  31. Vendor: Docker Inc.
  32. Packager: OpenPKG Project
  33. Distribution: OpenPKG Community
  34. Class: EVAL
  35. Group: Filesystem
  36. License: Apache
  37. Version: %{V_docker_compose_base}.%{V_docker_compose_snap}
  38. Release: 20191215
  39. # list of sources
  40. Source0: http://download.openpkg.org/components/versioned/docker-compose/docker-compose-%{V_docker_compose_snap}.tar.xz
  41. # build information
  42. BuildPreReq: OpenPKG, openpkg >= 20160101, python, python-setup
  43. PreReq: OpenPKG, openpkg >= 20160101, python, docker
  44. %description
  45. Docker Compose is a tool for defining and running multi-container
  46. Docker applications. With Docker Compose, you use a Compose file to
  47. configure your application's services. Then, using a single command,
  48. you create and start all the services from your configuration.
  49. %track
  50. prog docker-compose = {
  51. version = %{version}
  52. url = https://github.com/docker/compose/releases
  53. regex = (\d+\.\d+\.\d+)\.tar\.gz
  54. }
  55. %prep
  56. %setup -q -n docker-compose
  57. %build
  58. %install
  59. # install package
  60. export HOME=`pwd`
  61. %{l_prefix}/bin/python -m pip \
  62. install \
  63. --root=$RPM_BUILD_ROOT \
  64. --prefix=%{l_prefix}/lib/docker-compose \
  65. --isolated \
  66. --ignore-installed \
  67. --no-warn-script-location \
  68. *
  69. # provide executable wrapper
  70. %{l_shtool} mkdir -f -p -m 755 \
  71. $RPM_BUILD_ROOT%{l_prefix}/bin
  72. ( echo "#!/bin/sh"
  73. echo "PATH=\"%{l_prefix}/bin:\$PATH\""
  74. echo "export PATH"
  75. echo "PYTHONPATH=\"%{l_prefix}/lib/docker-compose/lib/python%{V_python}/site-packages:%{l_prefix}/lib/python/site-packages\""
  76. echo "export PYTHONPATH"
  77. echo "exec %{l_prefix}/lib/docker-compose/bin/docker-compose \${1+\"\$@\"}"
  78. ) >$RPM_BUILD_ROOT%{l_prefix}/bin/docker-compose
  79. chmod a+x $RPM_BUILD_ROOT%{l_prefix}/bin/docker-compose
  80. # remove problematic files
  81. rm -f "$RPM_BUILD_ROOT%{l_prefix}/lib/docker-compose/lib/python3.8/site-packages/setuptools/script (dev).tmpl"
  82. rm -f "$RPM_BUILD_ROOT%{l_prefix}/lib/docker-compose/lib/python3.8/site-packages/setuptools/command/launcher manifest.xml"
  83. # determine installation files
  84. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  85. %files -f files
  86. %clean