diff --git a/configure.ac b/configure.ac index d5d2736..a822d9a 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/rpm-4_0.spec b/rpm-4_0.spec index 6f4e513..3c28d3c 100644 --- a/rpm-4_0.spec +++ b/rpm-4_0.spec @@ -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 diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 7ae4d89..1b2c819 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -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 diff --git a/scripts/systemd-services.req.files b/scripts/systemd-services.req.files new file mode 100755 index 0000000..ec5014a --- /dev/null +++ b/scripts/systemd-services.req.files @@ -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 diff --git a/scripts/systemd-services.req.in b/scripts/systemd-services.req.in new file mode 100755 index 0000000..452aeb4 --- /dev/null +++ b/scripts/systemd-services.req.in @@ -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 "$@"