Saltstack Official Salt Formula
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

82 lines
2.0KB

  1. {% from "salt/map.jinja" import salt_settings with context %}
  2. {% set pygit2_settings = salt_settings.gitfs.pygit2 %}
  3. {% if pygit2_settings.git.get('require_state', False) %}
  4. include:
  5. - {{ pygit2_settings.git.require_state }}
  6. {% elif pygit2_settings.git.get('install_from_package', 'git') %}
  7. pygit2-git:
  8. pkg.installed:
  9. - name: {{ pygit2_settings.git.install_from_package }}
  10. {% endif %}
  11. {% if pygit2_settings.install_from_source %}
  12. {% set libgit2_settings = pygit2_settings.libgit2 %}
  13. {% if libgit2_settings.install_from_source %}
  14. {% set libgit2_src_dir = libgit2_settings.build_parent_dir + 'libgit2-' + libgit2_settings.version %}
  15. {% set libgit2_build_dir = libgit2_src_dir + '/_build' %}
  16. # we probably don't have a package or it's not a high enough version
  17. # install latest from source/pip
  18. pygit-deps:
  19. pkg.installed:
  20. - pkgs:
  21. - build-essential
  22. - python-dev
  23. - libssh-dev
  24. - libffi-dev
  25. - cmake
  26. dl-libgit2-src:
  27. archive.extracted:
  28. - name: {{ libgit2_settings.build_parent_dir }}
  29. - source: https://github.com/libgit2/libgit2/archive/v{{ libgit2_settings.version }}.tar.gz
  30. - source_hash: md5={{ libgit2_settings.download_hash }}
  31. - archive_format: tar
  32. - keep: True
  33. - if_missing: /usr/src/libgit2-{{ libgit2_settings.version }}
  34. {{ libgit2_build_dir }}:
  35. file.directory
  36. configure-libgit2:
  37. cmd.run:
  38. - name: cmake ..
  39. - cwd: {{ libgit2_build_dir }}
  40. - creates: {{ libgit2_build_dir }}/Makefile
  41. build-libgit2:
  42. cmd.run:
  43. - name: make -j4
  44. - cwd: {{ libgit2_build_dir }}
  45. - creates: {{ libgit2_build_dir }}/libgit2.so
  46. install-libgit2:
  47. cmd.run:
  48. - name: make install
  49. - cwd: {{ libgit2_build_dir }}
  50. - creates: /usr/local/lib/libgit2.so
  51. run-ldconfig-after-lib-install:
  52. cmd.run:
  53. - name: ldconfig
  54. - onchanges:
  55. - cmd: install-libgit2
  56. {% else %}
  57. {{ salt_settings.libgit2 }}:
  58. pkg.installed
  59. {% endif %}
  60. install-pygit2:
  61. pip.installed:
  62. - name: pygit2 == {{ pygit2_settings.version }}
  63. {% else %}
  64. {{ salt_settings.pygit2 }}:
  65. pkg.installed
  66. {% endif %}