[Rpm-maint] [rpm-software-management/rpm] Is there a way to detect `SRPM` / `RPM` build? (Discussion #3046)
Vít Ondruch
notifications at github.com
Wed Apr 17 14:27:16 UTC 2024
Looking at the dynamic spec, specifically at 5d288554719095d1c67fd87cad65224743152d06, it is silly that the `FULLDYNAMIC` is external information. If it was possible to distinguish the `SRPM` / `RPM` build, it would be more interesting. E.g. if there was `_srpm_build` macro defined during the SRPM build, this could be immediately interesting:
~~~diff
$ git diff
diff --git a/dynamic.spec b/dynamic.spec
index d46a5c4..f86de2e 100644
--- a/dynamic.spec
+++ b/dynamic.spec
@@ -2,12 +2,12 @@ Name: dynamic
Version: 1.0
Release: 1
BuildArch: noarch
-%{?!FULLDYNAMIC:
+%{?_srpm_build:
Group: Utilities
License: GPL
Distribution: RPM test suite.
URL: http://rpm.org
-Summary: dynamic hello -- hello, world rpm
+Summary: source dynamic hello -- hello, world rpm
}
%description
@@ -23,13 +23,11 @@ echo "Q: Why?\nA: Because we can!" > FAQ
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
echo " " > $RPM_BUILD_ROOT/usr/local/bin/hello
-%{?FULLDYNAMIC:
echo "Group: Utilities" >> %{specpartsdir}/mainpkg.specpart
echo "License: GPL" >> %{specpartsdir}/mainpkg.specpart
echo "Distribution: RPM test suite." >> %{specpartsdir}/mainpkg.specpart
echo "URL: http://rpm.org" >> %{specpartsdir}/mainpkg.specpart
-echo "Summary: dynamic hello -- hello, world rpm" >> %{specpartsdir}/mainpkg.specpart
-}
+echo "Summary: binary dynamic hello -- hello, world rpm" >> %{specpartsdir}/mainpkg.specpart
echo "%package docs" >> %{specpartsdir}/docs.specpart
%{?!FAIL:echo "Summary: Documentation for dynamic spec" >> %{specpartsdir}/docs.specpart}
~~~
So is there a way to detect the SRPM build?
BTW does this feature enable to build SRPM without the `Summary` / `License` information? Is that intentional?
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/3046
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/repo-discussions/3046 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240417/75196481/attachment.html>
More information about the Rpm-maint
mailing list