From: Marcin Krol <hawk@tld-linux.org>
Date: Sat, 20 Mar 2021 17:02:26 +0000 (+0100)
Subject: - add tld macro to release when building to allow release control
X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=dbb862e4ac5a88826c43d8f48e265e5f3238174d;p=packages%2Frpm-build-tools.git

- add tld macro to release when building to allow release control
---

diff --git a/builder.sh b/builder.sh
index 4ea1d3d..1d876e5 100755
--- a/builder.sh
+++ b/builder.sh
@@ -1756,6 +1756,8 @@ build_package() {
 	fi
 	# Enable/disable distro wide bconds based on ~/.distbcond
 	process_distbcond "$specdir/$SPECFILE"
+	# Add %tld macro to release to allow release control
+	sed -i -r -e 's/^Release:\s+(.*)$/Release:\t\1%{?tld}/' $specdir/$SPECFILE
 	# 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=$?