From 4a622468cc1a2fe34b00641538f04d4d2bdf0b8b Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Sat, 20 Mar 2021 11:04:56 +0100 Subject: [PATCH] - exclude systemd related directories at build time --- builder.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builder.sh b/builder.sh index a19da12..14f317a 100755 --- a/builder.sh +++ b/builder.sh @@ -1750,6 +1750,10 @@ build_package() { local specdir=$(insert_gitlog $SPECFILE) ulimit -c unlimited + # If required exclude directories with systemd related files from package contents + if grep -q -E 'systemd(unitdir|userunitdir|tmpfilesdir)' $specdir/$SPECFILE; then + sed -i -e '/^%exclude_systemd_files/d; /^%files/s/$/\n%exclude_systemd_files/g;' $specdir/$SPECFILE + fi # FIXME: eval here is exactly why? PATH=$CLEAN_PATH eval teeboth "'$logfile'" ${TIME_COMMAND} ${NICE_COMMAND} $RPMBUILD $TARGET_SWITCH $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $RPMBUILDOPTS $BCOND --define \'_specdir $PACKAGE_DIR\' --define \'_sourcedir $PACKAGE_DIR\' $specdir/$SPECFILE retval=$? -- 2.46.0