Date: Sat, 23 Jul 2005 12:09:29 -0600 (MDT) From: "Aaron C Dalton" <aaron@daltons.ca> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/83958: New Port: textproc/p5-Chess-PGN-Parse Message-ID: <200507231809.j6NI9T0V006427@moondance.finch.st> Resent-Message-ID: <200507231810.j6NIAEWP023762@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 83958 >Category: ports >Synopsis: New Port: textproc/p5-Chess-PGN-Parse >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Jul 23 18:10:14 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Aaron C Dalton >Release: FreeBSD 5.3-RELEASE i386 >Organization: >Environment: System: FreeBSD moondance.finch.st 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Fri Nov 5 04:19:18 UTC 2004 root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: Chess::PGN::Parse offers a range of methods to read and manipulate Portable Game Notation files. PGN files contain chess games produced by chess programs following a standard format (http://www.schachprobleme.de/chessml/faq/pgn/). It is among the preferred means of chess games distribution. Being a public, well established standard, PGN is understood by many chess archive programs. Parsing simple PGN files is not difficult. However, dealing with some of the intricacies of the Standard is less than trivial. This module offers a clean handle toward reading and parsing complex PGN files. A PGN file has several tags, which are key/values pairs at the header of each game, in the format [key "value"] After the header, the game follows. A string of numbered chess moves, optionally interrupted by braced comments and recursive parenthesized variants and comments. While dealing with simple braced comments is straightforward, parsing nested comments can give you more than a headache. Chess::PGN::Parse most immediate methods are: read_game() reads one game, separating the tags and the game text. parse_game() parse the current game, and stores the moves into an array and optionally saves the comments into an array of hashes for furter usage. It can deal with nested comments and recursive variations. quick_parse_game() Same as the above, but doesn't save the comments, which are just stripped from the text. It can't deal with nested comments. Should be the preferred method when we know that we are dealing with simple PGNs. smart_parse_game() Best of the above methods. A preliminary check will call parse_game() or quick_parse_game(), depending on the presence of nested comments in the game. read_all(), quick_read_all(), smart_read_all() will read all the records in the current PGN file and return an array of hashes with all the parsed details from the games. >How-To-Repeat: >Fix: --- submission.txt begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # p5-Chess-PGN-Parse # p5-Chess-PGN-Parse/pkg-plist # p5-Chess-PGN-Parse/Makefile # p5-Chess-PGN-Parse/distinfo # p5-Chess-PGN-Parse/pkg-descr # echo c - p5-Chess-PGN-Parse mkdir -p p5-Chess-PGN-Parse > /dev/null 2>&1 echo x - p5-Chess-PGN-Parse/pkg-plist sed 's/^X//' >p5-Chess-PGN-Parse/pkg-plist << 'END-of-p5-Chess-PGN-Parse/pkg-plist' X%%SITE_PERL%%/Chess/PGN/Parse.pm X%%SITE_PERL%%/%%PERL_ARCH%%/auto/Chess/PGN/Parse/.packlist X@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Chess/PGN/Parse X@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto/Chess/PGN 2>/dev/null || true X@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto/Chess 2>/dev/null || true X@unexec rmdir %D/%%SITE_PERL%%/Chess/PGN 2>/dev/null || true X@unexec rmdir %D/%%SITE_PERL%%/Chess 2>/dev/null || true X END-of-p5-Chess-PGN-Parse/pkg-plist echo x - p5-Chess-PGN-Parse/Makefile sed 's/^X//' >p5-Chess-PGN-Parse/Makefile << 'END-of-p5-Chess-PGN-Parse/Makefile' X# New ports collection makefile for: p5-Chess-PGN-Parse X# Date created: 23 July 2005 X# Whom: Aaron Dalton <aaron@daltons.ca> X# X# $FreeBSD$ X# X XPORTNAME= Chess-PGN-Parse XPORTVERSION= 0.18 XCATEGORIES= textproc games perl5 XMASTER_SITES= ${MASTER_SITE_PERL_CPAN} XMASTER_SITE_SUBDIR= ../../authors/id/G/GM/GMAX XPKGNAMEPREFIX= p5- X XMAINTAINER= aaron@daltons.ca XCOMMENT= Reads and parses PGN (Portable Game Notation) Chess files X XPERL_CONFIGURE= yes X XMAN3= Chess::PGN::Parse.3 X X.include <bsd.port.mk> END-of-p5-Chess-PGN-Parse/Makefile echo x - p5-Chess-PGN-Parse/distinfo sed 's/^X//' >p5-Chess-PGN-Parse/distinfo << 'END-of-p5-Chess-PGN-Parse/distinfo' XMD5 (Chess-PGN-Parse-0.18.tar.gz) = 9c97380edd8f726719f0ae475c281b08 XSIZE (Chess-PGN-Parse-0.18.tar.gz) = 26356 END-of-p5-Chess-PGN-Parse/distinfo echo x - p5-Chess-PGN-Parse/pkg-descr sed 's/^X//' >p5-Chess-PGN-Parse/pkg-descr << 'END-of-p5-Chess-PGN-Parse/pkg-descr' XChess::PGN::Parse offers a range of methods to read and manipulate XPortable Game Notation files. PGN files contain chess games produced by Xchess programs following a standard format X(http://www.schachprobleme.de/chessml/faq/pgn/). It is among the preferred Xmeans of chess games distribution. Being a public, well established Xstandard, PGN is understood by many chess archive programs. Parsing simple XPGN files is not difficult. However, dealing with some of the intricacies Xof the Standard is less than trivial. This module offers a clean handle Xtoward reading and parsing complex PGN files. X XA PGN file has several tags, which are key/values pairs at the header of Xeach game, in the format [key "value"] X XAfter the header, the game follows. A string of numbered chess moves, Xoptionally interrupted by braced comments and recursive parenthesized Xvariants and comments. While dealing with simple braced comments is Xstraightforward, parsing nested comments can give you more than a Xheadache. X XWWW: http://search.cpan.org/dist/Chess-PGN-Parse XAuthor: Giuseppe Maxia <gmax@cpan.org> X X- Aaron Dalton Xaaron@daltons.ca END-of-p5-Chess-PGN-Parse/pkg-descr exit --- submission.txt ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507231809.j6NI9T0V006427>