ansible.spec 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ##
  2. ## ansible.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2020 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 version
  24. %define V_opkg 2.9.5
  25. %define V_dist 2.9.5
  26. # package information
  27. Name: ansible
  28. Summary: IT Automation Tool
  29. URL: https://www.ansible.com/
  30. Vendor: Michael DeHaan
  31. Packager: OpenPKG Project
  32. Distribution: OpenPKG Community
  33. Class: EVAL
  34. Group: SCM
  35. License: GPL
  36. Version: %{V_opkg}
  37. Release: 20200214
  38. # list of sources
  39. Source0: https://github.com/ansible/ansible/archive/v%{V_dist}.tar.gz
  40. Source1: ansible.cfg
  41. Source2: hosts
  42. # build information
  43. BuildPreReq: OpenPKG, openpkg >= 20160101
  44. PreReq: OpenPKG, openpkg >= 20160101
  45. BuildPreReq: python, python-net, python-text, python-yaml, python-setup, python-crypto
  46. PreReq: python, python-net, python-text, python-yaml, python-setup, python-crypto
  47. %description
  48. Ansible is a radically simple IT automation system. It handles
  49. configuration-management, application deployment, cloud
  50. provisioning, ad-hoc task-execution, and multinode orchestration -
  51. including trivializing things like zero downtime rolling updates
  52. with load balancers.
  53. %track
  54. prog ansible = {
  55. version = %{V_dist}
  56. url = https://github.com/ansible/ansible/releases
  57. regex = v(\d+\.\d+\.\d+)\.tar\.gz
  58. }
  59. %prep
  60. %setup -q -n ansible-%{V_dist}
  61. %build
  62. # adjust paths
  63. %{l_shtool} subst \
  64. -e 's;/etc/ansible/ansible\.cfg;%{l_prefix}/etc/ansible/ansible.cfg;' \
  65. lib/ansible/config/manager.py
  66. %{l_shtool} subst \
  67. -e 's;/etc/ansible/hosts;%{l_prefix}/etc/ansible/hosts;' \
  68. lib/ansible/config/base.yml \
  69. lib/ansible/inventory/manager.py
  70. %install
  71. # install program
  72. %{l_prefix}/bin/python setup.py install \
  73. --root=$RPM_BUILD_ROOT \
  74. --prefix=%{l_prefix}
  75. # install default global configuration
  76. %{l_shtool} mkdir -f -p -m 755 \
  77. $RPM_BUILD_ROOT%{l_prefix}/etc/ansible
  78. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  79. %{SOURCE ansible.cfg} $RPM_BUILD_ROOT%{l_prefix}/etc/ansible/
  80. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  81. %{SOURCE hosts} $RPM_BUILD_ROOT%{l_prefix}/etc/ansible/
  82. # determine installation files
  83. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  84. %files -f files
  85. %clean