Saltstack Official Salt Formula
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

76 lines
1.8KB

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