From c01e1e0486d6a26caf883c1ded503ece9f24198f Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 26 Jun 2018 14:26:44 -0700 Subject: [PATCH] Include example blueprints in the rpm This also sets ownership of /var/lib/lorax/composer/ to root:weldr to allow missing directories to be created at runtime. --- lorax-composer.spec | 8 ++++++++ systemd/lorax-composer.service | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lorax-composer.spec b/lorax-composer.spec index 34b067f7..4783fcc2 100644 --- a/lorax-composer.spec +++ b/lorax-composer.spec @@ -59,6 +59,11 @@ make docs rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install +# Install example blueprints from the test suite. +# This path MUST match the lorax-composer.service blueprint path. +mkdir -p $RPM_BUILD_ROOT/var/lib/lorax/composer/blueprints/ +cp ./tests/pylorax/blueprints/*toml $RPM_BUILD_ROOT/var/lib/lorax/composer/blueprints/ + # Do Not Package the lorax files rm -f $RPM_BUILD_ROOT/%{python_sitelib}/lorax-*.egg-info rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/pylorax/*py @@ -105,6 +110,9 @@ getent passwd weldr >/dev/null 2>&1 || useradd -r -g weldr -d / -s /sbin/nologin %{_unitdir}/lorax-composer.service %{_unitdir}/lorax-composer.socket %{_tmpfilesdir}/lorax-composer.conf +%dir %attr(0771, root, weldr) %{_sharedstatedir}/lorax/composer/ +%dir %attr(0771, root, weldr) %{_sharedstatedir}/lorax/composer/blueprints/ +%attr(0771, weldr, weldr) %{_sharedstatedir}/lorax/composer/blueprints/* %files -n composer-cli %{_bindir}/composer-cli diff --git a/systemd/lorax-composer.service b/systemd/lorax-composer.service index 3ef53cdd..2c6a3428 100644 --- a/systemd/lorax-composer.service +++ b/systemd/lorax-composer.service @@ -7,7 +7,7 @@ Wants=network-online.target User=root Type=simple ExecStartPre=/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/lorax-composer.conf -ExecStart=/usr/sbin/lorax-composer /var/lib/lorax/composer/recipes/ +ExecStart=/usr/sbin/lorax-composer /var/lib/lorax/composer/blueprints/ [Install] WantedBy=multi-user.target