Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Ability to have a file in %files via a command (macro) evaluated at buildtime (#894)

2019-10-11 Thread Miro Hrončok
The use-case was to have a `%{pyproject_metadata}` macro like this:

```
%files -n python3-foo
%{pyproject_metadata}
%{python3_sitelib}/foo/
```

The macro would:

 * find the built Python dist-info directory, parse the metadata from it, 
locate the License-File filed (not yet available)  and output something like:

```
%dir %{python_sitelib}/foo-41.4.0.dist-info/
%license %{python_sitelib}/foo-41.4.0.dist-info/INSTALLER
%{python_sitelib}/foo-41.4.0.dist-info/dependency_links.txt
%{python_sitelib}/foo-41.4.0.dist-info/entry_points.txt
%{python_sitelib}/foo-41.4.0.dist-info/LICENSE
%{python_sitelib}/foo-41.4.0.dist-info/METADATA
%{python_sitelib}/foo-41.4.0.dist-info/RECORD
%{python_sitelib}/foo-41.4.0.dist-info/top_level.txt
%{python_sitelib}/foo-41.4.0.dist-info/WHEEL
%{python_sitelib}/foo-41.4.0.dist-info/zip-safe
```

-


Instead, we can have `%{pyproject_install}` to output a special file and use:

```
%files -n python3-foo -f %pyproject_metadata
%{python3_sitelib}/foo/
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/894#issuecomment-541016101___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Ability to have a file in %files via a command (macro) evaluated at buildtime (#894)

2019-10-11 Thread Panu Matilainen
The reason I didn't close this offhand was that I'm curious about the use-case, 
but apparently forgot to ask about it :) I mean, maybe there is something that 
we could do to help the case without making %files parsing more special than 
the rest of the spec.

Note that the -f files manifest is macro expanded as well, and that expansion 
happens just before actually processing the file list. So you can have a macro 
with (complex) logic expanded at that time, it just needs to be in a files 
manifest instead of the spec proper.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/894#issuecomment-541001420___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Ability to have a file in %files via a command (macro) evaluated at buildtime (#894)

2019-10-11 Thread Miro Hrončok
Closed #894.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/894#event-2705577119___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Ability to have a file in %files via a command (macro) evaluated at buildtime (#894)

2019-10-11 Thread Miro Hrončok
Roger that. I've tried :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/894#issuecomment-540996257___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Ability to have a file in %files via a command (macro) evaluated at buildtime (#894)

2019-10-11 Thread Panu Matilainen
That'd require parsing spec %files section without macro expansion, which would 
make it completely different from everything else in the spec, and break 
legitimate uses. If you take 

```
%files
%{one_macro}
%{other_macro}

Those macros might expand to files, or they might expand to new spec sections 
or whatever, and there's no telling until you expand the line. Ditto for all 
sorts of %if etc logic etc.

This is what -f is for, please use what exists and works.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/894#issuecomment-540992299___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint