add archive to make helper

- helper 'make' will check for repo to use git, and extract_to to use
archive
- configure target is changed to run the ./configure script
This commit is contained in:
2026-04-18 11:16:02 -06:00
parent 2c008ecdda
commit bc7364185b
2 changed files with 78 additions and 4 deletions

View File

@@ -5,21 +5,29 @@
## Variables:
##
---
- name: Fetch source code
- name: Fetch source code git
vars:
path: "{{ pkg.path }}"
repo: "{{ pkg.repo }}"
version: "{{ pkg.version | default(omit) }}"
when:
- pkg.repo is defined
ansible.builtin.include_tasks: helpers/git.yml
- name: Fetch source code archive
vars:
archive: "{{ pkg }}"
when:
- pkg.extract_to is defined
ansible.builtin.include_tasks: helpers/archive.yml
- name: Run configure target
when:
- pkg.target.configure is defined
register: make_configure
community.general.make:
ansible.builtin.command:
chdir: "{{ pkg.path }}"
target: "{{ pkg.target.configure.name }}"
params: "{{ pkg.target.configure.params | default(omit) }}"
argv: ["./configure", "{{ pkg.target.configure.options }}"]
- name: Run build target
when:

View File

@@ -0,0 +1,66 @@
# vim: set filetype=yaml.ansible :
#
## Package: stow
## Description: GNU symbolic link manager
## Version: latest
## Methods: [system, source]
## Helpers: make
---
- name: Set stow default facts # {{{
ansible.builtin.set_fact:
stow:
methods:
- system
- source
pkgname:
RedHat: stow
Archlinux: stow
baseurl: https://ftp.gnu.org/gnu/stow
version: 2.4.1
# }}}
- name: Configure stow
when:
- "'stow' not in __configured"
block:
- name: Set stow install method
when:
- stow_imethod is undefined
ansible.builtin.set_fact:
stow_imethod: "{{ imethod if imethod in stow.methods else stow.methods[0] }}"
- name: Configure stow system install
when:
- stow_imethod == 'system'
block:
- name: Queue stow for system install
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + [stow.pkgname[os_family]] }}"
stow_install: "{{ stow_imethod }}={{ stow.pkgname[os_family] }}"
- name: Configure stow source install
when:
- stow_imethod == 'source'
block:
- name: Set stow source install configuration
ansible.builtin.set_fact:
stow_src_install:
url: "{{ stow.baseurl }}/stow-{{ stow.version }}.tar.gz"
name: "stow-{{ stow.version }}.tar.gz"
extract_to: "{{ d_cache.path }}"
path: "{{ d_cache.path }}/stow-{{ stow.version }}"
target:
configure:
options: "--prefix={{ install_prefix }}"
build:
name: ""
install:
name: install
- name: Queue stow source install
ansible.builtin.set_fact:
pkg_make: "{{ pkg_make + [stow_src_install] }}"
stow_install: "{{ stow_imethod }}={{ stow_src_install }}"
- name: Finalise stow configuration
ansible.builtin.set_fact:
__configured: "{{ __configured | combine( { 'stow': stow_install } ) }}"