Page MenuHomeFreeBSD

Add LICENSE_FILE support for single license file containing multiple licenses
ClosedPublic

Authored by sunpoet on Jul 2 2017, 6:55 AM.

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
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10244
Build 10662: arc lint + arc unit

Event Timeline

sunpoet created this revision.Jul 2 2017, 6:55 AM
Herald added 1 blocking reviewer(s): portmgr. · View Herald TranscriptJul 2 2017, 6:55 AM
Herald added a subscriber: mat. · View Herald Transcript
AMDmi3 edited edge metadata.Jul 27 2017, 4:25 PM

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!

mat accepted this revision as: portmgr.Oct 6 2017, 2:59 PM

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.