From 04c0becd6722eb271bf30767d59c5d63d8d32d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Wed, 22 Jan 2020 11:14:04 +0100 Subject: [PATCH] spec: Split the worker into its own rpm subpackage As the worker can now be running on a different machine than the composer it makes sense to install only worker binary on some machines. This commit does exactly that - worker is now its own subpackage with the beautiful name of golang-github-osbuild-composer-worker. The main osbuild-composer package requires the worker subpackage, therefore there will always be worker installed with composer. When composer is started one local worker process will be spawned. If you don't want the default worker process you need to mask its unit file: systemctl mask osbuild-worker@1.service --- golang-github-osbuild-composer.spec | 30 +++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/golang-github-osbuild-composer.spec b/golang-github-osbuild-composer.spec index 714cbc099..4ef5842e1 100644 --- a/golang-github-osbuild-composer.spec +++ b/golang-github-osbuild-composer.spec @@ -35,6 +35,7 @@ BuildRequires: golang(github.com/gobwas/glob) BuildRequires: golang(github.com/google/go-cmp/cmp) %endif +Requires: golang-github-osbuild-composer-worker Requires: systemd Requires: osbuild>=7 @@ -98,18 +99,19 @@ export GOPATH=$PWD/_build:%{gopath} %endif %post -%systemd_post osbuild-composer.service osbuild-composer.socket osbuild-worker@.service +%systemd_post osbuild-composer.service osbuild-composer.socket osbuild-remote-worker.socket %preun -%systemd_preun osbuild-composer.service osbuild-composer.socket osbuild-worker@.service +%systemd_preun osbuild-composer.service osbuild-composer.socket osbuild-remote-worker.socket %postun -%systemd_postun_with_restart osbuild-composer.service osbuild-composer.socket osbuild-worker@.service +%systemd_postun_with_restart osbuild-composer.service osbuild-composer.socket osbuild-remote-worker.socket %files %license LICENSE %doc README.md -%{_libexecdir}/osbuild-composer/ +%{_libexecdir}/osbuild-composer/osbuild-composer +%{_libexecdir}/osbuild-composer/dnf-json %{_datadir}/osbuild-composer/ %{_unitdir}/*.{service,socket} %{_sysusersdir}/osbuild-composer.conf @@ -127,6 +129,26 @@ Integration tests to be run on a pristine-dedicated system to test the osbuild-c %{_libexecdir}/tests/osbuild-composer/osbuild-tests %{_libexecdir}/tests/osbuild-composer/osbuild-dnf-json-tests +%package worker +Summary: The worker for osbuild-composer +Requires: systemd +Requires: osbuild + +%description worker +The worker for osbuild-composer + +%files worker +%{_libexecdir}/osbuild-composer/osbuild-worker + +%post worker +%systemd_post osbuild-worker@.service osbuild-remote-worker@.service + +%preun worker +%systemd_preun osbuild-worker@.service osbuild-remote-worker@.service + +%postun worker +%systemd_postun_with_restart osbuild-worker@.service osbuild-remote-worker@.service + %changelog * Sun Dec 1 11:00:00 CEST 2019 Ondrej Budai - 4-1 - New upstream release.