Page MenuHomeFreeBSD

bsd.licenses.mk: install multi-license with their filename
Needs ReviewPublic

Authored by bz on Fri, Nov 1, 2:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 7:09 AM
Unknown Object (File)
Thu, Nov 14, 6:13 AM
Unknown Object (File)
Tue, Nov 5, 1:26 PM
Unknown Object (File)
Tue, Nov 5, 4:01 AM

Details

Reviewers
None
Group Reviewers
portmgr
Summary

Currently in case of multiple license files they are installed
with their defined abbreviated name.
While that is fine for wellknown license names for "unknown"
once with a file name like License.vendor that is often not
the case.

Try to install the licenses by their actual file name and let the
user define a LICENSE_FILENAME_${lic} to override that if needed.
The latter is helpful in case the multiple licenses are all
called the same but reside in different directories like
foo/License and bar/License.

We try to detect duplicate file names and in that case barf.

While here add a simple target helpful for testing and checking
called list-license.

Sponsored by: The FreeBSD Foundation (partially, tested with wifi-fw)

Test Plan

I did some manual prelim testing but I am not a ports person.
The wifi-firmware ports/flavors like wifi-firmware-ath10k-kmod
is a very good example for the problem (I assume it is because
one or the other way the framework was never flexible enough).

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 60320
Build 57204: arc lint + arc unit

Event Timeline

bz requested review of this revision.Fri, Nov 1, 2:36 AM
bz created this revision.
mat added inline comments.
Mk/bsd.licenses.mk
92
92
bz marked 2 inline comments as done.

Corrrect speelling as pointed out by @mat.

This looks sound.
I have only run it in my head though.

Have you checked if there are ports where this now gives an error?

Looking at the spaghetti in Mk, I cannot see if there is some target we can run from the root directory that would run check-license in every port.
But it's probably just adding that target in the targets in bsd.ports.subdir.mk to run the test.

In D47380#1083399, @mat wrote:

This looks sound.
I have only run it in my head though.

Have you checked if there are ports where this now gives an error?

No.

Looking at the spaghetti in Mk, I cannot see if there is some target we can run from the root directory that would run check-license in every port.
But it's probably just adding that target in the targets in bsd.ports.subdir.mk to run the test.

Yes, seems to work and catch cases.

I'll work through them. @mat. Should I add the changes here to the same review or open a separate review for them?

  • deal with dual-license, single license file (used archivers/p5-Archive-Any as sample as it was the first hit)
  • detect collisions with well-known names "lICENSE" and "catalog.mk" (more likely the formware is common) and work around them automatically (if the ports maintainer hasn't done manually)
  • make sure PLIST is correct with that

ran the subdir make check-license over the tree; will start anpther one over night but given only plist details were fixed should be fine

In D47380#1083512, @bz wrote:
In D47380#1083399, @mat wrote:

Looking at the spaghetti in Mk, I cannot see if there is some target we can run from the root directory that would run check-license in every port.
But it's probably just adding that target in the targets in bsd.ports.subdir.mk to run the test.

Yes, seems to work and catch cases.

I'll work through them. @mat. Should I add the changes here to the same review or open a separate review for them?

Yes, please, add everything here, it makes it easier to review everything.

With this a recursive check-license passed to the end.

I am not sure if this concept was ever thought of when this framework was introduced (also that installing and checking are coupled in the same piece of logic).

Someone will probably have to go and see about the installed license files for more than my sample of ports and if they are fine with the (new) names.