Enhance Makefile and RPM specs

For debian build the dh_auto_install step will inject a DESTDIR based on
the artifact build directory PKGBUILDIDR (equivalent to buildroot for
spec files), but without control for the desired destination on the
system (local_stx_ansible_dir):
make -j32 install DESTDIR=/<<PKGBUILDDIR>>/debian/playbookconfig

Change Makefile to support DESTDIR and PREFIX.
Change spec files to use DESTDIR as buildroot and PREFIX as destination
on the system.
This allows to write clean debian rules files.

Tested by doing a CentOS7 build-pkg & build-iso, then did run the
ansible playbook.

Story: 2009101
Task: 43051
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
Change-Id: Ic5a0463a8b5fa804f7829435d91e51a8e315802e
This commit is contained in:
Dan Voiculeasa 2021-08-19 10:37:43 +03:00
parent dc0e08157e
commit 3accc08948
3 changed files with 5 additions and 5 deletions

View File

@ -32,7 +32,7 @@ This package contains playbooks used for configuring StarlingX.
%build
%install
make install DESTDIR=%{buildroot}%{local_stx_ansible_dir}
make install DESTDIR=%{buildroot} PREFIX=%{local_stx_ansible_dir}
%post
cp %{local_stx_ansible_dir}/playbooks/ansible.cfg %{local_etc_ansible}

View File

@ -33,7 +33,7 @@ This package contains playbooks used for configuring StarlingX.
%build
%install
make install DESTDIR=%{buildroot}%{local_stx_ansible_dir}
make install DESTDIR=%{buildroot} PREFIX=%{local_stx_ansible_dir}
chmod 755 %{buildroot}%{local_stx_ansible_dir}/playbooks/roles/bootstrap/persist-config/files/populate_initial_config.py
chmod 755 %{buildroot}%{local_stx_ansible_dir}/playbooks/roles/bootstrap/prepare-env/files/check_root_disk_size.py
chmod 755 %{buildroot}%{local_stx_ansible_dir}/playbooks/roles/backup/backup-system/files/fm_alarm.py

View File

@ -2,8 +2,8 @@
# SPDX-License-Identifier: Apache-2.0
#
DESTDIR ?= /usr/share/ansible/stx-ansible
PREFIX ?= /usr/share/ansible/stx-ansible
install:
install -d -m 0755 $(DESTDIR)/playbooks
cp -R playbooks/ $(DESTDIR)/
install -d -m 0755 $(DESTDIR)$(PREFIX)/playbooks
cp -R playbooks/ $(DESTDIR)$(PREFIX)/