Re: [Rpm-maint] [rpm-software-management/rpm] Is there a way to detect `SRPM` / `RPM` build? (Discussion #3046)

2024-05-06 Thread Panu Matilainen
> So is there a way to detect the SRPM build?

Whether an SRPM gets generated by a build is not something the spec should be 
aware of. It's not a separate thing - it may take place as an isolated step or 
as a part of a binary build. A plain SRPM build does not invoke the dynamic 
spec generation features at all. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/3046#discussioncomment-9324896
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Is there a way to detect `SRPM` / `RPM` build? (Discussion #3046)

2024-04-17 Thread Vít Ondruch
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-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint