From crees@FreeBSD.org  Tue Dec 27 11:08:50 2011
Return-Path: <crees@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B9A54106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 27 Dec 2011 11:08:50 +0000 (UTC)
	(envelope-from crees@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 8DDC48FC14
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 27 Dec 2011 11:08:50 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pBRB8oUL088709
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 27 Dec 2011 11:08:50 GMT
	(envelope-from crees@freefall.freebsd.org)
Received: (from crees@localhost)
	by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pBRB8o9U088708;
	Tue, 27 Dec 2011 11:08:50 GMT
	(envelope-from crees)
Message-Id: <201112271108.pBRB8o9U088708@freefall.freebsd.org>
Date: Tue, 27 Dec 2011 11:08:50 GMT
From: Chris Rees <crees@freebsd.org>
Reply-To: Chris Rees <crees@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: bsd.licenses.mk: Add code to support standard licenses
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         163640
>Category:       ports
>Synopsis:       bsd.licenses.mk: Add code to support standard licenses
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    tabthorpe
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 27 11:10:13 UTC 2011
>Closed-Date:    Mon Feb 27 17:35:18 UTC 2012
>Last-Modified:  Mon Feb 27 17:40:06 UTC 2012
>Originator:     Chris Rees
>Release:        FreeBSD 8.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD freefall.freebsd.org 8.2-STABLE FreeBSD 8.2-STABLE #5 r227907: Wed Nov 23 21:55:50 UTC 2011 simon@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386


	
>Description:
	http://docs.freebsd.org/cgi/getmsg.cgi?fetch=374446+0+current/cvs-ports

	As described, LICENSE= 'some known license' leaves us with a dummy file in /usr/local/share/licenses/${PKGNAME} that suggests that we fetch the license ourselves from the Internet.

	This patch checks in _LICENSE_STORE for a matching license and uses that if it exists
>How-To-Repeat:
	
>Fix:

	Try it out by applying, and drop some licenses into ${PORTSDIR}/Templates/licenses with the same filename as the LICENSE variable.

--- licenses.patch begins here ---
? Templates/licenses
Index: Mk/bsd.licenses.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.licenses.mk,v
retrieving revision 1.8
diff -u -r1.8 bsd.licenses.mk
--- Mk/bsd.licenses.mk	31 Mar 2011 03:37:14 -0000	1.8
+++ Mk/bsd.licenses.mk	27 Dec 2011 11:03:29 -0000
@@ -141,6 +141,7 @@
 #
 # _LICENSE_DIR		- Directory to install licenses
 # _LICENSE_DIR_REL	- Same as above, without ${PREFIX}
+# _LICENSE_STORE	- Store for known license files
 # _LICENSE_CATALOG	- License catalog (make include file) to be created (dst)
 # _LICENSE_CATALOG_TMP	- Same as above, but in WRKDIR (src)
 # _LICENSE_REPORT	- License summary, shows licenses and how they are combined (dst)
@@ -151,6 +152,7 @@
 
 _LICENSE_DIR?=		${PREFIX}/share/licenses/${PKGNAME}
 _LICENSE_DIR_REL?=	share/licenses/${PKGNAME}
+_LICENSE_STORE?=	${PORTSDIR}/Templates/licenses
 _LICENSE_CATALOG?=	${_LICENSE_DIR}/catalog.mk
 _LICENSE_CATALOG_TMP?=	${WRKDIR}/.license-catalog.mk
 _LICENSE_REPORT?=	${_LICENSE_DIR}/LICENSE
@@ -228,9 +230,13 @@
 # Check for LICENSE_FILE or at least LICENSE_TEXT (which simulates it)
 .			if !defined(LICENSE_FILE)
 .				if !defined(LICENSE_TEXT)
-# XXX Until we have a license pool under /usr/ports/Licenses use this
+.					if exists(${_LICENSE_STORE}/${lic})
+_LICENSE_FILE=		${_LICENSE_STORE}/${lic}
+.					else
+# No license file in /usr/ports/Templates/licenses
 _LICENSE_TEXT=		The license: ${_LICENSE} (${_LICENSE_NAME}) is standard, please read from the web.
 _LICENSE_FILE=		${WRKDIR}/${lic}
+.					endif
 .				else
 _LICENSE_ERROR?=	defining LICENSE_TEXT is not allowed for known licenses
 .				endif
--- licenses.patch ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->tabthorpe 
Responsible-Changed-By: tabthorpe 
Responsible-Changed-When: Mon Jan 2 17:51:16 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163640 
State-Changed-From-To: open->closed 
State-Changed-By: tabthorpe 
State-Changed-When: Mon Feb 27 17:35:17 UTC 2012 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163640 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/163640: commit references a PR
Date: Mon, 27 Feb 2012 17:34:08 +0000 (UTC)

 tabthorpe    2012-02-27 17:33:55 UTC
 
   FreeBSD ports repository
 
   Modified files:
     Mk                   bsd.licenses.mk 
   Log:
   - Add code to support standard licenses [1]
   - Properly cleanup files in /tmp [2]
   - Bring back --hline [3]
   
   PR:             ports/163640 [1], ports/155890 [2], ports/164403 [3]
   Submitted by:   crees [1], Pan Tsu [2], Jan Beich [3]
   Exp run by:     pav
   
   Revision  Changes    Path
   1.10      +17 -7     ports/Mk/bsd.licenses.mk
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
