Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jan 2014 02:54:43 +0900
From:      KATO Tsuguru <tkato432@yahoo.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/185502: games/typespeed: Support CC properly
Message-ID:  <20140106025443.e88009673716c0b0cfcc1557@yahoo.com>
Resent-Message-ID: <201401051810.s05IA1wp084961@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         185502
>Category:       ports
>Synopsis:       games/typespeed: Support CC properly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 05 18:10:01 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     KATO Tsuguru
>Release:        FreeBSD 8.4-RELEASE-p4 i386
>Organization:
>Environment:
>Description:
- Support CC properly

>How-To-Repeat:
>Fix:

diff -urN /usr/ports/games/typespeed/Makefile games/typespeed/Makefile
--- /usr/ports/games/typespeed/Makefile	2013-11-06 22:01:09.000000000 +0900
+++ games/typespeed/Makefile	2014-01-06 00:00:00.000000000 +0900
@@ -3,63 +3,62 @@
 
 PORTNAME=	typespeed
 PORTVERSION=	0.6.5
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	games
 MASTER_SITES=	SF
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Test your typing speed and get your fingers\' CPS
 
-GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--with-highscoredir="/var/games/typespeed"
+OPTIONS_DEFINE=	NLS
+OPTIONS_SUB=	yes
 
-SCOREPREFIX?=	/var/games
-SCOREDIR=	${SCOREPREFIX}/typespeed
-SCOREFILE=	typespeed.score
+USES=		ncurses
+GNU_CONFIGURE=	yes
+CONFIGURE_ARGS=	--with-highscoredir="${SCOREDIR}"
 
 CFLAGS+=	-I${LOCALBASE}/include -DWITH_HIGHSCOREDIR=\"${SCOREDIR}\"  \
 		-DHIGHDIR=\"${SCOREDIR}\" -DHIGHSCOREDIR=\"${SCOREDIR}\"
 
 SUB_FILES=	pkg-install pkg-deinstall
-SUB_LIST=	SCOREDIR="${SCOREDIR}" SCOREFILE="${SCOREFILE}" WRKSRC="${WRKSRC}"
-MAN1=		typespeed.1
+SUB_LIST=	SCOREDIR="${SCOREDIR}" SCOREFILE="${SCOREFILE}"
 
-NO_STAGE=	yes
-.include <bsd.port.options.mk>
+NLS_USES=		gettext
+NLS_CONFIGURE_ENABLE=	nls
 
-.if ${PORT_OPTIONS:MNLS}
-USES+=		gettext
-PLIST_SUB+=	NLS=""
-.else
-CONFIGURE_ARGS+=	--disable-nls
-PLIST_SUB+=	NLS="@comment "
-.endif
+SCOREPREFIX?=	/var/games
+SCOREDIR=	${SCOREPREFIX}/typespeed
+SCOREFILE=	typespeed.score
+
+.include <bsd.port.options.mk>
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|\(/etc\)|${PREFIX}\1|' \
-		${WRKSRC}/src/pathnames.h
+	@${FIND} ${WRKSRC} -name "Makefile.in" | ${XARGS} ${REINPLACE_CMD} -e \
+		's|^\(CC =\).*|\1 @CC@|'
+	@${REINPLACE_CMD} -e \
+		's|\(/etc\)|${PREFIX}\1|' ${WRKSRC}/src/pathnames.h
 
 do-install:
-	${INSTALL_PROGRAM} -g games -m 2555 ${WRKSRC}/src/${PORTNAME} ${PREFIX}/bin
-	${INSTALL_PROGRAM} ${WRKSRC}/src/convert ${PREFIX}/bin/${PORTNAME}-hs-conv
-	${INSTALL_MAN} ${WRKSRC}/man/${PORTNAME}.6 ${MANPREFIX}/man/man1/${MAN1}
-	${INSTALL_DATA} ${WRKSRC}/etc/typespeedrc ${PREFIX}/etc/typespeedrc.dist
-.if !exists(${PREFIX}/etc/typespeedrc)
-	${INSTALL_DATA} ${WRKSRC}/etc/typespeedrc ${PREFIX}/etc
-.endif
-	${MKDIR} ${DATADIR}
-	${MKDIR} ${DATADIR}/words
-	${FIND} ${WRKSRC}/words/ -name "words.*" -type f \
-		-exec ${INSTALL_DATA} {} ${DATADIR}/words \;
+	(cd ${WRKSRC}/src && ${INSTALL_PROGRAM} ${PORTNAME} \
+		${STAGEDIR}${PREFIX}/bin)
+	(cd ${WRKSRC}/src && ${INSTALL_PROGRAM} convert \
+		${STAGEDIR}${PREFIX}/bin/${PORTNAME}-hs-conv)
+	(cd ${WRKSRC}/man && ${INSTALL_MAN} ${PORTNAME}.6 \
+		${STAGEDIR}${MAN6PREFIX}/man/man6)
+	(cd ${WRKSRC}/etc && ${INSTALL_DATA} typespeedrc \
+		${STAGEDIR}${PREFIX}/etc/typespeedrc.dist)
+	@${MKDIR} ${STAGEDIR}${DATADIR}
+	(cd ${WRKSRC}/src && ${INSTALL_DATA} ${SCOREFILE} \
+		${STAGEDIR}${DATADIR}/${SCOREFILE}.default)
+	@${MKDIR} ${STAGEDIR}${DATADIR}/words
+	(cd ${WRKSRC}/words && ${INSTALL_DATA} words.* \
+		${STAGEDIR}${DATADIR}/words)
 .if ${PORT_OPTIONS:MNLS}
 .for i in de_DE fr_FR it
-	${MKDIR} ${PREFIX}/share/locale/${i}/LC_MESSAGES
-	${INSTALL_DATA} ${WRKSRC}/po/${i}.gmo \
-		${PREFIX}/share/locale/${i}/LC_MESSAGES/typespeed.mo
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/locale/${i}/LC_MESSAGES
+	(cd ${WRKSRC}/po && ${INSTALL_DATA} ${i}.gmo \
+		${STAGEDIR}${PREFIX}/share/locale/${i}/LC_MESSAGES/typespeed.mo)
 .endfor
 .endif
 
-post-install:
-	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-
 .include <bsd.port.mk>
diff -urN /usr/ports/games/typespeed/files/pkg-install.in games/typespeed/files/pkg-install.in
--- /usr/ports/games/typespeed/files/pkg-install.in	2013-11-06 22:01:09.000000000 +0900
+++ games/typespeed/files/pkg-install.in	2014-01-06 00:00:00.000000000 +0900
@@ -4,7 +4,6 @@
 
 SCOREDIR="%%SCOREDIR%%"
 SCOREFILE="%%SCOREFILE%%"
-WRKSRC="%%WRKSRC%%"
 
 [ "$2" != "POST-INSTALL" ] && exit 0
 
@@ -13,7 +12,7 @@
 	chown root:games ${SCOREDIR}
 fi
 
-install -o root -g games -m 0464 ${WRKSRC}/src/${SCOREFILE} ${SCOREDIR}/${SCOREFILE}.default
+install -o root -g games -m 0464 ${PKG_PREFIX}/share/typespeed/${SCOREFILE}.default ${SCOREDIR}/${SCOREFILE}.default
 
 file="${SCOREDIR}/${SCOREFILE}"
 if [ -f "$file" ]; then
diff -urN /usr/ports/games/typespeed/pkg-plist games/typespeed/pkg-plist
--- /usr/ports/games/typespeed/pkg-plist	2013-11-06 22:01:09.000000000 +0900
+++ games/typespeed/pkg-plist	2014-01-06 00:00:00.000000000 +0900
@@ -1,11 +1,17 @@
+@group games
+@mode 2555
 bin/typespeed
+@mode
+@group
 bin/typespeed-hs-conv
 @unexec if cmp -s %D/etc/typespeedrc %D/etc/typespeedrc.dist; then rm -f %D/etc/typespeedrc; fi
 etc/typespeedrc.dist
 @exec [ -f %B/typespeedrc ] || cp %B/%f %B/typespeedrc
+man/man6/typespeed.6.gz
 %%NLS%%share/locale/de_DE/LC_MESSAGES/typespeed.mo
 %%NLS%%share/locale/fr_FR/LC_MESSAGES/typespeed.mo
 %%NLS%%share/locale/it/LC_MESSAGES/typespeed.mo
+%%DATADIR%%/typespeed.score.default
 %%DATADIR%%/words/words.csharp
 %%DATADIR%%/words/words.csharp_with_operators
 %%DATADIR%%/words/words.dos
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140106025443.e88009673716c0b0cfcc1557>