From sheldonh@axl.noc.iafrica.com Thu Aug 26 09:32:25 1999
Return-Path: <sheldonh@axl.noc.iafrica.com>
Received: from axl.noc.iafrica.com (axl.noc.iafrica.com [196.31.1.175])
	by hub.freebsd.org (Postfix) with ESMTP id 0BC9014DCB
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Aug 1999 09:32:20 -0700 (PDT)
	(envelope-from sheldonh@axl.noc.iafrica.com)
Received: from sheldonh (helo=axl.noc.iafrica.com)
	by axl.noc.iafrica.com with local-esmtp (Exim 3.02 #1)
	id 11K2Q1-000CV8-00
	for FreeBSD-gnats-submit@freebsd.org; Thu, 26 Aug 1999 18:30:29 +0200
Message-Id: <48057.935685029@axl.noc.iafrica.com>
Date: Thu, 26 Aug 1999 18:30:29 +0200
From: Sheldon Hearn <sheldonh@uunet.co.za>
Sender: Sheldon Hearn <sheldonh@axl.noc.iafrica.com>
Reply-To: Sheldon Hearn <sheldonh@uunet.co.za>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Add WHICH_GAMES variable to src/Makefile.inc1
X-Send-Pr-Version: 3.2

>Number:         13398
>Category:       misc
>Synopsis:       Add WHICH_GAMES variable to src/Makefile.inc1
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    sheldonh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 26 09:40:01 PDT 1999
>Closed-Date:    Fri Dec 3 06:33:12 PST 1999
>Last-Modified:  Fri Dec  3 06:34:42 PST 1999
>Originator:     Sheldon Hearn
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
UUNET South Africa
>Environment:

	FreeBSD 4.0-CURRENT

>Description:

	Every time people start bitching about what games should and
	shouldn't be distributed with FreeBSD, I smile. I've always just
	hacked up my src/games/Makefile and trimmed SUBDIR down to only
	those games I consider useful.

	This, however, is not elegant. Yet it's the best we can do at
	the moment.

>How-To-Repeat:

	N/A

>Fix:

	What I propose is the addition of two definitions which will
	allow release engineers and obsessive world builders more
	flexibility in the selection of games to install.

	Both of these flags are completely ignored if NOGAMES is
	defined:

	WHICH_GAMES	A list of desired games
	SOMEGAMES	If WHICH_GAMES is not defined, populate
			WHICH_GAMES with a limited selection of games.

	Diffs follow. I'm pushing this through a few buildworlds with
	various combinations of WHICH_GAMES, SOMEGAMES and NOGAMES now
	and intend to commit this if all goes well and there are no
	objections.

Index: Makefile.inc1
===================================================================
RCS file: /home/ncvs/src/Makefile.inc1,v
retrieving revision 1.81
diff -u -d -r1.81 Makefile.inc1
--- Makefile.inc1	1999/08/08 22:26:09	1.81
+++ Makefile.inc1	1999/08/26 15:39:48
@@ -10,12 +10,14 @@
 #	-DNOCRYPT will prevent building of crypt versions
 #	-DNOPROFILE do not build profiled libraries
 #	-DNOSECURE do not go into secure subdir
+#	-DSOMEGAMES install a limited subset (or ${WHICH_GAMES}) of the games
 #	-DNOGAMES do not go into games subdir
 #	-DNOSHARE do not go into share subdir
 #	-DNOINFO do not make or install info files
 #	-DNOLIBC_R do not build libc_r.
 #	-DNO_FORTRAN do not build g77 and related libraries.
 #	LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
+#	WHICH_GAMES="list of games" to build unless NOGAMES is defined.
 
 #
 # The intended user-driven targets are:
@@ -54,6 +56,24 @@
 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
 SUBDIR+= games
 .endif
+.if !defined(NOGAMES) && defined(WHICH_GAMES)
+SOMEGAMES=	true
+.endif
+.if exists(${.CURDIR}/games) && !defined(NOGAMES) && defined(SOMEGAMES)
+WHICH_GAMES?=	bcd \
+		caesar \
+		dm \
+		factor \
+		fortune \
+		grdc \
+		morse \
+		number \
+		pig \
+		pom \
+		ppt \
+		primes \
+		random
+.endif
 .if exists(${.CURDIR}/gnu)
 SUBDIR+= gnu
 .endif
@@ -426,7 +446,7 @@
 	@echo "--------------------------------------------------------------"
 	@echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
 	@echo "--------------------------------------------------------------"
-	cd ${.CURDIR}; cvs -q update -P -d
+	cd ${.CURDIR}; cvs -q update -P -d -A
 .endif
 
 #
@@ -764,12 +784,22 @@
 # Exclude unused tools from build-tools.
 #
 .if !defined(NOGAMES) && exists(${.CURDIR}/games)
+.if !empty(WHICH_GAMES:Madventure)
 _adventure=	games/adventure
+.endif
+.if !empty(WHICH_GAMES:Mcaesar)
 _caesar=	games/caesar
+.endif
+.if !empty(WHICH_GAMES:Mhack)
 _hack=		games/hack
+.endif
+.if !empty(WHICH_GAMES:Mphantasia)
 _phantasia=	games/phantasia
+.endif
+.if !empty(WHICH_GAMES:Mfortune)
 _strfile=	games/fortune/strfile
 .endif
+.endif
 .if !defined(NOPERL)
 _perl=		gnu/usr.bin/perl/miniperl
 .endif
@@ -871,7 +901,13 @@
 		${MAKE} ${BTMAKEFLAGS} -B install ${CLEANDIR} ${OBJDIR}
 .endfor
 .if !defined(NOGAMES) && exists(${.CURDIR}/games)
-	cd ${DESTDIR}/usr/games; cp -p caesar strfile ${DESTDIR}/usr/bin
+	cd ${DESTDIR}/usr/games
+.if !empty(WHICH_GAMES:Mcaesar)
+	cp -p caesar ${DESTDIR}/usr/bin
+.endif
+.if !empty(WHICH_GAMES:Mfortune)
+	cp -p strfile ${DESTDIR}/usr/bin
+.endif
 .endif
 .for d in				\
 		bin/sh			\
Index: games/Makefile
===================================================================
RCS file: /home/ncvs/src/games/Makefile,v
retrieving revision 1.15
diff -u -d -r1.15 Makefile
--- Makefile	1998/08/30 20:58:16	1.15
+++ Makefile	1999/08/26 14:57:52
@@ -2,6 +2,9 @@
 #	$Id: Makefile,v 1.15 1998/08/30 20:58:16 gpalmer Exp $
 
 # XXX missing: chess ching monop [copyright]
+.if defined(WHICH_GAMES)
+SUBDIR=	${WHICH_GAMES}
+.else
 SUBDIR= adventure \
 	arithmetic \
 	atc \
@@ -41,5 +44,6 @@
 	worm \
 	worms \
 	wump
+.endif
 
 .include <bsd.subdir.mk>

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->freebsd-bugs 
Responsible-Changed-By: cpiazza 
Responsible-Changed-When: Thu Aug 26 20:40:07 PDT 1999 
Responsible-Changed-Why:  
Misfiled PR 

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: misc/13398: Add WHICH_GAMES variable to src/Makefile.inc1
Date: Mon, 30 Aug 1999 11:11:14 +0200

 I have a new proposed diff, including 3 changes from the original:
 
 1) SOMEGAMES upset some people and I've been made to see that it isn't
    necessary.
 
 2) A local hack for cvs slipped into my diff.
 
 3) I buggered the special-case handling for strfile and fortune.
 
 I'll commit this in a few days if I don't get any more suggestions.
 
 Ciao,
 Sheldon.
 
 Index: Makefile.inc1
 ===================================================================
 RCS file: /home/ncvs/src/Makefile.inc1,v
 retrieving revision 1.83
 diff -u -d -r1.83 Makefile.inc1
 --- Makefile.inc1	1999/08/30 08:33:15	1.83
 +++ Makefile.inc1	1999/08/30 09:06:45
 @@ -16,6 +16,7 @@
  #	-DNOLIBC_R do not build libc_r.
  #	-DNO_FORTRAN do not build g77 and related libraries.
  #	LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
 +#	WHICH_GAMES="list of games" to build unless NOGAMES is defined.
  
  #
  # The intended user-driven targets are:
 @@ -756,12 +757,22 @@
  # Exclude unused tools from build-tools.
  #
  .if !defined(NOGAMES) && exists(${.CURDIR}/games)
 +.if defined(WHICH_GAMES) && !empty(WHICH_GAMES:Madventure)
  _adventure=	games/adventure
 +.endif
 +.if defined(WHICH_GAMES) && !empty(WHICH_GAMES:Mcaesar)
  _caesar=	games/caesar
 +.endif
 +.if defined(WHICH_GAMES) && !empty(WHICH_GAMES:Mhack)
  _hack=		games/hack
 +.endif
 +.if defined(WHICH_GAMES) && !empty(WHICH_GAMES:Mphantasia)
  _phantasia=	games/phantasia
 +.endif
 +.if defined(WHICH_GAMES) && !empty(WHICH_GAMES:Mfortune)
  _strfile=	games/fortune/strfile
  .endif
 +.endif
  .if !defined(NOPERL)
  _perl=		gnu/usr.bin/perl/miniperl
  .endif
 @@ -863,7 +874,12 @@
  		${MAKE} ${BTMAKEFLAGS} -B install ${CLEANDIR} ${OBJDIR}
  .endfor
  .if !defined(NOGAMES) && exists(${.CURDIR}/games)
 -	cd ${DESTDIR}/usr/games; cp -p caesar strfile ${DESTDIR}/usr/bin
 +.if defined(WHICH_GAMES && !empty(WHICH_GAMES:Mcaesar)
 +	cd ${DESTDIR}/usr/games && cp -p caesar ${DESTDIR}/usr/bin
 +.endif
 +.if defined(WHICH_GAMES && !empty(WHICH_GAMES:Mfortune)
 +	cd ${DESTDIR}/usr/games && cp -p strfile ${DESTDIR}/usr/bin
 +.endif
  .endif
  .for d in				\
  		bin/sh			\
 Index: games/Makefile
 ===================================================================
 RCS file: /home/ncvs/src/games/Makefile,v
 retrieving revision 1.16
 diff -u -d -r1.16 Makefile
 --- Makefile	1999/08/27 23:28:45	1.16
 +++ Makefile	1999/08/30 09:06:45
 @@ -2,6 +2,9 @@
  # $FreeBSD: src/games/Makefile,v 1.16 1999/08/27 23:28:45 peter Exp $
  
  # XXX missing: chess ching monop [copyright]
 +.if defined(WHICH_GAMES)
 +SUBDIR=	${WHICH_GAMES}
 +.else
  SUBDIR= adventure \
  	arithmetic \
  	atc \
 @@ -41,5 +44,6 @@
  	worm \
  	worms \
  	wump
 +.endif
  
  .include <bsd.subdir.mk>
 
Responsible-Changed-From-To: freebsd-bugs->sheldonh 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Fri Oct 1 05:28:36 PDT 1999 
Responsible-Changed-Why:  
I've been using WHICH_GAMES quite happily for a while now. I'll commit 
next week unless someone pisses on my parade over the week-end. ;-) 
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Fri Dec 3 06:33:12 PST 1999 
State-Changed-Why:  
Bruce Evans complained about non-optimal handling of build tools. 
Since I couldn't figure out what he was talking about, I've kinda 
lost interest.  Bit of a silly idea anyways. :-) 
>Unformatted:
