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.

61 lines
1.4KB

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