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:
@@ -5,21 +5,29 @@
|
|||||||
## Variables:
|
## Variables:
|
||||||
##
|
##
|
||||||
---
|
---
|
||||||
- name: Fetch source code
|
- name: Fetch source code git
|
||||||
vars:
|
vars:
|
||||||
path: "{{ pkg.path }}"
|
path: "{{ pkg.path }}"
|
||||||
repo: "{{ pkg.repo }}"
|
repo: "{{ pkg.repo }}"
|
||||||
version: "{{ pkg.version | default(omit) }}"
|
version: "{{ pkg.version | default(omit) }}"
|
||||||
|
when:
|
||||||
|
- pkg.repo is defined
|
||||||
ansible.builtin.include_tasks: helpers/git.yml
|
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
|
- name: Run configure target
|
||||||
when:
|
when:
|
||||||
- pkg.target.configure is defined
|
- pkg.target.configure is defined
|
||||||
register: make_configure
|
register: make_configure
|
||||||
community.general.make:
|
ansible.builtin.command:
|
||||||
chdir: "{{ pkg.path }}"
|
chdir: "{{ pkg.path }}"
|
||||||
target: "{{ pkg.target.configure.name }}"
|
argv: ["./configure", "{{ pkg.target.configure.options }}"]
|
||||||
params: "{{ pkg.target.configure.params | default(omit) }}"
|
|
||||||
|
|
||||||
- name: Run build target
|
- name: Run build target
|
||||||
when:
|
when:
|
||||||
|
|||||||
@@ -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 } ) }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user