Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Jun 2013 23:25:53 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r321163 - in head/korean/hpscat: . files scripts
Message-ID:  <201306172325.r5HNPrd4087083@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Mon Jun 17 23:25:53 2013
New Revision: 321163
URL: http://svnweb.freebsd.org/changeset/ports/321163

Log:
  - Re-add ftp.kaist.ac.kr and remove defunct ftp.kreonet.re.kr.
  - Modernize the port and make Clang happy.

Added:
  head/korean/hpscat/files/hpscat.sh.in
     - copied, changed from r320654, head/korean/hpscat/files/hpscat.sh
  head/korean/hpscat/files/patch-Makefile
     - copied unchanged from r320654, head/korean/hpscat/files/patch-aa
  head/korean/hpscat/files/patch-hpscat.c   (contents, props changed)
  head/korean/hpscat/files/patch-hpscat.h   (contents, props changed)
  head/korean/hpscat/files/patch-init.c   (contents, props changed)
  head/korean/hpscat/files/patch-misc.c   (contents, props changed)
  head/korean/hpscat/files/patch-paper.h   (contents, props changed)
  head/korean/hpscat/files/patch-showbuf.c   (contents, props changed)
  head/korean/hpscat/files/patch-user.c   (contents, props changed)
  head/korean/hpscat/files/pkg-message.in   (contents, props changed)
Deleted:
  head/korean/hpscat/files/hpscat.sh
  head/korean/hpscat/files/patch-aa
  head/korean/hpscat/files/patch-ab
  head/korean/hpscat/pkg-plist
  head/korean/hpscat/pkg-req
  head/korean/hpscat/scripts/
Modified:
  head/korean/hpscat/Makefile

Modified: head/korean/hpscat/Makefile
==============================================================================
--- head/korean/hpscat/Makefile	Mon Jun 17 23:21:43 2013	(r321162)
+++ head/korean/hpscat/Makefile	Mon Jun 17 23:25:53 2013	(r321163)
@@ -2,40 +2,44 @@
 # $FreeBSD$
 
 PORTNAME=	hpscat
-PORTVERSION=	1.3jshin
+PORTVERSION=	1.3.1
+PORTEPOCH=	1
 CATEGORIES=	korean print
-MASTER_SITES=	ftp://ftp.kr.FreeBSD.org/pub/FreeBSD-kr/distfiles/ \
-		ftp://ftp.kreonet.re.kr/pub/hangul/cair-archive/print/hpscat/ \
-		ftp://ftp.kreonet.re.kr/pub/hangul/cair-archive/editor/ked/
-DISTNAME=	hpscat-jshin
-DISTFILES=	hpscat-jshin.tar.gz ked.tar.gz
+MASTER_SITES=	http://ftp.kaist.ac.kr/hangul/print/hpscat/ \
+		ftp://ftp.kaist.ac.kr/hangul/print/hpscat/ \
+		http://ftp.kaist.ac.kr/hangul/editor/ked/:ked \
+		ftp://ftp.kaist.ac.kr/hangul/editor/ked/:ked \
+		ftp://ftp.kr.FreeBSD.org/pub/FreeBSD-kr/distfiles/
+PKGNAMESUFFIX=	-jshin
+DISTNAME=	${PORTNAME}${PKGNAMESUFFIX}
+DISTFILES=	${DISTNAME}${EXTRACT_SUFX} ked.tar.gz:ked
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Hangul Text Printing Utility
 
 RUN_DEPENDS=    hcode:${PORTSDIR}/korean/hcode
 
+FONTDIR=	${PREFIX}/${FONTDIR_REL}
+FONTDIR_REL=	share/fonts/ked-${PORTNAME}
+FONTFILES=	Gotic Header Munjo MunjoBold PCMunjo
+README_FILES=	README README.jshin README.jshin.ks
+PLIST_FILES=	bin/hpscat bin/hpscat.bin
+.for i in ${FONTFILES} ${README_FILES}
+PLIST_FILES+=	${FONTDIR_REL}/${i}
+.endfor
+PLIST_DIRS=	${FONTDIR_REL}
+PLIST_DIRSTRY=	share/fonts
+SUB_FILES=	hpscat.sh pkg-message
+SUB_LIST=	FONTDIR=${FONTDIR}
 USE_PERL5=	yes
 
-pre-patch:
-	@${REINPLACE_CMD} -e 's,<malloc.h>,<stdlib.h>,' \
-		${WRKSRC}/hpscat.h
-
-pre-configure:
-	${CP} ${FILESDIR}/hpscat.sh ${WRKSRC}/
+.include <bsd.port.options.mk>
 
 do-install:
-	@cd ${WRKSRC}; \
-	${MKDIR} ${PREFIX}/share/fonts/ked-hpscat; \
-	${INSTALL_PROGRAM} hpscat ${PREFIX}/bin/hpscat.bin; \
-	${INSTALL_SCRIPT} hpscat.sh ${PREFIX}/bin/hpscat; \
-	${INSTALL_DATA} ${WRKDIR}/ked/Header ${PREFIX}/share/fonts/ked-hpscat; \
-	${INSTALL_DATA} ${WRKDIR}/ked/Munjo ${PREFIX}/share/fonts/ked-hpscat; \
-	${INSTALL_DATA} ${WRKDIR}/ked/MunjoBold ${PREFIX}/share/fonts/ked-hpscat; \
-	${INSTALL_DATA} ${WRKDIR}/ked/PCMunjo ${PREFIX}/share/fonts/ked-hpscat; \
-	${INSTALL_DATA} ${WRKDIR}/ked/Gotic ${PREFIX}/share/fonts/ked-hpscat; \
-	${INSTALL_DATA} README ${PREFIX}/share/fonts/ked-hpscat; \
-	${INSTALL_DATA} README.jshin ${PREFIX}/share/fonts/ked-hpscat;\
-	${INSTALL_DATA} README.jshin.ks ${PREFIX}/share/fonts/ked-hpscat
+	@${INSTALL_PROGRAM} ${WRKSRC}/hpscat ${PREFIX}/bin/hpscat.bin
+	@${INSTALL_SCRIPT} ${WRKDIR}/hpscat.sh ${PREFIX}/bin/hpscat
+	@cd ${WRKSRC} && ${COPYTREE_SHARE} "${README_FILES}" ${FONTDIR}
+	@cd ${WRKDIR}/ked && ${COPYTREE_SHARE} "${FONTFILES}" ${FONTDIR}
+	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.mk>

Copied and modified: head/korean/hpscat/files/hpscat.sh.in (from r320654, head/korean/hpscat/files/hpscat.sh)
==============================================================================
--- head/korean/hpscat/files/hpscat.sh	Tue Jun 11 22:44:39 2013	(r320654, copy source)
+++ head/korean/hpscat/files/hpscat.sh.in	Mon Jun 17 23:25:53 2013	(r321163)
@@ -7,7 +7,7 @@
 # It enables hpscat to print file without loading font in gs
 #
 
-HFONTPATH=%%PREFIX%%/share/fonts/ked-hpscat
+HFONTPATH=%%FONTDIR%%
 
 options=$*
 fileoutput=0

Copied: head/korean/hpscat/files/patch-Makefile (from r320654, head/korean/hpscat/files/patch-aa)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/korean/hpscat/files/patch-Makefile	Mon Jun 17 23:25:53 2013	(r321163, copy of r320654, head/korean/hpscat/files/patch-aa)
@@ -0,0 +1,18 @@
+--- Makefile.orig	Wed Nov 22 07:42:41 1995
++++ Makefile	Sat Mar 30 19:22:22 2002
+@@ -11,10 +11,12 @@
+ DADVHF = -DADV_HFONT
+ #DADVHF = 
+ # define if you want to make the default paper size US letter instead of A4
+-DUS = -DUS_VERSION
+-#DUS =
+-CFLAGS = -O $(DHPS) $(DADVHF) $(DUS)
++#DUS = -DUS_VERSION
++DUS =
++CFLAGS += $(DHPS) $(DADVHF) $(DUS)
+ LDFLAGS = -s
++
++all: $(PRG)
+ 
+ $(PRG): $(OBJ)
+ 	$(CC) $(LDFLAGS) -o $@ $(OBJ)

Added: head/korean/hpscat/files/patch-hpscat.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/korean/hpscat/files/patch-hpscat.c	Mon Jun 17 23:25:53 2013	(r321163)
@@ -0,0 +1,38 @@
+--- hpscat.c.orig	1995-11-23 07:46:12.000000000 -0500
++++ hpscat.c	2013-06-12 17:10:59.000000000 -0400
+@@ -12,13 +12,14 @@
+ bool cheat;
+ FILE *fp, *ofp;
+ 
++static int open_outfile(char *);
++
+ /****************
+    main routine
+  ****************/
+ 
+-main(ac,av)
+-  int  ac;
+-  char *av[];
++int
++main(int ac, char *av[])
+ {
+     int  i;
+     extern void showfile PROT((char *));
+@@ -53,13 +54,13 @@
+     exit(0);
+ }
+ 
+-int
+-open_outfile(s)    /*  returns -1 if can't write */
+-  char *s;
++static int
++open_outfile(char *s)    /*  returns -1 if can't write */
+ {
+     char ans[80], buf[256];
+     sprintf(buf,"%s.ps", s);
+-    if(ofp=fopen(buf,"r")) { /* file exists */
++    ofp=fopen(buf,"r");
++    if(ofp) { /* file exists */
+ 	fclose(ofp);
+ 	fprintf(stderr,"output file %s exists...overwrite? ", buf);
+ 	gets(ans);

Added: head/korean/hpscat/files/patch-hpscat.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/korean/hpscat/files/patch-hpscat.h	Mon Jun 17 23:25:53 2013	(r321163)
@@ -0,0 +1,28 @@
+--- hpscat.h.orig	1995-11-23 05:16:11.000000000 -0500
++++ hpscat.h	2013-06-12 18:37:53.000000000 -0400
+@@ -49,9 +49,11 @@
+ \*------------------------------*/
+ 
+ #include <stdio.h>
+-#include <malloc.h>
++#include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+ #include <sys/time.h>
++#include <sys/wait.h>
+ 
+ #ifdef __GNUC__
+ # define  PROT(x)  x
+@@ -186,4 +188,12 @@
+ extern FILE   *fp;         /*  file pointer to input file  */
+ extern FILE   *ofp;        /*  file pointer to output file  */
+ 
++void	endfile(void);
++void	fatal(char *);
++int	fillpagebuf(void);
++int	find_f(int, int, int);
++int	find_l(int, int, int);
++int	find_m(int, int, int);
++int	find_set(int);
++
+ /***  EOF  ***/

Added: head/korean/hpscat/files/patch-init.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/korean/hpscat/files/patch-init.c	Mon Jun 17 23:25:53 2013	(r321163)
@@ -0,0 +1,11 @@
+--- init.c.orig	1995-11-23 17:18:58.000000000 -0500
++++ init.c	2013-06-12 17:34:31.000000000 -0400
+@@ -211,7 +211,7 @@
+     Time = localtime(&T.tv_sec);
+     sprintf(nalza, "%02d:%02d,    %d/%d/%d",
+ 	    Time->tm_hour,  Time->tm_min,
+-            Time->tm_mon+1, Time->tm_mday, Time->tm_year );
++            Time->tm_mon+1, Time->tm_mday, Time->tm_year + 1900);
+ }
+ 
+ /***  EOF  ***/

Added: head/korean/hpscat/files/patch-misc.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/korean/hpscat/files/patch-misc.c	Mon Jun 17 23:25:53 2013	(r321163)
@@ -0,0 +1,21 @@
+--- misc.c.orig	1995-11-23 15:40:07.000000000 -0500
++++ misc.c	2013-06-12 18:43:01.000000000 -0400
+@@ -2,8 +2,8 @@
+ #include "hpscat.h"
+ #include "paper.h"
+ 
+-extern totalpages;
+-static converted;
++extern int totalpages;
++static int converted;
+ char  *tmpfn;
+ 
+ void
+@@ -36,6 +36,7 @@
+ #endif
+       case Nbyte: strcpy(args[1], fromN); break;
+       case ISO:   strcpy(args[1], fromI); break;
++      default:    /* NOTREACHED */ return;
+     }
+     execute(args);
+     fclose(fp);

Added: head/korean/hpscat/files/patch-paper.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/korean/hpscat/files/patch-paper.h	Mon Jun 17 23:25:53 2013	(r321163)
@@ -0,0 +1,22 @@
+--- paper.h.orig	1995-11-23 02:56:27.000000000 -0500
++++ paper.h	2013-06-12 16:57:50.000000000 -0400
+@@ -5,7 +5,7 @@
+    add other paper types like b4 and b5  before the last entry 'user' here 
+    and their dimensions to the array  'papersize' in paper.c */
+ typedef enum {a3,a4,a5,b4,b5,letter,t10x14,legal,executive,
+-              folio,quarto,statement,ledger,tabloid,user} PAPER; 
++              folio,quarto,statement,ledger,tabloid,c5,user} PAPER; 
+ 
+ /* mnemonics for length unit  
+    add other unit such as pica  and conversion factor to standard
+@@ -54,8 +54,8 @@
+ #define ABS_MIN_LM 18  /* depends on printer */ 
+ 
+ 
+-extern s_width;
+-extern s_width_nl;
++extern int s_width;
++extern int s_width_nl;
+ extern int l_width,l_height,l_lm1,l_lm2,l_bm,l_tm;
+ extern int l3_width,l3_height,l3_lm1,l3_lm2,l3_lm3,l3_bm,l3_tm;
+ extern int p_width,p_height,p_lm,p_bm,p_tm;

Added: head/korean/hpscat/files/patch-showbuf.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/korean/hpscat/files/patch-showbuf.c	Mon Jun 17 23:25:53 2013	(r321163)
@@ -0,0 +1,19 @@
+--- showbuf.c.orig	1995-11-23 07:01:36.000000000 -0500
++++ showbuf.c	2013-06-12 17:15:47.000000000 -0400
+@@ -210,7 +210,7 @@
+ 	fprintf(ofp,"90 rotate 0 %d translate ", - papersize[paper].width);
+     fprintf(ofp," %f 1 scale\n",HOR_SCALE_FAC);
+ 
+-    if(nobox == False) 
++    if(nobox == False) {
+        if(layout==Sero) {
+    	box(p_lm, p_bm, p_width, p_height);
+    	fillbox(p_lm, p_bm, s_width, p_height);
+@@ -236,6 +236,7 @@
+    	fillbox(l3_lm2, l3_bm, s_width, l3_height);
+    	fillbox(l3_lm3, l3_bm, s_width, l3_height);
+        }
++    }
+     if(noheader == False) {
+        x = (layout==Sero||layout==Sero2) ?  p_lm : l_lm1;
+        y = (layout==Sero||layout==Sero2) ?  p_tm : l_tm;

Added: head/korean/hpscat/files/patch-user.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/korean/hpscat/files/patch-user.c	Mon Jun 17 23:25:53 2013	(r321163)
@@ -0,0 +1,10 @@
+--- user.c.orig	1995-11-23 05:17:16.000000000 -0500
++++ user.c	2013-06-12 17:24:33.000000000 -0400
+@@ -37,7 +37,6 @@
+     char buf[BUFSIZ];
+     char *home;
+     FILE *fp;
+-    extern char *getenv PROT((char *));
+     home = getenv("HOME");
+     if(strlen(home)==0)
+         return;

Added: head/korean/hpscat/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/korean/hpscat/files/pkg-message.in	Mon Jun 17 23:25:53 2013	(r321163)
@@ -0,0 +1,3 @@
+To use hpscat with font loading in gs, use hpscat.sh instead.
+Otherwise, you must setup ghostscript to load font first.
+Read %%FONTDIR%%/README.jshin(.ks)



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