Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jan 2007 22:09:29 +0900 (JST)
From:      mistral@imasy.or.jp
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/108178: New port: japanese/suicavalue: Utility to print a statement of Suica
Message-ID:  <200701211309.l0LD9TPg001207@sachiko.yamayuri.org>
Resent-Message-ID: <200701211310.l0LDALOY011807@freefall.freebsd.org>

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

>Number:         108178
>Category:       ports
>Synopsis:       New port: japanese/suicavalue: Utility to print a statement of Suica
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 21 13:10:21 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Yoshihiko Sarumaru
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD sachiko.yamayuri.org 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #2: Tue Jan 16 02:03:05 JST 2007 root@sachiko.yamayuri.org:/usr/obj/usr/src/sys/VGN-TX92S i386


	
>Description:
	This PR introduces SuicaValue program.
	Suica is a prepaid style digital train ticket card operated in Japan.
	Suica can be read by this utility with PaSoRi reader via USB.

	This utility depends on the libpasori that was send-pr'ed as
	ports/108173.

>How-To-Repeat:
	
>Fix:
# 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:
#
#	japanese/suicavalue/
#	japanese/suicavalue/files
#	japanese/suicavalue/files/Makefile
#	japanese/suicavalue/files/patch-SuicaValue.c
#	japanese/suicavalue/Makefile
#	japanese/suicavalue/distinfo
#	japanese/suicavalue/pkg-descr
#	japanese/suicavalue/pkg-message
#
echo c - japanese/suicavalue/
mkdir -p japanese/suicavalue/ > /dev/null 2>&1
echo c - japanese/suicavalue/files
mkdir -p japanese/suicavalue/files > /dev/null 2>&1
echo x - japanese/suicavalue/files/Makefile
sed 's/^X//' >japanese/suicavalue/files/Makefile << 'END-of-japanese/suicavalue/files/Makefile'
XPROG=		SuicaValue
XDPADD=		${LOCALBASE}/lib/libpasori.a
XLDADD=		-L${LOCALBASE}/lib -lpasori
X
XBINDIR=		${LOCALBASE}/bin
XNO_MAN=		true
X
XCFLAGS+=	-I${LOCALBASE}/include
XCFLAGS+=	-Wall -W
X
X.include <bsd.prog.mk>
END-of-japanese/suicavalue/files/Makefile
echo x - japanese/suicavalue/files/patch-SuicaValue.c
sed 's/^X//' >japanese/suicavalue/files/patch-SuicaValue.c << 'END-of-japanese/suicavalue/files/patch-SuicaValue.c'
X--- SuicaValue.c.orig	Sat Jan  6 16:36:31 2007
X+++ SuicaValue.c	Sun Jan 21 03:05:30 2007
X@@ -1,23 +1,30 @@
X #include <stdio.h>
X #include <stdlib.h>
X+#include <unistd.h>
X #include "libpasori.h"
X+#include "libpasori_command.h"
X 
X int
X-main(void){
X+main(int argc, char **argv){
X 	pasori* p;
X 	felica* f;
X 	int i;
X-	int m;
X 	int wk, wk2;
X 	uint8 b[16];
X 	
X-	p = pasori_open(NULL);
X+	char* devpath = NULL;
X+	if (argc == 2) {
X+		devpath = argv[1];
X+	}
X+	p = pasori_open(devpath);
X 	if(!p){
X 		printf("error\n");
X 		exit(-1);
X 	}
X 	pasori_init(p);
X+	sleep(1);
X 	f = felica_polling(p,0x0003,0,0);
X+	if (f) {
X 	printf("*** Suica Value ***\n");
X 	i=0;
X 		while(!felica_read_without_encryption02(f,0x090f,0,i,b)){
X@@ -42,6 +49,8 @@
X 			printf("  % 5d Yen        ",b[11]*256+b[10]);
X 			printf("%02X%02X%02X%02X\n",b[12],b[13],b[14],b[15]);
X 		i++;
X+	}
X+	free(f);
X 	}
X 	pasori_close(p);
X 	return 0;
END-of-japanese/suicavalue/files/patch-SuicaValue.c
echo x - japanese/suicavalue/Makefile
sed 's/^X//' >japanese/suicavalue/Makefile << 'END-of-japanese/suicavalue/Makefile'
X# New ports collection makefile for:	suicavalue
X# Date created:                         18 January 2007
X# Whom:                                 Yoshihiko Sarumaru <mistral@imasy.or.jp>
X#
X# $FreeBSD$
X
XPORTNAME=	suicavalue
XPORTVERSION=	1.0
XCATEGORIES=	japanese
XMASTER_SITES=	http://www.imfj.net/people/nomura/soft/PaSoRi/
XDISTNAME=	SuicaValue
XEXTRACT_SUFX=	.c
XEXTRACT_ONLY=
X
XMAINTAINER=	mistral@imasy.or.jp
XCOMMENT=	Utility to print a statement of Suica
X
XBUILD_DEPENDS=	${LOCALBASE}/lib/libpasori.a:${PORTSDIR}/devel/libpasori
X
XPLIST_FILES=	bin/SuicaValue
X
Xpost-extract:
X	@${MKDIR} ${WRKSRC}
X	@${CP} -f ${DISTDIR}/${DISTFILES} ${WRKSRC}
X	@${CP} -f ${FILESDIR}/Makefile ${WRKSRC}
X
Xpost-install:
X	@${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.mk>
END-of-japanese/suicavalue/Makefile
echo x - japanese/suicavalue/distinfo
sed 's/^X//' >japanese/suicavalue/distinfo << 'END-of-japanese/suicavalue/distinfo'
XMD5 (SuicaValue.c) = ea9c5ff527b614165b864678b979143c
XSHA256 (SuicaValue.c) = 66e2d4ac59d10f23899b5005be76c0610b1c4adcbfbb7fb32a3570f6d63b841d
XSIZE (SuicaValue.c) = 913
END-of-japanese/suicavalue/distinfo
echo x - japanese/suicavalue/pkg-descr
sed 's/^X//' >japanese/suicavalue/pkg-descr << 'END-of-japanese/suicavalue/pkg-descr'
XSuicaValue prints statements from a Suica card.
XYou need a Sony RC-S320 or VAIO with FeliCa port to use this program.
X
XWWW: http://www.imfj.net/people/nomura/soft/PaSoRi/SuicaValue.html
END-of-japanese/suicavalue/pkg-descr
echo x - japanese/suicavalue/pkg-message
sed 's/^X//' >japanese/suicavalue/pkg-message << 'END-of-japanese/suicavalue/pkg-message'
X******************************************************************************
XPlace your Suica card on PaSoRi before executing SuicaValue.
X******************************************************************************
END-of-japanese/suicavalue/pkg-message
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



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