From f38f930b0b84bbe2f323658631f3f49f81f6fae0 Mon Sep 17 00:00:00 2001 From: CHOI Junho Date: Sun, 16 Jul 2000 09:01:54 +0000 Subject: - Update han to work in 4.x. Use patches from kon2-16dot. (it still has a bug: cursor doesn't displayed) - distfile location moved. --- korean/han/Makefile | 7 +- korean/han/files/patch-aa | 71 +++++++++++++++++++++ korean/han/files/patch-ab | 44 +++++++++++++ korean/han/files/patch-af | 21 ++++++ korean/han/files/patch-ag | 103 ++++++++++++++++++++++++++++++ korean/han/files/patch-ah | 23 +++++++ korean/han/files/patch-ak | 25 ++++++++ korean/han/files/patch-al | 159 ++++++++++++++++++++++++++++++++++++++++++++++ korean/han/files/patch-am | 15 +++++ korean/han/files/patch-ba | 35 ++++++++++ korean/han/files/patch-bb | 19 ++++++ korean/han/files/patch-bc | 12 ++++ korean/han/files/patch-bd | 37 +++++++++++ korean/han/files/patch-be | 12 ++++ korean/han/pkg-descr | 12 ++-- 15 files changed, 586 insertions(+), 9 deletions(-) create mode 100644 korean/han/files/patch-aa create mode 100644 korean/han/files/patch-ab create mode 100644 korean/han/files/patch-af create mode 100644 korean/han/files/patch-ag create mode 100644 korean/han/files/patch-ah create mode 100644 korean/han/files/patch-ak create mode 100644 korean/han/files/patch-al create mode 100644 korean/han/files/patch-am create mode 100644 korean/han/files/patch-ba create mode 100644 korean/han/files/patch-bb create mode 100644 korean/han/files/patch-bc create mode 100644 korean/han/files/patch-bd create mode 100644 korean/han/files/patch-be (limited to 'korean') diff --git a/korean/han/Makefile b/korean/han/Makefile index 59ec471425e0..7d04d6fc764b 100644 --- a/korean/han/Makefile +++ b/korean/han/Makefile @@ -1,6 +1,6 @@ # New ports collection makefile for: han # Date created: 12 Apr 1997 -# Whom: Choi Jun Ho +# Whom: CHOI Junho # # $FreeBSD$ # @@ -8,11 +8,12 @@ PORTNAME= han PORTVERSION= 1.0fb CATEGORIES= korean -MASTER_SITES= ftp://jazz.snu.ac.kr/pub/unix/FreeBSD-kr/source/han/ +MASTER_SITES= ftp://ftp.kr.freebsd.org/pub/FreeBSD-kr/distfiles/ \ + ftp://jazz.snu.ac.kr/pub/unix/FreeBSD-kr/source/han/ ONLY_FOR_ARCHS= i386 -USE_GMAKE= yes +USE_GMAKE= YES post-configure: ${SED} -e 's%%WRKSRC%%${WRKSRC}' \ diff --git a/korean/han/files/patch-aa b/korean/han/files/patch-aa new file mode 100644 index 000000000000..e559212d276e --- /dev/null +++ b/korean/han/files/patch-aa @@ -0,0 +1,71 @@ +--- src/vc.c.orig Sat Mar 29 04:35:50 1997 ++++ src/vc.c Sun Jul 16 12:44:05 2000 +@@ -310,12 +310,23 @@ + { + struct vt_mode vtm; + ++#if defined(__FreeBSD__) ++ signal(SIGUSR1, SIG_IGN); ++ signal(SIGUSR2, SIG_IGN); ++#else /* linux */ + signal(SIGUSR1, SIG_DFL); + signal(SIGUSR2, SIG_DFL); ++#endif + vtm.mode = VT_AUTO; + vtm.waitv = 0; ++#if defined(__FreeBSD__) ++ vtm.relsig = SIGUSR1; ++ vtm.acqsig = SIGUSR2; ++ vtm.frsig = SIGUSR1; ++#else /* linux */ + vtm.relsig = 0; + vtm.acqsig = 0; ++#endif + ioctl(0, VT_SETMODE, &vtm); + #if defined(__FreeBSD__) + ioctl(0, VT_RELDISP, 1); +@@ -341,6 +352,9 @@ + vtm.waitv = 0; + vtm.relsig = SIGUSR1; + vtm.acqsig = SIGUSR2; ++#if defined(__FreeBSD__) ++ vtm.frsig = SIGUSR1; ++#endif + ioctl(0, VT_SETMODE, &vtm); + vInfo.graph_mode(); + if (useHardScroll) +@@ -859,20 +873,31 @@ + + static int ConfigBeep(const char *confstr) + { +- beepCount = atoi(confstr) * 10000; + #if defined(linux) +- ioperm(COUNTER_ADDR, 1, TRUE); ++ beepCount = atoi(confstr) * 10000; ++ if (beepCount > 0) ++ ioperm(COUNTER_ADDR, 1, TRUE); ++#endif ++#if defined(__FreeBSD__) ++ beepCount = atoi(confstr) * 10; + #endif + return SUCCESS; + } + ++#define BELL_PITCH 800 ++ + void Beep(void) + { +- if (!con.active) return; + #ifdef linux ++ if (!con.active) return; + PortOutb(PortInb(COUNTER_ADDR)|3, COUNTER_ADDR); + usleep(beepCount); + PortOutb(PortInb(COUNTER_ADDR)&0xFC, COUNTER_ADDR); ++#endif ++#if defined(__FreeBSD__) ++ if(beepCount <= 0) return; ++ ioctl(fileno(stdout), KDMKTONE, (BELL_PITCH & 0xffff) | ++ ((beepCount & 0xffff) << 16)); + #endif + } + diff --git a/korean/han/files/patch-ab b/korean/han/files/patch-ab new file mode 100644 index 000000000000..e5e72bfb0180 --- /dev/null +++ b/korean/han/files/patch-ab @@ -0,0 +1,44 @@ +--- src/child.c.orig Sat Mar 29 05:29:53 1997 ++++ src/child.c Sun Jul 16 12:48:02 2000 +@@ -26,6 +26,7 @@ + + #ifdef __FreeBSD__ + #include ++#include + #endif + + #include +@@ -98,6 +99,9 @@ + { + char *shell, *tail, *tcap; + char buff[80]; ++#if defined(__FreeBSD__) ++ struct winsize win; ++#endif + + setgid(getgid()); + setuid(getuid()); +@@ -107,6 +111,10 @@ + sprintf(buff, "TERMCAP=:co#%d:li#%d:tc=console:", + dInfo.txmax + 1, dInfo.tymax + 1); + #elif defined(__FreeBSD__) ++ win.ws_row = dInfo.tymax + 1; ++ win.ws_col = dInfo.txmax + 1; ++ win.ws_xpixel = win.ws_ypixel = 0; ++ ioctl(STDIN_FILENO, TIOCSWINSZ, &win); + sprintf(buff,"TERM=vt100"); + #endif + tcap = strdup(buff); +@@ -120,10 +128,10 @@ + "HAN is free software, and you are welcome to redistribute it\r\n" + "HAN under certain conditions; show COPYING for details.\r\n"); + #if defined(__FreeBSD__) +- printf("\rHAN for FreeBSD-2.x\r\n"); ++ printf("\rHAN for FreeBSD\r\n"); + #endif + } +- printf("HAN using VT number %c.\n\n", ++ printf("HAN using VT number %c.\r\n", + #if defined(linux) + *(ttyname(fileno(errfp))+8)); + #elif defined(__FreeBSD__) diff --git a/korean/han/files/patch-af b/korean/han/files/patch-af new file mode 100644 index 000000000000..1b9fb6473f9f --- /dev/null +++ b/korean/han/files/patch-af @@ -0,0 +1,21 @@ +--- src/term.c.orig Sat Mar 29 04:36:54 1997 ++++ src/term.c Sun Jul 16 12:50:34 2000 +@@ -209,6 +209,9 @@ + } + if (FD_ISSET(0, &readFds)) { + i = read(0, buff, BUFSIZ); ++#if defined(__FreeBSD__) ++ i = cons25tovt100(buff, i, BUFSIZ); ++#endif + #if 1 + { + int k, l; +@@ -239,7 +242,7 @@ + PollCursor(TRUE); + } + if (FD_ISSET(sockFd, &readFds)) SocketInterface(sockFd); +- if (mInfo.has_mouse) { ++ if (mInfo.has_mouse && mouseFd > 0) { + if (FD_ISSET(mouseFd, &readFds) && con.active) { + i = read(mouseFd, buff, BUFSIZ); + if (i > 0) MouseGetPacket(buff, i); diff --git a/korean/han/files/patch-ag b/korean/han/files/patch-ag new file mode 100644 index 000000000000..66ac5d73c41c --- /dev/null +++ b/korean/han/files/patch-ag @@ -0,0 +1,103 @@ +--- src/utmp.c.orig Fri Jan 24 09:37:28 1997 ++++ src/utmp.c Sat Apr 26 21:50:30 1997 +@@ -41,20 +41,32 @@ + #include + #include + #include ++#if defined(__FreeBSD__) ++#include ++#endif + ++#if !defined(__FreeBSD__) + static int ttyGid; ++#else ++static gid_t ttyGid; ++static int ts; ++#endif + + void SetUtmp(char *tty) + { +-#ifdef linux + struct utmp utmp; + struct passwd *pw; + struct group *ttygrp; + char *tn; ++#if defined(__FreeBSD__) ++ struct ttyent *ttyp; ++ int fd, i; ++#endif + + pw = getpwuid(getuid()); + tn = rindex(tty, '/') + 1; + memset((char *)&utmp, 0, sizeof(utmp)); ++#if !defined(__FreeBSD__) + strncpy(utmp.ut_id, tn + 3, sizeof(utmp.ut_id)); + utmp.ut_type = DEAD_PROCESS; + setutent(); +@@ -66,21 +78,43 @@ + time(&(utmp.ut_time)); + pututline(&utmp); + endutent(); ++#else ++ time(&(utmp.ut_time)); ++ strncpy(utmp.ut_name, pw->pw_name, sizeof(utmp.ut_name)); ++ strncpy(utmp.ut_line, tn, sizeof(utmp.ut_line)); ++ setttyent(); ++ ts = 0; ++ for (i = 1; (ttyp = getttyent()); ++i) ++ if (!strcmp(ttyp->ty_name,tn)) { ++ ts = i; ++ break; ++ } ++ endttyent(); ++ if (ts > 0 && (fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) >= 0) { ++ lseek(fd, (ts*sizeof(struct utmp)), L_SET); ++ write(fd, &utmp, sizeof(struct utmp)); ++ close(fd); ++ } ++#endif + if ((ttygrp = getgrnam("tty")) != NULL) + ttyGid = ttygrp->gr_gid; + else + ttyGid = -1; + chmod(tty, 0622); + chown(tty, getuid(), ttyGid); +-#endif + } + + void ResetUtmp(char *tty) + { +-#ifdef linux ++#if !defined(__FreeBSD__) + struct utmp utmp, *utp; + char *tn; ++#else ++ struct utmp utmp; ++ int fd; ++#endif + ++#if !defined(__FreeBSD__) + tn = rindex(tty, '/') + 4; + memset((char *)&utmp, 0, sizeof(utmp)); + strncpy(utmp.ut_id, tn, sizeof(utmp.ut_id)); +@@ -93,7 +127,19 @@ + time(&(utp->ut_time)); + pututline(utp); + endutent(); ++#else ++ if (ts > 0 && (fd = open(_PATH_UTMP, O_RDWR, 0)) >= 0) { ++ lseek(fd, (ts*sizeof(struct utmp)), L_SET); ++ if (read(fd, &utmp, sizeof(struct utmp)) == sizeof(struct utmp)) { ++ bzero(utmp.ut_name, sizeof(utmp.ut_name)); ++ bzero(utmp.ut_host, sizeof(utmp.ut_host)); ++ time(&utmp.ut_time); ++ lseek(fd, (ts*sizeof(struct utmp)), L_SET); ++ write(fd, &utmp, sizeof(struct utmp)); ++ } ++ close(fd); ++ } ++#endif + chmod(tty, 0600); + chown(tty, 0, ttyGid); +-#endif + } diff --git a/korean/han/files/patch-ah b/korean/han/files/patch-ah new file mode 100644 index 000000000000..0db1f75c0c95 --- /dev/null +++ b/korean/han/files/patch-ah @@ -0,0 +1,23 @@ +--- src/display/vga.c.orig Wed Apr 9 21:34:02 1997 ++++ src/display/vga.c Sun Jul 16 12:52:41 2000 +@@ -379,7 +379,7 @@ + /* if (!code) return;*/ + VgaSetColor(fc); + if (bc & 0x8) *(vcls - dInfo.glineByte) = 0; +- for (x = 0;x < sbFReg->high;x ++, code ++, fm >>= 1) { ++ if (code) for (x = 0;x < sbFReg->high;x ++, code ++, fm >>= 1) { + if (*code) { + VgaOutByte(*code); + *gram = *gram; +@@ -617,7 +617,11 @@ + Perror("ioctl CONSOLE_IO_ENABLE/KDSETMODE"); + return FAILURE; + } ++#if (__FreeBSD__ <= 3) + if ((devMem = open("/dev/vga", O_RDWR|O_NDELAY) ) < 0) { ++#else ++ if ((devMem = open("/dev/mem", O_RDWR|O_NDELAY) ) < 0) { ++#endif + Perror("/dev/mem"); + return FAILURE; + } diff --git a/korean/han/files/patch-ak b/korean/han/files/patch-ak new file mode 100644 index 000000000000..bd724bb48035 --- /dev/null +++ b/korean/han/files/patch-ak @@ -0,0 +1,25 @@ +--- include/vt.h.orig Fri Jan 24 16:08:13 1997 ++++ include/vt.h Sat Aug 7 05:06:49 1999 +@@ -59,7 +59,12 @@ + ins, + active, + wrap, ++#if defined(__FreeBSD__) ++ text_mode, ++ cursor_key_mode; ++#else + text_mode; ++#endif + }; + + extern struct _con_info con; +@@ -75,6 +80,9 @@ + extern void VtStart(void); + extern void VtEmu(const char*, int nchars); + extern void VtCleanup(void); ++#if defined(__FreeBSD__) ++extern int cons25tovt100(u_char *buff, int len, const int max); ++#endif + + #define sjistojis(ch, cl)\ + {\ diff --git a/korean/han/files/patch-al b/korean/han/files/patch-al new file mode 100644 index 000000000000..5555214c56d5 --- /dev/null +++ b/korean/han/files/patch-al @@ -0,0 +1,159 @@ +--- src/vt.c.orig Sat Jan 25 17:55:02 1997 ++++ src/vt.c Sat Aug 7 05:09:15 1999 +@@ -185,6 +185,11 @@ + static void VtSetMode(u_char mode, bool sw) + { + switch(mode) { ++#if defined(__FreeBSD__) ++ case 1: ++ con.cursor_key_mode = sw; ++ break; ++#endif + case 4: + con.ins = sw; + break; +@@ -654,4 +659,144 @@ + con.sb = lInfo.sb; + con.db = lInfo.db|LATCH_1; + con.active = cInfo.sw = TRUE; ++#if defined(__FreeBSD__) ++ con.cursor_key_mode = FALSE; ++#endif + } ++ ++#if defined(__FreeBSD__) ++ ++static int ReplaceString(char *sp, const int len, const int maxlen, ++ const int oldlen, const char *newstr) ++{ ++ int newlen, copylen, diff; ++ ++ newlen = strlen(newstr); ++ diff = newlen - oldlen; ++ copylen = len - oldlen; ++ ++ if(len + diff > maxlen){ ++ diff -= (len + diff - maxlen); ++ copylen = maxlen - newlen; ++ } ++ if(copylen > 0) ++ memcpy(sp + newlen, sp + oldlen, copylen); ++ ++ copylen = newlen; ++ if(newlen > maxlen){ ++ copylen = maxlen; ++ diff = maxlen - len; ++ } ++ if(copylen > 0) ++ memcpy(sp, newstr, copylen); ++ ++ return(diff); ++} ++ ++int cons25tovt100(u_char *buff, int len, const int max) ++{ ++ u_char *p; ++ int i; ++ int newlen = len; ++ ++ p = buff; ++ ++ for(i=0; i + #include + +-void main(int argc, const char *argv[]) ++int main(int argc, const char *argv[]) + { + char *p; + diff --git a/korean/han/files/patch-bd b/korean/han/files/patch-bd new file mode 100644 index 000000000000..fe963c1be494 --- /dev/null +++ b/korean/han/files/patch-bd @@ -0,0 +1,37 @@ +--- src/vc.c.orig Fri Jun 9 04:14:43 2000 ++++ src/vc.c Fri Jun 9 04:27:53 2000 +@@ -95,28 +95,26 @@ + inline void blatch(void *head, int n) + { + +- __asm__("\t clc\n" ++ __asm__ volatile("\t clc\n" + "1:\n" + "\t andb %%bl, (%%eax)\n" + "\t incl %%eax\n" + "\t loop 1b\n" +- : +- : "eax" ((long)head), "bl" (0x7F), "c" (n) +- : "bl", "cx" ); ++ : "=bl" (head), "=c" (n) ++ : "eax" ((long)head), "0" (0x7F), "1" (n)); + } + + static + inline void llatch(void *head, int n) + { + +- __asm__("\t clc\n" ++ __asm__ volatile("\t clc\n" + "1:\n" + "\t andl %%ebx, (%%eax)\n" + "\t addl $4, %%eax\n" + "\t loop 1b\n" +- : +- : "eax" ((long)head), "ebx" (0x7F7F7F7F), "c" (n>>2) +- : "ebx", "cx" ); ++ : "=ebx" (head), "=c" (n) ++ : "eax" ((long)head), "0" (0x7F7F7F7F), "1" (n>>2)); + } + + static inline u_int TextAddress(u_int x, u_int y) diff --git a/korean/han/files/patch-be b/korean/han/files/patch-be new file mode 100644 index 000000000000..e85ef0e9a9a0 --- /dev/null +++ b/korean/han/files/patch-be @@ -0,0 +1,12 @@ +--- src/mouse.c.orig Mon Jan 27 20:40:27 1997 ++++ src/mouse.c Tue May 9 18:08:44 2000 +@@ -176,7 +176,8 @@ + + mouseType = MOUSE_NONE; + mInfo.has_mouse = FALSE; +- sscanf(config, "%s", name); ++ strncpy(name, config, MAX_COLS - 1); ++ name[MAX_COLS - 1] = '\0'; + for (p = mice; p->name != NULL; p++) { + if (strcasecmp(name, p->name) == 0) { + mouseType = p->type; diff --git a/korean/han/pkg-descr b/korean/han/pkg-descr index 47ad41dd1501..337d472ce0b3 100644 --- a/korean/han/pkg-descr +++ b/korean/han/pkg-descr @@ -1,17 +1,17 @@ -Han-1.0fb ---------- +HAN +--- HAN is a hangul console. This is an alpha version. Supported video card is VGA only, and, supported font are Minix/V and BDF. This program requires -shared memory. +shared memory. HAN is derived from KON, a Kanji COnsole for Linux/FreeBSD. This version supports ko_KR.euc. Orignal kon written by manabe@papilio.tutics.tut.ac.jp. FreeBSD port of kon is done by ogura@st.rim.or.jp. -Han written by nsroh@juno.kaist.ac.kr, hanmaum@baram.kaist.ac.kr. -FreeBSD port of han is done by yujeny@pandora.snu.ac.kr. +HAN written by nsroh@juno.kaist.ac.kr, hanmaum@baram.kaist.ac.kr. +FreeBSD port of HAN is done by yujeny@pandora.snu.ac.kr & cjh@FreeBSD.org. -- -Port by Choi Jun Ho +CHOI Junho -- cgit