]> TLD Linux GIT Repositories - packages/rpm-build-tools.git/commitdiff
- exclude systemd related directories at build time
authorMarcin Krol <hawk@tld-linux.org>
Sat, 20 Mar 2021 10:04:56 +0000 (11:04 +0100)
committerMarcin Krol <hawk@tld-linux.org>
Sat, 20 Mar 2021 10:04:56 +0000 (11:04 +0100)
builder.sh

index a19da1207d111a72e70ecf92315418108f3452d0..14f317ac24cc09de0b90933ba2b54191f2911238 100755 (executable)
@@ -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=$?