spec: add systemd hooks
According to Fedora packaging guidelines, the rpm scriptlets must call into systemd to make sure the services are enabled/disabled corerctly on install and uninstall. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
88c0cf4b27
commit
339e887693
1 changed files with 10 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ License: ASL 2.0
|
||||||
URL: %{gourl}
|
URL: %{gourl}
|
||||||
Source0: %{gosource}
|
Source0: %{gosource}
|
||||||
|
|
||||||
|
BuildRequires: systemd-rpm-macros
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd
|
||||||
BuildRequires: golang(github.com/coreos/go-systemd/activation)
|
BuildRequires: golang(github.com/coreos/go-systemd/activation)
|
||||||
BuildRequires: golang(github.com/google/uuid)
|
BuildRequires: golang(github.com/google/uuid)
|
||||||
|
|
@ -41,7 +42,6 @@ for cmd in cmd/* ; do
|
||||||
%gobuild -o _bin/$(basename $cmd) %{goipath}/$cmd
|
%gobuild -o _bin/$(basename $cmd) %{goipath}/$cmd
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
install -m 0755 -vd %{buildroot}%{_libexecdir}/osbuild-composer
|
install -m 0755 -vd %{buildroot}%{_libexecdir}/osbuild-composer
|
||||||
install -m 0755 -vp _bin/* %{buildroot}%{_libexecdir}/osbuild-composer/
|
install -m 0755 -vp _bin/* %{buildroot}%{_libexecdir}/osbuild-composer/
|
||||||
|
|
@ -68,6 +68,15 @@ export GOPATH=$(pwd)/_build:%{gopath}
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%post
|
||||||
|
%systemd_post osbuild-composer.service osbuild-composer.socket osbuild-worker@.service
|
||||||
|
|
||||||
|
%preun
|
||||||
|
%systemd_preun osbuild-composer.service osbuild-composer.socket osbuild-worker@.service
|
||||||
|
|
||||||
|
%postun
|
||||||
|
%systemd_postun_with_restart osbuild-composer.service osbuild-composer.socket osbuild-worker@.service
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue