Bug 172679 - [PATCH] games/pyawale: Makefile clearly, simplified, OptionsNG, take maintainership
Summary: [PATCH] games/pyawale: Makefile clearly, simplified, OptionsNG, take maintain...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Marcus von Appen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-14 00:30 UTC by nemysis
Modified: 2012-12-24 09:30 UTC (History)
0 users

See Also:


Attachments
pyawale-0.4.0_3.patch (9.09 KB, patch)
2012-10-14 00:30 UTC, nemysis
no flags Details | Diff
pyawale.diff (12.02 KB, patch)
2012-12-22 20:04 UTC, nemysis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nemysis 2012-10-14 00:30:00 UTC
- Take maintainership

Added file(s):
- files/pyawale.in

Removed file(s):
- pkg-plist

Makefile clearly, simplified:

+CATEGORIES=	games python

+RUN_DEPENDS=	${PYGAME}

+.include <bsd.port.options.mk>

Install into ${DATADIR})
+	@(cd ${WRKSRC}/src && ${COPYTREE_SHARE} \* ${DATADIR})

All moved from pkg-plist to Makefile

+./files/pyawale.in

Generated and tested manually, tested with port test and with RedPorts (all RELEASES, CLANG), sent with FreeBSD Port Tools 0.99_6 (mode: change, diff: ports)

How-To-Repeat: 
portlint -A
WARN: Makefile: for new port, make $FreeBSD$ tag in comment section empty, to make SVN happy.
WARN: Makefile: new ports should not set PORTREVISION.
WARN: Makefile: only one MASTER_SITE configured.  Consider adding additional mirrors.
0 fatal errors and 3 warnings found.

port test: clean


Build log

https://redports.org/buildarchive/20121013194142-16605/
Comment 1 Marcus von Appen freebsd_committer freebsd_triage 2012-12-22 13:17:30 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mva

I'll take it.
Comment 2 nemysis 2012-12-22 20:04:13 UTC
Added again pkg-plist this is better, because user can set no PORTDATA.
Comment 3 dfilter service freebsd_committer freebsd_triage 2012-12-24 09:28:27 UTC
Author: mva
Date: Mon Dec 24 09:28:10 2012
New Revision: 309452
URL: http://svnweb.freebsd.org/changeset/ports/309452

Log:
  - Convert to OptionsNG framework
  - Trim Makefile headers
  - Pass maintainership to submitter
  
  PR:		ports/172679
  Submitted by:	nemysis <nemysis@gmx.ch>

Added:
  head/games/pyawale/files/
  head/games/pyawale/files/pyawale.in   (contents, props changed)
Deleted:
  head/games/pyawale/pkg-plist
Modified:
  head/games/pyawale/Makefile   (contents, props changed)
  head/games/pyawale/pkg-descr   (contents, props changed)

Modified: head/games/pyawale/Makefile
==============================================================================
--- head/games/pyawale/Makefile	Mon Dec 24 05:24:44 2012	(r309451)
+++ head/games/pyawale/Makefile	Mon Dec 24 09:28:10 2012	(r309452)
@@ -1,53 +1,60 @@
-# New ports collection makefile for:	pyawale
-# Date created:		14 August 2007
-# Whom:			Andrew Pantyukhin <infofarmer@FreeBSD.org>
-#
+# Created by: Andrew Pantyukhin <infofarmer@FreeBSD.org>
 # $FreeBSD$
-#
 
 PORTNAME=	pyawale
 PORTVERSION=	0.4.0
-PORTREVISION=	2
-CATEGORIES=	games
+PORTREVISION=	3
+CATEGORIES=	games python
 MASTER_SITES=	http://download.gna.org/pyawale/
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	nemysis@gmx.ch
 COMMENT=	African board game
 
 LICENSE=	GPLv2
 
-RUN_DEPENDS=	py*-game>=1.7.1:${PORTSDIR}/devel/py-game
+RUN_DEPENDS=	${PYGAME}
 
 USE_PYTHON=	yes
 
+PLIST_FILES=	bin/${PORTNAME} \
+		share/applications/${PORTNAME}.desktop \
+		share/pixmaps/${PORTNAME}.png
+PLIST_DIRSTRY=	share/applications
+
+PORTDATA=	*
+PORTDOCS=	*
+
+DOCSRCDIR1=	${WRKSRC}
+DOC_FILES1=	AUTHORS ChangeLog LISEZMOI NEWS README
+
+DOCSRCDIR2=	${WRKSRC}/docs
+DOCSDIR2=	${DOCSDIR}/docs
+DOC_FILES2=	*.rest *.html *.jpg
+
+SUB_FILES=	${PORTNAME}
+
+.include <bsd.port.options.mk>
+
+post-patch:
+	@${FIND} ${WRKSRC} -name '*.py' | ${XARGS} \
+		${REINPLACE_CMD} -e 's|/usr/bin/python|${PYTHON_CMD}|'
+	@${FIND} ${WRKSRC} -name "*.bak" -delete
+
 do-build:
-	@${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${WRKSRC}/src
-	@${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py ${WRKSRC}/src
-	@${ECHO_CMD} "#!/bin/sh" > ${WRKSRC}/${PORTNAME}
-	@${ECHO_CMD} "exec ${PYTHON_CMD} \
-		${PYTHONPREFIX_SITELIBDIR}/pyAwale/${PORTNAME}.py" \
-		>> ${WRKSRC}/${PORTNAME}
+	@${PYTHON_CMD} -m compileall ${WRKSRC}
+	@${PYTHON_CMD} -O -m compileall ${WRKSRC}
 
 do-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
-	@${MKDIR} ${PYTHONPREFIX_SITELIBDIR}/pyAwale
-	@(cd ${WRKSRC}/src \
-		&& ${COPYTREE_SHARE} . ${PYTHONPREFIX_SITELIBDIR}/pyAwale)
-	@${MKDIR} ${PREFIX}/share/applications
-	${INSTALL_DATA} ${WRKSRC}/docs/${PORTNAME}.desktop \
-		${PREFIX}/share/applications
-	@${MKDIR} ${PREFIX}/share/pixmaps
-	${INSTALL_DATA} ${WRKSRC}/docs/${PORTNAME}.png \
-		${PREFIX}/share/pixmaps
-.if !defined(NOPORTDOCS)
-	@${MKDIR} ${DOCSDIR}
-.for i in AUTHORS ChangeLog NEWS README
-	${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
-.endfor
-	@${MKDIR} ${DOCSDIR}/docs
-	${INSTALL_DATA} ${WRKSRC}/docs/*.jpg ${DOCSDIR}/docs
-	${INSTALL_DATA} ${WRKSRC}/docs/*.html ${DOCSDIR}/docs
-	${INSTALL_DATA} ${WRKSRC}/docs/*.rest ${DOCSDIR}/docs
+	${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${PREFIX}/bin
+	${MKDIR} ${DATADIR}
+	@(cd ${WRKSRC}/src && ${COPYTREE_SHARE} \* ${DATADIR})
+	${INSTALL_DATA} ${WRKSRC}/docs/${PORTNAME}.png ${PREFIX}/share/pixmaps
+	${MKDIR} ${PREFIX}/share/applications
+	${INSTALL_DATA} ${WRKSRC}/docs/${PORTNAME}.desktop ${PREFIX}/share/applications
+.if ${PORT_OPTIONS:MDOCS}
+	${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${DOC_FILES1:S|^|${DOCSRCDIR1}/|} ${DOCSDIR}
+	${MKDIR} ${DOCSDIR2}
+	${INSTALL_DATA} ${DOC_FILES2:S|^|${DOCSRCDIR2}/|} ${DOCSDIR2}
 .endif
-
 .include <bsd.port.mk>

Added: head/games/pyawale/files/pyawale.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/pyawale/files/pyawale.in	Mon Dec 24 09:28:10 2012	(r309452)
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+cd "%%DATADIR%%"
+exec /usr/bin/env python ./pyawale.py

Modified: head/games/pyawale/pkg-descr
==============================================================================
--- head/games/pyawale/pkg-descr	Mon Dec 24 05:24:44 2012	(r309451)
+++ head/games/pyawale/pkg-descr	Mon Dec 24 09:28:10 2012	(r309452)
@@ -1,5 +1,13 @@
 Awale or Oware is a game of great antiquity, and has been played around
-the world in various forms for millenia.  Currently it is the official
-board game of Africa. Wikipedia: Oware
+the world in various forms for millenia. Currently it is the official
+board game of Africa.
+
+Wikipedia Oware
+
+Member of the Mancala family of board games. There are many variants
+to the rules of this game, which is for two players. This version is
+between a player and the computer.
+
+Wikipedia Mancala
 
 WWW: https://gna.org/projects/pyawale/
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Marcus von Appen freebsd_committer freebsd_triage 2012-12-24 09:28:34 UTC
State Changed
From-To: open->closed

Committed. Thanks!