Auto-requies on binaries used in systemd .service files added

This commit is contained in:
Anton V. Boyarshinov 2019-12-06 17:06:37 +03:00 committed by Dmitry V. Levin
parent 9c18a40269
commit 54a2ca259c
5 changed files with 32 additions and 0 deletions

View File

@ -961,6 +961,7 @@ AC_OUTPUT([ Doxyfile Makefile rpmrc macros platform rpmpopt
scripts/shell.req
scripts/static.req
scripts/symlinks.req
scripts/systemd-services.req
scripts/verify-elf
scripts/posttrans-filetriggers
doc/Makefile doc/manual/Makefile

View File

@ -509,6 +509,7 @@ mv -T %buildroot%_rpmlibdir/{,build}macros
%rpmattr %_rpmlibdir/static.*
%rpmattr %_rpmlibdir/suggest_bpp
%rpmattr %_rpmlibdir/symlinks.*
%rpmattr %_rpmlibdir/systemd-services.*
%rpmattr %_rpmlibdir/tmpdir.sh
%rpmattr %_rpmlibdir/verify-elf
%rpmattr %_rpmlibdir/*.awk

View File

@ -30,6 +30,7 @@ EXTRA_DIST = \
shell.req shell.req.files shell.prov shell.prov.files \
static.req static.req.files \
symlinks.req symlinks.req.files \
systemd-services.req systemd-services.req.files \
tmpdir.sh \
verify-elf
@ -62,6 +63,7 @@ config_SCRIPTS = \
shell.req shell.req.files shell.prov shell.prov.files \
static.req static.req.files \
symlinks.req symlinks.req.files \
systemd-services.req systemd-services.req.files \
tmpdir.sh \
verify-elf \
# 0ldconfig.filetrigger find-package functions posttrans-filetriggers

View File

@ -0,0 +1,11 @@
#!/bin/sh -efu
while IFS=$'\t' read -r f t; do
case "$f" in
${RPM_BUILD_ROOT-}/lib/systemd/system/*) ;;
*) continue ;;
esac
case "$t" in
*'symbolic link to '*) ;;
*) echo "$f" ;;
esac
done

17
scripts/systemd-services.req.in Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh -efu
. @RPMCONFIGDIR@/functions
. @RPMCONFIGDIR@/find-package
SystemdServiceReq()
{
local bin
grep -h '^[[:space:]]*Exec[^=]*=[^-]' "$1" |
sed -n 's|^[[:space:]]*Exec[^=]*=[^/]*\(/[^[:space:]]\+\).*|\1|p' |
while read bin; do
FindPackage "$1" "$bin"
done
}
ArgvFileAction SystemdServiceReq "$@"