From jylefort@brutele.be  Tue Oct 14 07:29:31 2003
Return-Path: <jylefort@brutele.be>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 459E916A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 14 Oct 2003 07:29:31 -0700 (PDT)
Received: from gateway.lefort.net (213.189.162.78.brutele.be [213.189.162.78])
	by mx1.FreeBSD.org (Postfix) with ESMTP id DCECA43FDD
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 14 Oct 2003 07:29:29 -0700 (PDT)
	(envelope-from jylefort@brutele.be)
Received: from jsite.lefort.net (jsite.lefort.net [192.168.1.2])
	by gateway.lefort.net (Postfix) with ESMTP id 3083A54D9
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 14 Oct 2003 16:29:28 +0200 (CEST)
Received: by jsite.lefort.net (Postfix, from userid 1000)
	id DF6D422E1F; Tue, 14 Oct 2003 16:29:27 +0200 (CEST)
Message-Id: <20031014142927.DF6D422E1F@jsite.lefort.net>
Date: Tue, 14 Oct 2003 16:29:27 +0200 (CEST)
From: Jean-Yves Lefort <jylefort@brutele.be>
Reply-To: Jean-Yves Lefort <jylefort@brutele.be>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Formalization of WITH_/WITHOUT_ Makefile variables
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         58011
>Category:       ports
>Synopsis:       Formalization of WITH_/WITHOUT_ Makefile variables
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 14 07:30:21 PDT 2003
>Closed-Date:    Tue Jan 20 11:27:17 PST 2004
>Last-Modified:  Tue Jan 20 11:27:17 PST 2004
>Originator:     Jean-Yves Lefort
>Release:        FreeBSD 4.8-RELEASE-p3 i386
>Organization:
>Environment:
System: FreeBSD jsite.lefort.net 4.8-RELEASE-p3 FreeBSD 4.8-RELEASE-p3 #0: Mon Aug 11 18:17:27 CEST 2003 jylefort@jsite.lefort.net:/usr/obj/usr/src/sys/JSITE i386
	
>Description:
Knowing which make variables can be set for a specific port is
cumbersome: the user has to mentally parse the Makefile.

The proposed patch formalizes the handling of make variables. A new
target, describe-options, generates a human- and computer-readable
options list.
	
>How-To-Repeat:
	
>Fix:
In the Makefile of port foo:

OPTIONS=			WITHOUT_MBOX \
				WITHOUT_MH \
				WITHOUT_MAILDIR \
				WITHOUT_POP3 \
				WITHOUT_SYLPHEED

OPTION_WITHOUT_MBOX=		Disable mbox support
OPTION_WITHOUT_MH=		Disable MH support
OPTION_WITHOUT_MAILDIR=		Disable Maildir support
OPTION_WITHOUT_POP3=		Disable POP3 support
OPTION_WITHOUT_SYLPHEED=	Disable Sylpheed support

And the bsd.port.mk patch:

--- bsd.port.mk.orig	Tue Oct 14 16:05:47 2003
+++ bsd.port.mk	Tue Oct 14 16:20:31 2003
@@ -603,6 +603,7 @@
 # package		- Create a package from an _installed_ port.
 # describe		- Try to generate a one-line description for each port for
 #				  use in INDEX files and the like.
+# describe-options - Print a list of options for this port
 # checkpatch	- Do a "patch -C" instead of a "patch".  Note that it may
 #				  give incorrect results if multiple patches deal with
 #				  the same file.
@@ -4450,6 +4451,20 @@
 	fi
 .else
 	@${DO_NADA}
+.endif
+.endif
+
+.if !target(describe-options)
+describe-options:
+.if defined(OPTIONS)
+	@${ECHO} "Port options:"
+.for option in ${OPTIONS}
+	@${ECHO} ""
+	@${ECHO} "Option:       ${option}"
+	@${ECHO} "Description:  ${OPTION_${option}}"
+.endfor
+.else
+	@${ECHO} "This port has no option."
 .endif
 .endif

	
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr  
Responsible-Changed-By: krion 
Responsible-Changed-When: Tue Oct 14 07:38:49 PDT 2003 
Responsible-Changed-Why:  
Portmgr territory 

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

From: Sergey Matveychuk <sem@ciam.ru>
To: freebsd-gnats-submit@FreeBSD.org, jylefort@brutele.be
Cc:  
Subject: Re: ports/58011: Formalization of WITH_/WITHOUT_ Makefile variables
Date: Sun, 19 Oct 2003 02:00:16 +0400

 Good point!
 I suggest add it in build stage. May be just after pre-everything?
 
 -- 
 Sem.
 
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Tue Jan 20 11:26:57 PST 2004 
State-Changed-Why:  
We went with the OPTIONS solution instead.  Thanks for the submission. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58011 
>Unformatted:
