|
| 1 | +--- |
| 2 | +################### |
| 3 | +# OpenSSL v1.1.1 # |
| 4 | +################### |
| 5 | +# Required by OpenJ9 for out-of-process JIT compilation (aka JITaaS) |
| 6 | +# Currently only used by the alternate openj9 branch at https://github.com/eclipse/openj9/tree/jitaas |
| 7 | + |
| 8 | +# Note: some systems have already OpenSSL 1.1.1 instaled (as system) |
| 9 | +# do not install 1.1.1b on them |
| 10 | + |
| 11 | +- name: Set capstone version |
| 12 | + set_fact: |
| 13 | + capstone_version: 4.0.2 |
| 14 | + tags: capstone_source |
| 15 | + |
| 16 | +# check if it is installed in custom location or as system |
| 17 | + |
| 18 | +- name: Test if capstone 4 is installed |
| 19 | + shell: test -f /usr/local/lib/libcapstone.so.4 || test -f /usr/lib/libcapstone.so.4 |
| 20 | + when: |
| 21 | + - (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "SLES") |
| 22 | + - capstone_installed.rc != 0 |
| 23 | + register: capstone_installed |
| 24 | + changed_when: false |
| 25 | + failed_when: false |
| 26 | + tags: capstone_source |
| 27 | + |
| 28 | +- name: Download capstone {{ capstone_version }} |
| 29 | + get_url: |
| 30 | + url: https://github.com/capstone-engine/capstone/archive/{{ capstone_version }}.tar.gz |
| 31 | + dest: /tmp/capstone-{{ capstone_version }}.tar.gz |
| 32 | + force: no |
| 33 | + mode: 0644 |
| 34 | + when: |
| 35 | + - (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "SLES") |
| 36 | + - capstone_installed.rc != 0 |
| 37 | + tags: capstone_source |
| 38 | + |
| 39 | +- name: Extract capstone {{ capstone_version }} |
| 40 | + unarchive: |
| 41 | + src: /tmp/capstone-{{ capstone_version }}.tar.gz |
| 42 | + dest: /tmp |
| 43 | + copy: False |
| 44 | + when: |
| 45 | + - (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "SLES") |
| 46 | + - capstone_installed.rc != 0 |
| 47 | + tags: capstone_source |
| 48 | + |
| 49 | +- name: Build and install capstone {{ capstone_version }} |
| 50 | + shell: cd /tmp/capstone-{{ capstone_version }}} && ./make.sh && PREFIX=/usr/local ./make.sh install |
| 51 | + when: |
| 52 | + - (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "Ubuntu" or ansible_distribution == "SLES") |
| 53 | + - capstone_installed.rc != 0 |
| 54 | + tags: capstone_source |
| 55 | + |
| 56 | +- name: Remove downloaded packages for capstone {{ capstone_version }} |
| 57 | + file: |
| 58 | + path: /tmp/capstone-{{ capstone_version }}.tar.gz |
| 59 | + state: absent |
| 60 | + failed_when: false |
| 61 | + when: |
| 62 | + - (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "Ubuntu" or ansible_distribution == "SLES") |
| 63 | + - capstone_installed.rc != 0 |
| 64 | + tags: capstone_source |
0 commit comments