From alepulver@FreeBSD.org  Mon Sep 11 19:44:21 2006
Return-Path: <alepulver@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E70F416A415
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 11 Sep 2006 19:44:20 +0000 (UTC)
	(envelope-from alepulver@FreeBSD.org)
Received: from relay00.pair.com (relay00.pair.com [209.68.5.9])
	by mx1.FreeBSD.org (Postfix) with SMTP id 80CDE43D49
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 11 Sep 2006 19:44:20 +0000 (GMT)
	(envelope-from alepulver@FreeBSD.org)
Received: (qmail 72996 invoked from network); 11 Sep 2006 19:44:18 -0000
Received: from unknown (HELO phobos.mars.bsd) (unknown)
  by unknown with SMTP; 11 Sep 2006 19:44:18 -0000
Message-Id: <1158003843.22530@phobos.mars.bsd>
Date: Mon, 11 Sep 2006 16:44:03 -0300
From: "Alejandro Pulver" <alepulver@FreeBSD.org>
To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@freebsd.org>
Subject: [UPDATE] games/doomlegacy: improve wrapper script
X-Send-Pr-Version: gtk-send-pr 0.4.7 
X-GNATS-Notify: bock@bock.nnov.ru

>Number:         103156
>Category:       ports
>Synopsis:       [UPDATE] games/doomlegacy: improve wrapper script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    alepulver
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 11 19:50:22 GMT 2006
>Closed-Date:    Mon Sep 18 19:58:52 GMT 2006
>Last-Modified:  Mon Sep 18 20:00:43 GMT 2006
>Originator:     Alejandro Pulver
>Release:        FreeBSD 6.1-RELEASE-p1 i386
>Organization:
>Environment:


System: FreeBSD 6.1-RELEASE-p1 #3: Mon Jun 19 14:49:35 ART 2006
    root@phobos.mars.bsd:/usr/obj/usr/src/sys/ATHLON-PHOBOS



>Description:


- Bump PORTREVISION.
- Install wrapper script as PORTNAME (easier to find for users).
- Do not use /usr/local, /usr/X11R6, /usr/local/include/SDL11 and -lSDL-1.1 directly. Use variables/command output instead.
- Improve wrapper script: only create ~/.legacy once, do not symlink WAD files since it looks in DOOMWADDIR (environment variable).
- Remove ONLY_FOR_ARCHS=i386 (builds at least on amd64).


>How-To-Repeat:





>Fix:


--- doomlegacy.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/games/doomlegacy/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile	17 Nov 2005 11:51:50 -0000	1.10
+++ Makefile	11 Sep 2006 19:43:38 -0000
@@ -6,10 +6,9 @@
 
 PORTNAME=	doomlegacy
 PORTVERSION=	142
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	games
-MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
-MASTER_SITE_SUBDIR=	${PORTNAME}
+MASTER_SITES=	SF
 DISTNAME=	legacy_${PORTVERSION}_src
 DISTFILES=	${DISTNAME}${EXTRACT_SUFX} ${WADFILE}
 EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}
@@ -19,8 +18,6 @@
 
 EXTRACT_DEPENDS=unzip:${PORTSDIR}/archivers/unzip
 
-ONLY_FOR_ARCHS=	i386
-
 USE_GL=		yes
 USE_GMAKE=	yes
 USE_SDL=	mixer sdl
@@ -40,6 +37,14 @@
 post-extract:
 	${UNZIP_CMD} -q ${DISTDIR}/${WADFILE} -d ${WRKDIR}/bin
 
+post-patch:
+	@${REINPLACE_CMD} -e \
+		's|-I/usr/local/include/SDL11|`${SDL_CONFIG} --cflags`|; \
+		 s|-lSDL-1\.1|`${SDL_CONFIG} --libs`|; \
+		 s|/usr/local|${LOCALBASE}|; \
+		 s|/usr/X11R6|${X11BASE}|' \
+		 ${WRKSRC}/${MAKEFILE}
+
 pre-build:
 	cd ${WRKSRC}/linux_x/sndserv && ${GMAKE} clean
 
@@ -53,7 +58,7 @@
 	${INSTALL} -c -s -o root -g kmem -m 2555 ${WRKDIR}/bin/lsdldoom \
 		${DATADIR}
 	${INSTALL_DATA} ${WRKDIR}/bin/legacy.dat ${DATADIR}
-	${INSTALL_SCRIPT} ${WRKDIR}/legacy ${PREFIX}/bin
+	${INSTALL_SCRIPT} ${WRKDIR}/legacy ${PREFIX}/bin/${PORTNAME}
 
 post-install:
 .ifndef(NOPORTDOCS)
@@ -67,7 +72,7 @@
 
 .include <bsd.port.pre.mk>
 
-.if defined(WITH_X86_ASM)
+.if defined(WITH_X86_ASM) && ${ARCH} == "i386"
 BUILD_DEPENDS+=	nasm:${PORTSDIR}/devel/nasm
 MAKE_ARGS+=	USEASM=1
 .endif
Index: pkg-plist
===================================================================
RCS file: /home/pcvs/ports/games/doomlegacy/pkg-plist,v
retrieving revision 1.5
diff -u -r1.5 pkg-plist
--- pkg-plist	17 Nov 2005 11:51:50 -0000	1.5
+++ pkg-plist	11 Sep 2006 19:43:38 -0000
@@ -1,4 +1,4 @@
-bin/legacy
+bin/doomlegacy
 %%DATADIR%%/legacy.dat
 %%DATADIR%%/llsndserv
 %%DATADIR%%/lsdldoom
Index: files/legacy.in
===================================================================
RCS file: /home/pcvs/ports/games/doomlegacy/files/legacy.in,v
retrieving revision 1.1
diff -u -r1.1 legacy.in
--- files/legacy.in	17 Nov 2005 11:51:51 -0000	1.1
+++ files/legacy.in	11 Sep 2006 19:43:38 -0000
@@ -1,20 +1,20 @@
 #!/bin/sh
 
 # The executable needs to run from a directory with the Doom Legacy data
-# files, libraries and executables, and Doom WAD files. So we mirror the Doom
-# Legacy and Doom (WAD files) data directory to ~/.legacy, and create symlinks
-# to the data files.
+# files, libraries and executables. So we mirror the Doom Legacy data
+# directory to ~/.legacy, and create symlinks to the data files.
 
-cd %%DATADIR%% || exit 1
+DOOMWADDIR="%%DMDIR%%"; export DOOMWADDIR
 
-mkdir -p ~/.legacy
-find * -type f -exec ln -sf %%DATADIR%%/{} ~/.legacy/{} \; || exit 1
-
-cd %%DMDIR%% || exit 1
-
-find * -type d -exec mkdir -p ~/.legacy/{} \; || exit 1
-find * -type f -exec ln -sf %%DMDIR%%/{} ~/.legacy/{} \; || exit 1
+if [ -d ~/.legacy ]
+then
+	echo "Using existing ~/.legacy directory."
+else
+	echo "Creating ~/.legacy directory."
+	cd %%DATADIR%% || exit 1
+	find * -type d -exec mkdir -p ~/.legacy/{} \;
+	find * -type f -exec ln -sf %%DATADIR%%/{} ~/.legacy/{} \;
+fi
 
 cd ~/.legacy || exit 1
-
-exec ./lsdldoom -nocheckwadversion $*
+exec ./lsdldoom -nocheckwadversion "$@"
--- doomlegacy.diff ends here ---



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->alepulver 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Sep 11 19:50:52 UTC 2006 
Responsible-Changed-Why:  
Submitter has GNATS access 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103156 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Mon Sep 11 19:50:58 UTC 2006 
State-Changed-Why:  
Awaiting maintainers feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103156 
State-Changed-From-To: feedback->closed 
State-Changed-By: alepulver 
State-Changed-When: Mon Sep 18 19:50:45 UTC 2006 
State-Changed-Why:  
Committed with a few modifications. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/103156: commit references a PR
Date: Mon, 18 Sep 2006 19:58:32 +0000 (UTC)

 alepulver    2006-09-18 19:58:07 UTC
 
   FreeBSD ports repository
 
   Modified files:
     games/doomlegacy     Makefile pkg-plist 
     games/doomlegacy/files legacy.in 
   Log:
   - Bump PORTREVISION.
   - Install wrapper script as PORTNAME (easier to find for users).
   - Rename directory from ~/.legacy to ~/.doomlegacy.
   - Do not use /usr/local, /usr/X11R6, /usr/local/include/SDL11 and -lSDL-1.1
     directly. Use variables/command output instead.
   - Improve wrapper script: only create ~/.doomlegacy once, do not symlink WAD
     files since it looks in DOOMWADDIR (environment variable).
   - Remove ONLY_FOR_ARCHS=i386 (builds at least on amd64).
   
   PR:             ports/103156
   Approved by:    maintainer (timeout)
   
   Revision  Changes    Path
   1.11      +12 -7     ports/games/doomlegacy/Makefile
   1.2       +14 -14    ports/games/doomlegacy/files/legacy.in
   1.6       +1 -1      ports/games/doomlegacy/pkg-plist
 _______________________________________________
 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:
