Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Generate %license tag for the license file in %files #4

Closed
tradej opened this issue Jan 30, 2015 · 8 comments
Closed

Generate %license tag for the license file in %files #4

tradej opened this issue Jan 30, 2015 · 8 comments
Assignees
Labels

Comments

@tradej
Copy link
Member

tradej commented Jan 30, 2015

As of the latest update of Fedora Guidelines, the files that contain the licensing text in a package must be denoted with the %license macro. Dap2rpm currently uses the %doc directive, in compliance with the old guidelines.

As there is currently no mechanism in the DAP packaging to differentiate general documentation from the licensing files, I will file a bug for both dap-dap and devassistant and link them to this one.

@hroncok
Copy link
Member

hroncok commented Feb 1, 2015

According to discussion in devassistant/devassistant#336, here is what I propose.

  • dap2rpm -l will allow one more optional argument --license/-L specifiing where the license is.
  • If the option is used, the routine that generates the list will remove the given file from %doc and move it to %license
  • macro %install_assistant will accept one positional argument that will b passed as --license option to dap2rpm

@tradej
Copy link
Member Author

tradej commented Feb 2, 2015

Okay, this is a solution I find feasible. I will update dap2rpm and request a change to Guidelines.

@tradej tradej self-assigned this Feb 2, 2015
@hroncok
Copy link
Member

hroncok commented Feb 3, 2015

If this is valid:

%files -f dap-files
%license %{assistant_path}/doc/%{shortname}/LICENSE

We don't need any extra code, we just need to put a notice to the guidelines.

@tradej
Copy link
Member Author

tradej commented Feb 3, 2015

This is not particularly valid, as the LICENSE file is listed twice, which is sort of against the guidelines. Moreover, if someone installs the RPM with the --nodocs flag, they don't get the LICENSE file at all. I deem the change in code necessary.

@hroncok
Copy link
Member

hroncok commented Feb 4, 2015

Also note that listing the files one by one would also need the directory itself to be added as @dir I guess, otherwise the package won't own it.

@besser82
Copy link

One actually could use: %doc %exclude %{assistant_path}/doc/%{shortname}/LICENSE. That will make the file being picked-up by %license, but not by the (following) recursive glob of %doc %{assistant_path}/doc/%{shortname}/.


Example:

%files
%license %{_datadir}/%{name}/docs/LICENSE
%doc %{_datadir}/%{name}/docs
%doc %exclude  %{_datadir}/%{name}/docs/LICENSE

@tradej
Copy link
Member Author

tradej commented Feb 25, 2015

@besser82 If I remember correctly, I tried that, and using %exclude caused the file not to be picked up at all in the end.

@tradej
Copy link
Member Author

tradej commented Apr 14, 2015

Solved in 379e9fe

@tradej tradej closed this as completed Apr 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants