Hi,
I've stumbled upon this piece of code in my package: # Define license macro if not present %{!?_licensedir:%global license %doc}
https://src.fedoraproject.org/rpms/mariadb/blob/rawhide/f/mariadb.spec#_322
Git blame points out 7 year old commit: https://src.fedoraproject.org/rpms/mariadb/c/e3d4b2f14e5e0cb7b42b468ffb9de6f...
The RPM docs says the %license 'Virtual File Attribute' was added in version 4.11, which has been added to Fedora years before the commit above: https://src.fedoraproject.org/rpms/rpm/c/2970ed07c98c8929eca0bdfebda389af5a2...
I tried to remove the line and I haven't noticed any differences in output of "rpm -q -d <rpm>" and "rpm -q -L <rpm>" before and after.
I'm not even sure what the line is trying to do - I read it as "under some condition, create %license global macro with value %doc".
However as %license and %doc are both Virtual File Attributes, I doubt they can be overwritten to become macros. And if it could be, I can't imagine what value will be given to the macro, as I'd guess that the %doc Virtual File Attribute does not have any value but instead is used as a keyword for the parser.
--
The questions are: (1) is it safe to remove ? (2) does it actually do anything? (3) if yes, what does it do ?
--
Michal Schorm Software Engineer Core Services - Databases Team Red Hat
--
On 30/11/2023 00:14, Michal Schorm wrote:
I've stumbled upon this piece of code in my package: # Define license macro if not present %{!?_licensedir:%global license %doc}
https://src.fedoraproject.org/rpms/mariadb/blob/rawhide/f/mariadb.spec#_322
Git blame points out 7 year old commit: https://src.fedoraproject.org/rpms/mariadb/c/e3d4b2f14e5e0cb7b42b468ffb9de6f...
The RPM docs says the %license 'Virtual File Attribute' was added in version 4.11, which has been added to Fedora years before the commit above: https://src.fedoraproject.org/rpms/rpm/c/2970ed07c98c8929eca0bdfebda389af5a2...
I tried to remove the line and I haven't noticed any differences in output of "rpm -q -d <rpm>" and "rpm -q -L <rpm>" before and after.
I'm not even sure what the line is trying to do - I read it as "under some condition, create %license global macro with value %doc".
It's just making %license an alias for %doc if your building for a release old enough that %license isn't supported, as detected by checking if %licensedir is defined.
It hasn't been needed for a long time.
Tom
On Thu, Nov 30, 2023 at 1:19 AM Tom Hughes via devel devel@lists.fedoraproject.org wrote:
It hasn't been needed for a long time.
Good, thanks. Off it goes. :)
It's just making %license an alias for %doc if your building for a release old enough that %license isn't supported, as detected by checking if %licensedir is defined.
Why is it checked through the %licensedir macro, and not the %license VFT instead? If %doc VFT could be used as an actual value for a macro, I'd assume it could be used in conditional too. (to verify whether such VFT exists)
Michal
--
Michal Schorm Software Engineer Core Services - Databases Team Red Hat
--
On Thu, Nov 30, 2023 at 1:19 AM Tom Hughes via devel devel@lists.fedoraproject.org wrote:
On 30/11/2023 00:14, Michal Schorm wrote:
I've stumbled upon this piece of code in my package: # Define license macro if not present %{!?_licensedir:%global license %doc}
https://src.fedoraproject.org/rpms/mariadb/blob/rawhide/f/mariadb.spec#_322
Git blame points out 7 year old commit: https://src.fedoraproject.org/rpms/mariadb/c/e3d4b2f14e5e0cb7b42b468ffb9de6f...
The RPM docs says the %license 'Virtual File Attribute' was added in version 4.11, which has been added to Fedora years before the commit above: https://src.fedoraproject.org/rpms/rpm/c/2970ed07c98c8929eca0bdfebda389af5a2...
I tried to remove the line and I haven't noticed any differences in output of "rpm -q -d <rpm>" and "rpm -q -L <rpm>" before and after.
I'm not even sure what the line is trying to do - I read it as "under some condition, create %license global macro with value %doc".
It's just making %license an alias for %doc if your building for a release old enough that %license isn't supported, as detected by checking if %licensedir is defined.
It hasn't been needed for a long time.
Tom
-- Tom Hughes (tom@compton.nu) http://compton.nu/ -- _______________________________________________ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
On 30/11/2023 00:28, Michal Schorm wrote:
On Thu, Nov 30, 2023 at 1:19 AM Tom Hughes via devel devel@lists.fedoraproject.org wrote:
It hasn't been needed for a long time.
Good, thanks. Off it goes. :)
It's just making %license an alias for %doc if your building for a release old enough that %license isn't supported, as detected by checking if %licensedir is defined.
Why is it checked through the %licensedir macro, and not the %license VFT instead? If %doc VFT could be used as an actual value for a macro, I'd assume it could be used in conditional too. (to verify whether such VFT exists)
Well you said it yourself, that %license is a keyword and not a macro so you probably can't check if it's defined.
Tom