Page MenuHomeFreeBSD

Add LICENSE_FILE support for single license file containing multiple licenses
ClosedPublic

Authored by sunpoet on Jul 2 2017, 6:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 3:10 AM
Unknown Object (File)
Dec 15 2023, 3:01 AM
Unknown Object (File)
Dec 1 2023, 1:02 AM
Unknown Object (File)
Nov 18 2023, 3:46 PM
Unknown Object (File)
Nov 18 2023, 3:46 PM
Unknown Object (File)
Nov 18 2023, 3:46 PM
Unknown Object (File)
Nov 18 2023, 3:35 PM
Unknown Object (File)
Sep 25 2023, 6:36 AM
Subscribers

Details

Summary

Current bsd.licenses.mk does not use LICENSE_FILE if more than one licnese is defined in LICENSE.

This patch adds support to simplify

LICENSE_FILE_foo= ${WRKSRC}/LICENSE
LICENSE_FILE_bar= ${WRKSRC}/LICENSE

to

LICENSE_FILE= ${WRKSRC}/LICENSE

Test Plan

Choose a port with dual/multi licenses.

I've added LICENSE_FILE to devel/p5-ExtUtils-Config.
LICENSE= ART10 GPLv1
LICENSE_COMB= dual
LICENSE_FILE= ${WRKSRC}/LICENSE

Before:
% ls -l /usr/local/share/licenses/p5-ExtUtils-Config-0.008_1/
total 1
-rw-r--r-- 1 sunpoet wheel 5985 Jul 2 14:40 ART10
-rw-r--r-- 1 sunpoet wheel 599 Jul 2 14:40 catalog.mk
-rw-r--r-- 1 sunpoet wheel 12628 Jul 2 14:40 GPLv1
-rw-r--r-- 1 sunpoet wheel 127 Jul 2 14:40 LICENSE
% diff /usr/local/share/licenses/p5-ExtUtils-Config-0.008_1/ART10 /usr/ports/Templates/Licenses/ART10
% diff /usr/local/share/licenses/p5-ExtUtils-Config-0.008_1/GPLv1 /usr/ports/Templates/Licenses/GPLv1

After:
% ls -l /usr/local/share/licenses/p5-ExtUtils-Config-0.008_1/
total 1
-rw-r--r-- 1 sunpoet wheel 18400 Jul 2 14:53 ART10
-rw-r--r-- 1 sunpoet wheel 599 Jul 2 14:53 catalog.mk
-rw-r--r-- 1 sunpoet wheel 18400 Jul 2 14:53 GPLv1
-rw-r--r-- 1 sunpoet wheel 127 Jul 2 14:53 LICENSE

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

As far as I remember, mat@ or bdrewery@ have submitted something very similar.

I found D8171.

Both patch provide almost the same function except one rare case as follows:

LICENSE=APACHE20 GPLv2 LGPL20 LGPL21
LICENSE_COMB=dual
LICENSE_FILE_APACHE20=${WRKSRC}/LICENSE.APACHE20
LICENSE_FILE_GPLv2=${WRKSRC}/LICENSE
LICENSE_FILE_LGPL20=${WRKSRC}/LICENSE
LICENSE_FILE_LGPL21=${WRKSRC}/LICENSE

With D11443, LICENSE_{GPLv2,LGPL20,LGPL21} could be simplify to LICENSE_FILE which D8171 disallowed.

LICENSE=APACHE20 GPLv2 LGPL20 LGPL21
LICENSE_COMB=dual
LICENSE_FILE_APACHE20=${WRKSRC}/LICENSE.APACHE20
LICENSE_FILE=${WRKSRC}/LICENSE

But I cannot remember any real case like this.

Therefore, I would suggest either D8171 or D11443 to be committed ASAP.
Thanks!

I wonder if there are ports that will break with that. (Because of a LICENSE_FILE varialbe that was not used but was pointing to a non existing file.)

This revision was automatically updated to reflect the committed changes.