70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
- name: Remove existing install {{ pkg }}
|
|
when:
|
|
- sdbus_cpp_2.clean
|
|
become: true
|
|
loop: "{{ sdbus_cpp_2.installed_files }}"
|
|
loop_control:
|
|
loop_var: file
|
|
ansible.builtin.file:
|
|
state: absent
|
|
path: "{{ sdbus_cpp_2.prefix }}/{{ file }}"
|
|
|
|
- name: Check for installed {{ pkg }}
|
|
register: stat_sdbus_cpp_2_inst
|
|
ansible.builtin.stat:
|
|
path: "{{ sdbus_cpp_2.prefix }}/{{ lib_path }}/libsdbus-c++.so"
|
|
|
|
- name: Build and install {{ pkg }}
|
|
when:
|
|
- not stat_sdbus_cpp_2_inst.stat.exists
|
|
block:
|
|
- name: Clone git repository {{ pkg }}
|
|
ansible.builtin.git:
|
|
force: true
|
|
depth: 1
|
|
recursive: true
|
|
dest: "{{ sdbus_cpp_2.git_path }}"
|
|
repo: "{{ sdbus_cpp_2.repo }}"
|
|
version: "{{ sdbus_cpp_2.vers }}"
|
|
|
|
- name: Configure {{ pkg }}
|
|
ansible.builtin.command:
|
|
creates: "{{ sdbus_cpp_2.git_path }}/build"
|
|
chdir: "{{ sdbus_cpp_2.git_path }}"
|
|
argv:
|
|
- cmake
|
|
- --no-warn-unused-cli
|
|
- -DCMAKE_BUILD_TYPE=Release
|
|
- -DCMAKE_INSTALL_PREFIX={{ sdbus_cpp_2.prefix }}
|
|
- -S
|
|
- .
|
|
- -B
|
|
- ./build
|
|
|
|
- name: Build {{ pkg }}
|
|
ansible.builtin.command:
|
|
creates: "{{ sdbus_cpp_2.git_path }}/build/libsdbus-c++.so"
|
|
chdir: "{{ sdbus_cpp_2.git_path }}"
|
|
argv:
|
|
- cmake
|
|
- --build
|
|
- ./build
|
|
- --config
|
|
- Release
|
|
- --target
|
|
- all
|
|
- -j
|
|
- "{{ ansible_processor_nproc | int }}"
|
|
|
|
- name: Install {{ pkg }}
|
|
become: true
|
|
ansible.builtin.command:
|
|
creates: "{{ sdbus_cpp_2.prefix }}/{{ lib_path }}/libsdbus-c++.so"
|
|
chdir: "{{ sdbus_cpp_2.git_path }}"
|
|
argv:
|
|
- cmake
|
|
- --install
|
|
- ./build
|