Saltstack Official Salt Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 line
1.3KB

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