aboutsummaryrefslogtreecommitdiffstats
path: root/chinese/gb2ps
diff options
context:
space:
mode:
authorvanilla <vanilla@FreeBSD.org>2013-09-26 22:35:04 +0800
committervanilla <vanilla@FreeBSD.org>2013-09-26 22:35:04 +0800
commit790daaea843b9d76278405e2384e89409f9e3219 (patch)
tree83d19ba96c927de4ba74fdf2098c79ef6ac86722 /chinese/gb2ps
parent9e5d4dfaadeab52d5bd2e44a8daecfe0a25b4561 (diff)
downloadfreebsd-ports-gnome-790daaea843b9d76278405e2384e89409f9e3219.tar.gz
freebsd-ports-gnome-790daaea843b9d76278405e2384e89409f9e3219.tar.zst
freebsd-ports-gnome-790daaea843b9d76278405e2384e89409f9e3219.zip
Support stage.
Diffstat (limited to 'chinese/gb2ps')
-rw-r--r--chinese/gb2ps/Makefile13
-rw-r--r--chinese/gb2ps/files/patch-0133
-rw-r--r--chinese/gb2ps/files/patch-cover.c10
-rw-r--r--chinese/gb2ps/files/patch-gb2ps.h48
-rw-r--r--chinese/gb2ps/files/patch-gbchar.c96
-rw-r--r--chinese/gb2ps/files/patch-gbinit.c31
-rw-r--r--chinese/gb2ps/files/patch-gbmain.c10
-rw-r--r--chinese/gb2ps/files/patch-gbpage.c46
-rw-r--r--chinese/gb2ps/pkg-plist10
9 files changed, 282 insertions, 15 deletions
diff --git a/chinese/gb2ps/Makefile b/chinese/gb2ps/Makefile
index 7a64fa173d10..0df1a1a529c1 100644
--- a/chinese/gb2ps/Makefile
+++ b/chinese/gb2ps/Makefile
@@ -17,17 +17,16 @@ COMMENT= Converts Chinese GB (simple) encoded text to PostScript
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
WRKSRC= ${WRKDIR}/GB2PS
-NO_STAGE= yes
do-install:
- @${MKDIR} ${PREFIX}/share/chinese/gb
- ${INSTALL_PROGRAM} ${WRKSRC}/gb2ps ${PREFIX}/bin
- ${INSTALL_DATA} ${WRKSRC}/cover.ps ${PREFIX}/share/chinese
+ @${MKDIR} ${STAGEDIR}/${PREFIX}/share/chinese/gb
+ ${INSTALL_PROGRAM} ${WRKSRC}/gb2ps ${STAGEDIR}/${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/cover.ps ${STAGEDIR}/${PREFIX}/share/chinese
.for font in csong24.ccf ckai24.ccf cfang24.ccf chei24.ccf cfan24.ccf
- ${GUNZIP_CMD} -c ${DISTDIR}/${font}.gz > ${PREFIX}/share/chinese/gb/${font}
+ ${GUNZIP_CMD} -c ${DISTDIR}/${font}.gz > ${STAGEDIR}/${PREFIX}/share/chinese/gb/${font}
.endfor
.if !defined(NOPORTDOCS)
- @${MKDIR} ${PREFIX}/share/doc/gb2ps
- ${INSTALL_DATA} ${WRKSRC}/gb2ps.help ${PREFIX}/share/doc/gb2ps
+ @${MKDIR} ${STAGEDIR}/${PREFIX}/share/doc/gb2ps
+ ${INSTALL_DATA} ${WRKSRC}/gb2ps.help ${STAGEDIR}/${PREFIX}/share/doc/gb2ps
.endif
.include <bsd.port.mk>
diff --git a/chinese/gb2ps/files/patch-01 b/chinese/gb2ps/files/patch-01
index cf6fa9f3c4fb..8519fe6cf66b 100644
--- a/chinese/gb2ps/files/patch-01
+++ b/chinese/gb2ps/files/patch-01
@@ -1,6 +1,6 @@
---- Makefile.orig Mon Aug 17 13:34:14 1992
-+++ Makefile Sun Apr 2 11:40:36 2000
-@@ -5,11 +5,11 @@
+--- Makefile.orig 1992-08-17 13:34:14.000000000 +0800
++++ Makefile 2013-09-26 21:07:54.000000000 +0800
+@@ -5,31 +5,31 @@
# COVERPAGE -- the absolute path and name of coverpage PS file
# -- default is current directory
@@ -15,3 +15,30 @@
all: gb2ps
+ gb2ps:gbmain.o gbchar.o gbinit.o gbpage.o cover.o
+- cc ${CFLAGS} -o gb2ps gbmain.o gbchar.o gbinit.o \
++ ${CC} ${CFLAGS} -o gb2ps gbmain.o gbchar.o gbinit.o \
+ gbpage.o cover.o
+
+ cover.o:cover.c Makefile
+- cc ${CFLAGS} -c cover.c
++ ${CC} ${CFLAGS} -c cover.c
+
+ gbmain.o: gbmain.c Makefile
+- cc ${CFLAGS} -c gbmain.c
++ ${CC} ${CFLAGS} -c gbmain.c
+ gbchar.o: gbchar.c Makefile
+- cc ${CFLAGS} -c gbchar.c
++ ${CC} ${CFLAGS} -c gbchar.c
+ gbinit.o: gbinit.c Makefile
+- cc ${CFLAGS} -c gbinit.c
++ ${CC} ${CFLAGS} -c gbinit.c
+ gbpage.o: gbpage.c Makefile
+- cc ${CFLAGS} -c gbpage.c
++ ${CC} ${CFLAGS} -c gbpage.c
+ gbpost.o: gbpost.c Makefile
+- cc ${CFLAGS} -c gbpost.c
++ ${CC} ${CFLAGS} -c gbpost.c
+
+ clean:
+ rm -f *.o core gb2ps plib2ccf
diff --git a/chinese/gb2ps/files/patch-cover.c b/chinese/gb2ps/files/patch-cover.c
new file mode 100644
index 000000000000..b4d1be861721
--- /dev/null
+++ b/chinese/gb2ps/files/patch-cover.c
@@ -0,0 +1,10 @@
+--- cover.c.orig 2013-09-26 21:05:08.000000000 +0800
++++ cover.c 2013-09-26 21:05:14.000000000 +0800
+@@ -25,6 +25,7 @@ char coverPS[50];
+ #define COVERPAGE "cover.ps"
+ #endif
+
++void
+ coverpage()
+ {
+ int tmp;
diff --git a/chinese/gb2ps/files/patch-gb2ps.h b/chinese/gb2ps/files/patch-gb2ps.h
new file mode 100644
index 000000000000..5d96d1bbf349
--- /dev/null
+++ b/chinese/gb2ps/files/patch-gb2ps.h
@@ -0,0 +1,48 @@
+--- gb2ps.h.orig 1992-08-23 11:38:03.000000000 +0800
++++ gb2ps.h 2013-09-26 21:06:36.000000000 +0800
+@@ -11,6 +11,9 @@
+ * and THERE IS NO WARRANTY FOR THIS PROGRAM.
+ ****************************************************************************/
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <ctype.h>
+
+ #define CHAR_LIMIT 2
+ #ifndef CFONT
+@@ -81,6 +84,7 @@ extern int endpage_flag;
+ extern int format_flag;
+ extern int pageno_flag;
+ extern int coverpage_flag;
++extern void coverpage();
+ extern int pagecounter;
+ extern int linecounter;
+ extern float line_h[];
+@@ -90,14 +94,19 @@ extern FILE *in, *out;
+ extern FILE *cfont;
+ extern float H,V;
+
+-extern int ASCshow();
+-extern int put_ASC();
+-extern int put_CH();
++extern void ASCshow();
++extern void put_ASC();
++extern void put_CH();
+ extern int putChar();
+-extern int putString();
+-extern int DefCHdict();
+-extern int AnalyseDoc();
+-
++extern void putString();
++extern void DefCHdict();
++extern void AnalyseDoc();
++
++extern void ps_end();
++extern void end_page();
++extern void begin_page();
++extern void ps_header();
++extern void init_page();
+ extern int init();
+-extern int cleanup();
++extern void cleanup();
+ extern int readchar();
diff --git a/chinese/gb2ps/files/patch-gbchar.c b/chinese/gb2ps/files/patch-gbchar.c
new file mode 100644
index 000000000000..3c03c595c273
--- /dev/null
+++ b/chinese/gb2ps/files/patch-gbchar.c
@@ -0,0 +1,96 @@
+--- gbchar.c.orig 1992-08-23 11:37:58.000000000 +0800
++++ gbchar.c 2013-09-26 20:54:32.000000000 +0800
+@@ -26,6 +26,7 @@ int commandcounter=0;
+ int rotate_flag=FALSE;
+ int setgray=0;
+
++void
+ ASCshow() {
+ if (ascflag) {
+ if (!Analyse_flag) fprintf(out,") S\n");
+@@ -33,6 +34,7 @@ ASCshow() {
+ }
+ }
+
++void
+ newline ()
+ {
+ charcount=0; H=_LM;
+@@ -82,6 +84,7 @@ newline ()
+ }
+ }
+
++void
+ put_ASC(c)
+ int c;
+ {
+@@ -126,6 +129,7 @@ int c;
+ newline ();
+ }
+
++void
+ put_CH(ch1,ch2)
+ int ch1,ch2;
+ {
+@@ -217,6 +221,7 @@ int ch1,ch2;
+ return ch2;
+ }
+
++void
+ putString(st)
+ char* st;
+ {
+@@ -238,6 +243,7 @@ char* st;
+
+ /*===========================================================================*/
+
++void
+ DefCHdict() {
+ long i,j,k=0;
+ char st1[10];
+@@ -249,7 +255,7 @@ DefCHdict() {
+ if (CHcode[i][j]>=CHAR_LIMIT) k++;
+ }
+
+- fprintf(out,"/CHdict %d dict def\nCHdict begin\n",k+400);
++ fprintf(out,"/CHdict %ld dict def\nCHdict begin\n",k+400);
+
+ for (i=0;i<94*94;i++)
+ for (j=0;j<6;j++) {
+@@ -257,7 +263,7 @@ DefCHdict() {
+ fseek(CHFONT[j].fp,offset_CH+i*size_of_CH,0);
+ fgets(line,size_of_CH,CHFONT[j].fp);
+ sscanf(line,"%s %s",st1,st2);
+- fprintf(out,"/C%1d%s {H {<%s>} I G} def \n",j,st1,st2);
++ fprintf(out,"/C%1ld%s {H {<%s>} I G} def \n",j,st1,st2);
+ }
+ }
+ }
+@@ -265,7 +271,8 @@ DefCHdict() {
+
+ /*AnalyseDoc: analyse the input document.*/
+
+-int AnalyseDoc() {
++void
++AnalyseDoc() {
+ int ch=0,ch1,ch2,i,j;
+
+ for (i=0;i<94*94;i++)
+@@ -326,13 +333,14 @@ int readchar() {
+ c=fgetc(in);
+ }
+
+- if (CH_mode)
+- if (((c&0x7f)>=0x21)&&((c&0x7f)<=0x7e))
++ if (CH_mode) {
++ if (((c&0x7f)>=0x21)&&((c&0x7f)<=0x7e)) {
+ return c|0x80;
+- else {
++ } else {
+ CH_mode=FALSE;
+ return c;
+ }
++ }
+
+ if (!format_flag) return c;
+
diff --git a/chinese/gb2ps/files/patch-gbinit.c b/chinese/gb2ps/files/patch-gbinit.c
new file mode 100644
index 000000000000..00370ae9f129
--- /dev/null
+++ b/chinese/gb2ps/files/patch-gbinit.c
@@ -0,0 +1,31 @@
+--- gbinit.c.orig 1992-08-23 11:37:58.000000000 +0800
++++ gbinit.c 2013-09-26 21:00:49.000000000 +0800
+@@ -98,11 +98,12 @@ char **arglist;
+ exit (1);
+ }
+
+- if (*pathname==0)
++ if (*pathname==0) {
+ if (getenv("CFONT")!=NULL)
+ strcpy(pathname,getenv("CFONT"));
+ else
+ strcpy (pathname,CFONT);
++ }
+
+ strcpy(cfont_name,pathname); strcat(cfont_name,SONGTI);
+ if ((cfont = fopen (cfont_name, "r"))!=NULL) {
+@@ -185,7 +186,7 @@ char **arglist;
+ return k;
+ }
+
+-
++void
+ cleanup(i)
+ int i;
+ {
+@@ -201,5 +202,3 @@ int i;
+ if (cfont!=CHFONT[4].fp) fclose(CHFONT[4].fp);
+ if (cfont!=CHFONT[5].fp) fclose(CHFONT[5].fp);
+ }
+-
+-
diff --git a/chinese/gb2ps/files/patch-gbmain.c b/chinese/gb2ps/files/patch-gbmain.c
new file mode 100644
index 000000000000..71cc1e95b07a
--- /dev/null
+++ b/chinese/gb2ps/files/patch-gbmain.c
@@ -0,0 +1,10 @@
+--- gbmain.c.orig 1992-08-23 11:37:58.000000000 +0800
++++ gbmain.c 2013-09-26 20:39:56.000000000 +0800
+@@ -83,6 +83,7 @@ FILE *in, *out;
+ FILE *cfont;
+ float H,V;
+
++int
+ main (argc,argv)
+ int argc;
+ char **argv;
diff --git a/chinese/gb2ps/files/patch-gbpage.c b/chinese/gb2ps/files/patch-gbpage.c
new file mode 100644
index 000000000000..2235a21d61bc
--- /dev/null
+++ b/chinese/gb2ps/files/patch-gbpage.c
@@ -0,0 +1,46 @@
+--- gbpage.c.orig 2013-09-26 20:18:53.000000000 +0800
++++ gbpage.c 2013-09-26 20:19:22.000000000 +0800
+@@ -13,6 +13,7 @@
+
+ #include "gb2ps.h"
+
++void
+ init_page()
+ {
+ /* define margins, line space and character space*/
+@@ -39,7 +40,7 @@ init_page()
+ page[1]=page[0];
+ }
+
+-
++void
+ begin_page()
+ {
+
+@@ -73,6 +74,7 @@ begin_page()
+ V=_TM-line_h[linecounter]; charcount=0;
+ }
+
++void
+ end_page ()
+ {
+ if (pagecounter) {
+@@ -97,6 +99,7 @@ end_page ()
+ pagecounter++;
+ }
+
++void
+ ps_header ()
+ {
+ fprintf(out,"%%!PS-Adobe-1.0\n");
+@@ -110,9 +113,8 @@ ps_header ()
+ fprintf(out,"%%%%EndProlog\n");
+ }
+
++void
+ ps_end()
+ {
+ fprintf(out,"%%%%Trailer\n");
+ }
+-
+-
diff --git a/chinese/gb2ps/pkg-plist b/chinese/gb2ps/pkg-plist
index 8eb5295bec1d..be945dca5adf 100644
--- a/chinese/gb2ps/pkg-plist
+++ b/chinese/gb2ps/pkg-plist
@@ -1,12 +1,12 @@
@comment $FreeBSD$
bin/gb2ps
share/chinese/cover.ps
-share/chinese/gb/csong24.ccf
-share/chinese/gb/ckai24.ccf
+share/chinese/gb/cfan24.ccf
share/chinese/gb/cfang24.ccf
share/chinese/gb/chei24.ccf
-share/chinese/gb/cfan24.ccf
-%%PORTDOCS%%share/doc/gb2ps/gb2ps.help
-%%PORTDOCS%%@dirrm share/doc/gb2ps
+share/chinese/gb/ckai24.ccf
+share/chinese/gb/csong24.ccf
+%%PORTDOCS%%%%DOCSDIR%%/gb2ps.help
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrmtry share/chinese/gb
@dirrmtry share/chinese