# 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: # # xxfish-nkf # xxfish-nkf/Makefile # xxfish-nkf/distinfo # xxfish-nkf/pkg-plist # xxfish-nkf/files # xxfish-nkf/files/patch-aa # xxfish-nkf/files/patch-ab # xxfish-nkf/files/patch-ac # xxfish-nkf/files/p_nkf.c # xxfish-nkf/pkg-comment # xxfish-nkf/pkg-descr # echo c - xxfish-nkf mkdir -p xxfish-nkf > /dev/null 2>&1 echo x - xxfish-nkf/Makefile sed 's/^X//' >xxfish-nkf/Makefile << 'END-of-xxfish-nkf/Makefile' X# New ports collection makefile for: fish X# Date created: 25 Dec 2001 X# Whom: TAKEMURA Masahiro X# X# $Id: xxfish-nkf.txt,v 1.4 2003/05/30 13:44:22 mastake Exp $ X# X XPORTNAME= xxfish XPORTVERSION= 1 XPKGNAMESUFFIX= -nkf XCATEGORIES= japanese XMASTER_SITES= \ X ftp://ftp.vector.co.jp/pack/dos/util/security/cipher/ \ X ftp://ftp.ie.u-ryukyu.ac.jp/pub/software/kono/ \ X ftp://vector-mirror.hotcn.ne.jp/pub/pack/dos/util/security/cipher/ \ X ftp://vector-mirror.ctc.ad.jp/pub/pack/dos/util/security/cipher/ \ X http://www.rr.iij4u.or.jp/~mastake/FreeBSD/ X XBUILD_DEPENDS= lha:${PORTSDIR}/archivers/lha \ X nkf:${PORTSDIR}/japanese/nkf X XFISHDIST= ${PORTNAME}_${PORTVERSION}.lzh XNKFDIST= nkf192.shar XDISTNAME= ${FISHDIST} ${NKFDIST} XEXTRACT_SUFX= # XWRKSRC= ${WRKDIR} X XNKF= `which nkf` -Xe X XMAINTAINER= mas@mstk.que.jp X Xdo-extract: X @${RM} -rf ${WRKDIR} X @${MKDIR} ${WRKDIR} X @(if ! (cd ${WRKDIR} && lha -x ${_DISTDIR}/${FISHDIST} > /dev/null); \ X then \ X exit 1; \ X fi) X X @(cd ${WRKDIR} && \ X for f in en de; do \ X ${NKF} $${f}fish.c > $${f}fish.c.euc; \ X ${MV} $${f}fish.c.euc $${f}fish.c; \ X done) X X @(if ! (cd ${WRKDIR} && \ X ${MKDIR} NKF && \ X ${SH} ${_DISTDIR}/${NKFDIST} > /dev/null); \ X then \ X exit 1; \ X fi) X X @${CP} ${FILESDIR}/p_nkf.c ${WRKDIR} X Xdo-build: X @(cd ${BUILD_WRKSRC}; \ X ${CC} ${CFLAGS} -c p_nkf.c; \ X for f in en de; do \ X ${CC} -o $${f}fish ${CFLAGS} $${f}fish.c p_nkf.o; \ X done) X Xdo-install: X @(cd ${INSTALL_WRKSRC}; \ X for f in en de; do \ X ${INSTALL_PROGRAM} $${f}fish ${PREFIX}/bin/; \ X done; \ X ${INSTALL_DATA} xxfish.doc ${PREFIX}/share/doc/) X X.include END-of-xxfish-nkf/Makefile echo x - xxfish-nkf/distinfo sed 's/^X//' >xxfish-nkf/distinfo << 'END-of-xxfish-nkf/distinfo' XMD5 (xxfish_1.lzh) = b3823bfb85f13c6daeaeeb60f72904a3 XMD5 (nkf192.shar) = 2e560387657d5d7c725875e548394b0f END-of-xxfish-nkf/distinfo echo x - xxfish-nkf/pkg-plist sed 's/^X//' >xxfish-nkf/pkg-plist << 'END-of-xxfish-nkf/pkg-plist' Xbin/enfish Xbin/defish Xshare/doc/xxfish.doc END-of-xxfish-nkf/pkg-plist echo c - xxfish-nkf/files mkdir -p xxfish-nkf/files > /dev/null 2>&1 echo x - xxfish-nkf/files/patch-aa sed 's/^X//' >xxfish-nkf/files/patch-aa << 'END-of-xxfish-nkf/files/patch-aa' X--- defish.c.orig Fri Dec 4 17:30:14 1992 X+++ defish.c Wed Jan 2 10:46:29 2002 X@@ -5,8 +5,6 @@ X #include X #include X #include X-#include X-#include X X #define NISH 1 X X@@ -25,6 +23,8 @@ X int decode_flag; X long filelen; X X+unsigned char * nkf_kconv(unsigned char *opt, unsigned char *src); X+ X int FishJstrcspn(int c, char *js) { X char c1, c2; X int i; X@@ -39,8 +39,8 @@ X } X X int decode4649(void) { X- char *s; X- int c, c1, c2; X+ char *s, *buf0; X+ int c, c1, c2, i; X X for (;;) { X if (NULL == fgets(buf1, MAX_STRING, infile)) { X@@ -63,6 +63,13 @@ X if (!strncmp(buf1, "begin 24~ ", 10)) X return -2; /* ヘッダ一致 */ X #endif X+ buf0 = nkf_kconv("-e", buf1); X+ for (i=0; ixxfish-nkf/files/patch-ab << 'END-of-xxfish-nkf/files/patch-ab' X--- enfish.c.orig Wed Jan 2 12:44:35 2002 X+++ enfish.c Wed Jan 2 12:45:31 2002 X@@ -6,6 +6,7 @@ X #include X #include X X+#define MAXCHAR 72 X #define NISH 1 X X char fish[] = "鯵鮎鰯鰻鰍鰹魚鯨鯉鮭鯖鮫鯛鱈鰭鮒鮪鱒鰐魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸"; X@@ -18,9 +19,13 @@ X long filelen; X int encode_flag; X X+static char *opt; X+unsigned char * nkf_kconv(unsigned char *opt, unsigned char *src); X+ X int encode4649(char *filename) { X int c, c1, c2; X int len; X+ unsigned char *nkf_out, buf[MAXCHAR + 8]; X X printf("begin 4649 %s\n", filename); X len = 0; X@@ -33,13 +38,17 @@ X return -1; X } X } X- if (len >= 72) { X+ if (len >= MAXCHAR) { X+ buf[len] = '\0'; X+ nkf_out = nkf_kconv(opt, buf); X+ printf("%s", nkf_out); X+ free(nkf_out); X printf("\n"); X len = 0; X } X c1 = (c >> 5) & 0x6; X c2 = (c << 1) & 0x7e; X- printf("%c%c%c%c", fish[c1], fish[c1+1], fish[c2], fish[c2+1]); X+ sprintf(buf + len, "%c%c%c%c", fish[c1], fish[c1+1], fish[c2], fish[c2+1]); X len += 4; X filelen++; X } X@@ -50,6 +59,7 @@ X int encode86(char *filename) { X int c, c1, c2, d, e; X int len; X+ unsigned char *nkf_out, buf[MAXCHAR + 8]; X X printf("begin 86~ %s\n", filename); X len = 0; X@@ -77,31 +87,35 @@ X } X } else X filelen++; X- if (len >= 72) { X+ if (len >= MAXCHAR) { X+ buf[len] = '\0'; X+ nkf_out = nkf_kconv(opt, buf); X+ printf("%s", nkf_out); X+ free(nkf_out); X printf("\n"); X len = 0; X } X c1 = (c >> 1) & 0x7e; X c2 = (c << 5) & 0x60; X- printf("%c%c", fish[c1], fish[c1+1]); X+ sprintf(buf + len, "%c%c", fish[c1], fish[c1+1]); X len += 2; X if (d == EOF) { X- printf("%c%c", fish[c2], fish[c2+1]); X+ sprintf(buf + len, "%c%c", fish[c2], fish[c2+1]); X len += 2; X break; X } X c1 = c2 | (d >> 3) & 0x1e; X c2 = (d << 3) & 0x78; X- printf("%c%c", fish[c1], fish[c1+1]); X+ sprintf(buf + len, "%c%c", fish[c1], fish[c1+1]); X len += 2; X if (e == EOF) { X- printf("%c%c", fish[c2], fish[c2+1]); X+ sprintf(buf + len, "%c%c", fish[c2], fish[c2+1]); X len += 2; X break; X } X c1 = c2 | (e >> 5) & 0x06; X c2 = (e << 1) & 0x7f; X- printf("%c%c%c%c", fish[c1], fish[c1+1], fish[c2], fish[c2+1]); X+ sprintf(buf + len, "%c%c%c%c", fish[c1], fish[c1+1], fish[c2], fish[c2+1]); X len += 4; X } X printf("\n``\nend\nsize %lu\nEND--cut here--cut here\n", filelen); X@@ -112,6 +126,7 @@ X int encode24(char *filename) { X int c, c1, c2; X int len; X+ unsigned char *nkf_out, buf[MAXCHAR + 8]; X X printf("begin 24~ %s\n", filename); X len = 0; X@@ -124,13 +139,17 @@ X return -1; X } X } X- if (len >= 72) { X+ if (len >= MAXCHAR) { X+ buf[len] = '\0'; X+ nkf_out = nkf_kconv(opt, buf); X+ printf("%s", nkf_out); X+ free(nkf_out); X printf("\n"); X len = 0; X } X c1 = (c >> 5) & 0x6; X c2 = (c << 1) & 0x7e; X- printf("%c%c%c%c", nish[c1], nish[c1+1], nish[c2], nish[c2+1]); X+ sprintf(buf + len, "%c%c%c%c", nish[c1], nish[c1+1], nish[c2], nish[c2+1]); X len += 4; X filelen++; X } X@@ -175,9 +194,9 @@ X X if (argc == 1) { X #if defined(NISH) X- fprintf(stderr, "Usage: enfish [-4649] [-86~] [-24~] [...]\n"); X+ fprintf(stderr, "Usage: enfish [-4649] [-86~] [-24~] [-e] [-j] [-s] [...]\n"); X #elif X- fprintf(stderr, "Usage: enfish [-4649] [-86~] [...]\n"); X+ fprintf(stderr, "Usage: enfish [-4649] [-86~] [-e] [-j] [-s] [...]\n"); X #endif X exit(1); X } X@@ -191,6 +210,8 @@ X else if (!strcmp(argv[i], "-24~")) X encode_flag = 24; X #endif X+ else if (!strcmp(argv[i],"-e") || !strcmp(argv[i],"-j") || !strcmp(argv[i],"-s")) X+ opt = argv[i]; X else X encode(argv[i]); X } END-of-xxfish-nkf/files/patch-ab echo x - xxfish-nkf/files/patch-ac sed 's/^X//' >xxfish-nkf/files/patch-ac << 'END-of-xxfish-nkf/files/patch-ac' X--- nkf.c.orig Wed Jan 2 11:33:59 2002 X+++ nkf.c Wed Jan 2 11:34:26 2002 X@@ -75,8 +75,8 @@ X /******************************/ X /* デフォルトの出力コード選択 */ X /* Select DEFAULT_CODE */ X-#define DEFAULT_CODE_JIS X-/* #define DEFAULT_CODE_SJIS */ X+/* #define DEFAULT_CODE_JIS */ X+#define DEFAULT_CODE_SJIS X /* #define DEFAULT_CODE_EUC */ X /******************************/ X X@@ -437,7 +437,7 @@ X X #ifndef PERL_XS X int X-main(argc, argv) X+nkf_main(argc, argv) X int argc; X char **argv; X { X@@ -744,6 +744,7 @@ X } X } X X+/* X int X std_getc(f) X FILE *f; X@@ -765,6 +766,7 @@ X { X putchar(c); X } X+*/ X X int X noconvert(f) END-of-xxfish-nkf/files/patch-ac echo x - xxfish-nkf/files/p_nkf.c sed 's/^X//' >xxfish-nkf/files/p_nkf.c << 'END-of-xxfish-nkf/files/p_nkf.c' X#include "nkf.c" X X#define INCSIZE 32 Xstatic int incsize; X Xstatic unsigned char *input, *output; Xstatic int input_ctr; Xstatic int output_ctr, o_len; X Xstatic int Xstd_getc(f) X FILE *f; X{ X int value; X if ((value = (int) input[input_ctr++]) != '\0') { X return value; X } X return EOF; X} X Xstatic int Xstd_ungetc(c, f) X FILE *f; X{ X input_ctr--; X} X Xstatic void Xstd_putc(c) X int c; X{ X int i; X unsigned char *tmp; X X if (output_ctr >= o_len-1) { X o_len += incsize; X tmp = (unsigned char *) realloc(output, o_len * sizeof(char)); X if (tmp == NULL) { X tmp = (unsigned char *) malloc(o_len * sizeof(char)); X for (i=0; ixxfish-nkf/pkg-comment << 'END-of-xxfish-nkf/pkg-comment' XFish File Converter enfish/defish encorder and decorder END-of-xxfish-nkf/pkg-comment echo x - xxfish-nkf/pkg-descr sed 's/^X//' >xxfish-nkf/pkg-descr << 'END-of-xxfish-nkf/pkg-descr' XFish File Converter enfish/defish encorder and decorder END-of-xxfish-nkf/pkg-descr exit