Files
ansible_role_package/tasks/helpers/make.yml
Matthew Stobbs d1d556d425 modified make, fixed packages and vars
- the make helper now has distinct build stages
  - configure: is now defined in pkg.targets.configure
  - build: is now defined in pkg.targets.build
  - install: is now defined in pkg.targets.install
  - added pre-install: which is a list of targets that are looped over
before install
  - added post-instal: which is a list of targets that are looped over
after install

- removed major package level variables from vars/main.yml
  - moving those variables into actual package level variables as
defaults
  - if the values are defined they will be used instead of defaults
2026-03-19 13:39:26 -06:00

67 lines
1.7 KiB
YAML

# vim: set filetype=yaml.ansible :
#
## Helper: make.yml
## Description: run make to build packages
## Variables:
##
---
- name: Fetch source code
vars:
path: "{{ pkg.path }}"
repo: "{{ pkg.repo }}"
version: "{{ pkg.version | default(omit) }}"
ansible.builtin.include_tasks: helpers/git.yml
- name: Run configure target
when:
- pkg.target.configure is defined
community.general.make:
chdir: "{{ pkg.path }}"
target: "{{ pkg.target.configure.name }}"
params: "{{ pkg.target.configure.params | default(omit) }}"
- name: Run build target
when:
- pkg.target.build is defined
community.general.make:
chdir: "{{ pkg.path }}"
target: "{{ pkg.target.build.name }}"
params: "{{ target.params | default(omit) }}"
- name: Clean old installation
vars:
files: "{{ pkg.install_files }}"
when:
- pkg.install_files is defined
ansible.builtin.include_tasks: helpers/clean_install.yml
- name: Run preinstall targets
when:
- pkg.targets.preinstall is defined
loop: "{{ pkg.targets.preinstall }}"
loop_control:
loop_var: target
community.general.make:
chdir: "{{ pkg.path }}"
target: "{{ target.name }}"
params: "{{ target.params | default(omit) }}"
- name: Run install target
when:
- pkg.targets.install is defined
community.general.make:
chdir: "{{ pkg.path }}"
target: "{{ pkg.targets.install.name }}"
params: "{{ pkg.targets.install.params | default(omit) }}"
- name: Run postinstall targets
when:
- pkg.targets.postinstall is defined
loop: "{{ pkg.targets.postinstall }}"
loop_control:
loop_var: target
community.general.make:
chdir: "{{ pkg.path }}"
target: "{{ target.name }}"
params: "{{ target.params | default(omit) }}"