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.
This commit is contained in:
Brian C. Lane 2018-06-26 14:26:44 -07:00
parent 4c466d4620
commit c01e1e0486
2 changed files with 9 additions and 1 deletions

View File

@ -59,6 +59,11 @@ make docs
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install 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 # Do Not Package the lorax files
rm -f $RPM_BUILD_ROOT/%{python_sitelib}/lorax-*.egg-info rm -f $RPM_BUILD_ROOT/%{python_sitelib}/lorax-*.egg-info
rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/pylorax/*py 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.service
%{_unitdir}/lorax-composer.socket %{_unitdir}/lorax-composer.socket
%{_tmpfilesdir}/lorax-composer.conf %{_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 %files -n composer-cli
%{_bindir}/composer-cli %{_bindir}/composer-cli

View File

@ -7,7 +7,7 @@ Wants=network-online.target
User=root User=root
Type=simple Type=simple
ExecStartPre=/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/lorax-composer.conf 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] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target