Fix Bug 441203,449625,454228

This commit is contained in:
Ding-Yi Chen 2008-07-15 04:31:25 +00:00
parent e713dac411
commit 7809dc7f13
12 changed files with 563 additions and 340 deletions

View File

@ -1,2 +1,2 @@
zhcon-0.2.5.tar.gz
zhcon-0.2.5-to-0.2.6.diff.gz
zhcon_0.2.6-4.1.diff.gz
zhcon_0.2.6.orig.tar.gz

1
import.log Normal file
View File

@ -0,0 +1 @@
zhcon-0_2_6-9_el5:HEAD:zhcon-0.2.6-9.el5.src.rpm:1216096288

View File

@ -1,2 +1,2 @@
79e1c68aab8341e32129f61c1670baeb zhcon-0.2.5.tar.gz
971f68507f9c48a6b5cbee4ba0c1e2a6 zhcon-0.2.5-to-0.2.6.diff.gz
0357d334637fc2fecf042eb9043f8b69 zhcon_0.2.6-4.1.diff.gz
0f765cbe444776c9051a2b7c213737eb zhcon_0.2.6.orig.tar.gz

View File

@ -1,51 +0,0 @@
diff -r -u zhcon-0.2.5.orig/src/winime.cpp zhcon-0.2.5.new/src/winime.cpp
--- zhcon-0.2.5.orig/src/winime.cpp 2007-03-28 13:33:26.000000000 +0800
+++ zhcon-0.2.5.new/src/winime.cpp 2007-03-28 13:42:41.000000000 +0800
@@ -74,7 +74,7 @@
return false;
}
//add a word to candilist then push rp forward
-void WinIme::AddCandilist(char *&rp,unsigned int& buflen) {
+void WinIme::AddCandilist(char *&rp,unsigned long& buflen) {
assert(mpList->mCount < 10);
assert(!IsHzCode1(*rp)); //*rp is last matched latter
@@ -163,7 +163,7 @@
count--;
break;
}
- AddCandilist(t,(unsigned int&)buflen);
+ AddCandilist(t,(unsigned long&)buflen);
} //search next word
else {
if (len == 1) //special for first char
@@ -250,7 +250,7 @@
if (p == (char *) 0xffffffff)
found = false;
- p = (unsigned int) p + mpText;
+ p = (unsigned long) p + mpText;
} //2nd level index
else if (mNum == 1) {
int l = strlen(mHead.mCodeSet);
@@ -271,7 +271,7 @@
if (p == (char *) 0xffffffff)
found = false;
- p = (unsigned int) p + mpText;
+ p = (unsigned long) p + mpText;
} else if (mNum < mHead.mMaxCodes) {
p = mpOffset[mNum - 1];
if (p == (char *) 0xffffffff)
diff -r -u zhcon-0.2.5.orig/src/winime.h zhcon-0.2.5.new/src/winime.h
--- zhcon-0.2.5.orig/src/winime.h 2007-03-28 13:33:26.000000000 +0800
+++ zhcon-0.2.5.new/src/winime.h 2007-03-28 13:42:45.000000000 +0800
@@ -69,7 +69,7 @@
return c >= 0xA1 && c <= 0xFE;
}
- void AddCandilist(char*& p,unsigned& buflen);
+ void AddCandilist(char*& p,unsigned long& buflen);
void SkipNext(char*& rp);
int MatchWord(char* p, int len, int offset);
bool IsGB2312(char* p);

View File

@ -1,5 +1,5 @@
--- zhcon-0.2.5/tools/Makefile.am.flags 2006-04-25 01:38:46.000000000 +0900
+++ zhcon-0.2.5/tools/Makefile.am 2007-02-16 01:54:04.000000000 +0900
--- zhcon-0.2.6/tools/Makefile.am.flags 2006-04-25 01:38:46.000000000 +0900
+++ zhcon-0.2.6/tools/Makefile.am 2007-02-16 01:54:04.000000000 +0900
@@ -9,11 +9,6 @@
#getbpsf_LDADD = -L/usr/X11R6/lib -lX11
#getbpsf_CPPFLAGS = -I/usr/X11R6/include

327
zhcon-0.2.6-gcc43.patch Normal file
View File

@ -0,0 +1,327 @@
diff -up ./src/basefont.cpp.gcc43 ./src/basefont.cpp
--- ./src/basefont.cpp.gcc43 2006-04-25 02:38:27.000000000 +1000
+++ ./src/basefont.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -24,6 +24,7 @@
#include <sys/stat.h>
#include <stdexcept>
#include <cassert>
+#include <string.h>
#include "global.h"
#include "debug.h"
#include "hzdecoder.h"
diff -up ./src/big5decoder.cpp.gcc43 ./src/big5decoder.cpp
--- ./src/big5decoder.cpp.gcc43 2006-04-25 02:38:25.000000000 +1000
+++ ./src/big5decoder.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -27,7 +27,8 @@ bool BIG5Decoder::IsCode1(char c) {
}
bool BIG5Decoder::IsCode2(char c) {
- return c >= 40 && c <= 0xff;
+// return c >= 40 && c <= 0xff;
+ return c>=40;
}
unsigned int BIG5Decoder::Index(char c1, char c2) {
diff -up ./src/display/fblinear16.cpp.gcc43 ./src/display/fblinear16.cpp
--- ./src/display/fblinear16.cpp.gcc43 2006-04-25 02:38:24.000000000 +1000
+++ ./src/display/fblinear16.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -86,7 +86,8 @@ void FBLinear16::RevRect(int x1,int y1,i
for(; height--; dest += mNextLine) {
dest32 = (__u32*)dest;
for (cnt = width/2; cnt--;) {
- fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32++);
+ fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32);
+ dest32++;
}
if (width & 1) {
dest16 = (__u16*)dest32;
diff -up ./src/display/fblinear24.cpp.gcc43 ./src/display/fblinear24.cpp
--- ./src/display/fblinear24.cpp.gcc43 2006-04-25 02:38:23.000000000 +1000
+++ ./src/display/fblinear24.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -136,19 +136,25 @@ void FBLinear24::RevRect(int x1,int y1,i
for(; height--; dest += mNextLine) {
dest32 = (__u32*)dest;
for (cnt = width/4; cnt--;) {
- fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32++);
- fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32++);
- fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32++);
+ fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32);
+ dest32++;
+ fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32);
+ dest32++;
+ fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32);
+ dest32++;
}
if (width & 2) {
- fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32++);
+ fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32);
+ dest32++;
dest16 = (__u16*)dest32;
- fb_writew(fb_readw(dest16) ^ 0xffff, dest16++);
+ fb_writew(fb_readw(dest16) ^ 0xffff, dest16);
+ dest16++;
dest32 = (__u32*)dest16;
}
if (width & 1) {
dest16 = (__u16*)dest32;
- fb_writew(fb_readw(dest16) ^ 0xffff, dest16++);
+ fb_writew(fb_readw(dest16) ^ 0xffff, dest16);
+ dest16++;
dest8 = (__u8*)dest16;
fb_writeb(fb_readb(dest8) ^ 0xff, dest8);
}
diff -up ./src/display/fblinear32.cpp.gcc43 ./src/display/fblinear32.cpp
--- ./src/display/fblinear32.cpp.gcc43 2006-04-25 02:38:23.000000000 +1000
+++ ./src/display/fblinear32.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -74,7 +74,8 @@ void FBLinear32::RevRect(int x1,int y1,i
for(; height--; dest += mNextLine) {
dest32 = (__u32*)dest;
for (cnt = width; cnt--;) {
- fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32++);
+ fb_writel(fb_readl(dest32) ^ 0xffffffff, dest32);
+ dest32++;
}
}
}
diff -up ./src/display/fblinear4.cpp.gcc43 ./src/display/fblinear4.cpp
--- ./src/display/fblinear4.cpp.gcc43 2006-04-25 02:38:23.000000000 +1000
+++ ./src/display/fblinear4.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -19,6 +19,7 @@
#include <assert.h>
#include <endian.h>
+#include <string.h>
#include "global.h"
#include "fblinear4.h"
diff -up ./src/display/fblinear8.cpp.gcc43 ./src/display/fblinear8.cpp
--- ./src/display/fblinear8.cpp.gcc43 2006-04-25 02:38:23.000000000 +1000
+++ ./src/display/fblinear8.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -19,6 +19,7 @@
#include <assert.h>
#include <endian.h>
+#include <string.h>
#include "global.h"
#include "fblinear8.h"
@@ -63,11 +64,13 @@ void FBLinear8::RevRect(int x1,int y1,in
for(; height--; dest += mNextLine) {
dest32 = (__u32*)dest;
for (cnt = width/4; cnt--;) {
- fb_writel(fb_readl(dest32) ^ 0x0f0f0f0f, dest32++);
+ fb_writel(fb_readl(dest32) ^ 0x0f0f0f0f, dest32);
+ dest32++;
}
if (width & 2) {
dest16 = (__u16*)dest32;
- fb_writew(fb_readw(dest16) ^ 0x0f0f, dest16++);
+ fb_writew(fb_readw(dest16) ^ 0x0f0f, dest16);
+ dest16++;
dest32 = (__u32*)dest16;
}
if (width & 1) {
diff -up ./src/display/fbvgaplanes.cpp.gcc43 ./src/display/fbvgaplanes.cpp
--- ./src/display/fbvgaplanes.cpp.gcc43 2006-04-25 02:38:23.000000000 +1000
+++ ./src/display/fbvgaplanes.cpp 2008-07-15 12:53:18.000000000 +1000
@@ -22,6 +22,7 @@
#ifdef USING_VGA
#include <assert.h>
#include <unistd.h>
+#include <string.h>
#include "debug.h"
#include "fbvgaplanes.h"
diff -up ./src/encfilter.c.gcc43 ./src/encfilter.c
--- ./src/encfilter.c.gcc43 2006-04-29 05:09:33.000000000 +1000
+++ ./src/encfilter.c 2008-07-15 12:31:16.000000000 +1000
@@ -37,6 +37,7 @@
#include <stdlib.h>
#include <errno.h>
#include <assert.h>
+#include <string.h>
#include "encfilter.h"
@@ -46,7 +47,9 @@
#error ICONV_CONST not defined
#endif /* ICONV_CONST */
-#define BUFSIZ 8192
+#ifndef BUFSIZ
+# define BUFSIZ 8192
+#endif
int UseEncodingFilter; /* use filter such as UTF-8 */
char EncodingFilterBuff[BUFSIZ]; /* global buffer used by ConsoleHandler() and TextCopy() */
size_t EncodingFilterLen;
diff -up ./src/gbkdecoder.cpp.gcc43 ./src/gbkdecoder.cpp
--- ./src/gbkdecoder.cpp.gcc43 2006-04-25 02:38:27.000000000 +1000
+++ ./src/gbkdecoder.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -27,13 +27,15 @@ bool GBKDecoder::IsCode1(char c) {
}
bool GBKDecoder::IsCode2(char c) {
- return c >= 0x40 && c <= 0xff;
+// return c >= 0x40 && c <= 0xff;
+ return c>=0x40;
}
unsigned int GBKDecoder::Index(char c1, char c2) {
int n;
n = (c1 - 0x81) * 192;
- if (c2 <= 0xff && c2 >= 0x40)
+ // if (c2 <= 0xff && c2 >= 0x40)
+ if (c2 >= 0x40)
n += (c2 - 0x40);
return n;
}
diff -up ./src/graphdev.cpp.gcc43 ./src/graphdev.cpp
--- ./src/graphdev.cpp.gcc43 2006-04-25 02:38:26.000000000 +1000
+++ ./src/graphdev.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -20,12 +20,14 @@
#include <config.h>
#endif
+#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <assert.h>
#include <iostream>
+#include <string.h>
#include "debug.h"
#include "display/fbdev.h"
diff -up ./src/iconv_string.c.gcc43 ./src/iconv_string.c
--- ./src/iconv_string.c.gcc43 2006-04-25 02:38:27.000000000 +1000
+++ ./src/iconv_string.c 2008-07-15 12:31:16.000000000 +1000
@@ -69,7 +69,7 @@ int iconv_string (const char* tocode, co
{
size_t count = 0;
char tmpbuf[tmpbufsize];
- const char* inptr = start;
+ char* inptr = (char *) start;
size_t insize = end-start;
while (insize > 0) {
char* outptr = tmpbuf;
@@ -121,7 +121,7 @@ int iconv_string (const char* tocode, co
iconv(cd,NULL,NULL,NULL,NULL); /* return to the initial state */
/* Do the conversion for real. */
{
- const char* inptr = start;
+ char* inptr = (char *) start;
size_t insize = end-start;
char* outptr = result;
size_t outsize = length;
diff -up ./src/inputclient.cpp.gcc43 ./src/inputclient.cpp
--- ./src/inputclient.cpp.gcc43 2006-04-25 02:38:27.000000000 +1000
+++ ./src/inputclient.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -16,6 +16,7 @@
* *
***************************************************************************/
+#include <stdlib.h>
#include "inputclient.h"
Console* InputClient::mpCon = NULL;
diff -up ./src/inputmanager.cpp.gcc43 ./src/inputmanager.cpp
--- ./src/inputmanager.cpp.gcc43 2006-05-03 03:18:39.000000000 +1000
+++ ./src/inputmanager.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -24,6 +24,7 @@ using namespace std;
#include <unistd.h>
#include <sys/time.h>
#include <string>
+#include <stdlib.h>
#include "global.h"
#include "debug.h"
--- ./src/inputmanager.h.gcc43 2006-04-25 02:38:26.000000000 +1000
+++ ./src/inputmanager.h 2008-07-15 12:31:16.000000000 +1000
@@ -26,6 +26,7 @@
using namespace std;
#include <cassert>
#include <vector>
+#include <sys/select.h>
#include "mouse.h"
#if defined(__FreeBSD__)
--- ./src/nativeinputserver.h.gcc43 2006-04-25 02:38:26.000000000 +1000
+++ ./src/nativeinputserver.h 2008-07-15 12:31:16.000000000 +1000
@@ -62,7 +62,7 @@ class NativeInputServer : public InputSe
bool mAutoSelectUnique;
static struct Symbol {
char mKey;
- char *mpSymbol;
+ const char *mpSymbol;
}
mFullSymbolTable[];
static char mFullCharTable[];
--- ./src/window.cpp.gcc43 2006-04-25 02:38:25.000000000 +1000
+++ ./src/window.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -20,6 +20,8 @@
#include <algorithm>
#include <sys/time.h>
#include <algorithm>
+#include <stdlib.h>
+#include <string.h>
#include "global.h"
#include "debug.h"
#include "window.h"
--- ./src/winime.cpp.gcc43 2008-07-15 12:31:15.000000000 +1000
+++ ./src/winime.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -47,7 +47,7 @@ mCandilistBufLen(0)
throw (runtime_error("can not get gbfont size!"));
mBufSize = st.st_size;
- mpBuf = (char *) mmap(0, mBufSize, PROT_READ, MAP_SHARED, mFd, 0);
+ mpBuf = (char *) mmap(NULL, mBufSize, PROT_READ, MAP_SHARED, mFd, 0);
if (mpBuf == MAP_FAILED)
throw (runtime_error("mmap failed!"));
@@ -163,7 +163,8 @@ int WinIme::MatchWord(char *p, int len,
count--;
break;
}
- AddCandilist(t,(unsigned int&)buflen);
+ unsigned int buflength=buflen;
+ AddCandilist(t,(unsigned int&)buflength);
} //search next word
else {
if (len == 1) //special for first char
--- ./src/zhcon.cpp.gcc43 2008-07-15 12:31:15.000000000 +1000
+++ ./src/zhcon.cpp 2008-07-15 12:31:16.000000000 +1000
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <cstdlib>
#include <cstdio>
+#include <string.h>
#include <sys/ioctl.h>
#if defined(linux)
@@ -452,9 +457,11 @@ void Zhcon::InitTty() {
return;
}
char *pCap = mCapBuf;
- mpCapClearScr = tgetstr("cl", &pCap);
- mpCapCursorOff = tgetstr("vi", &pCap);
- mpCapCursorOn = tgetstr("ve", &pCap);
+ char ids[][3]={"cl","vi","ve"};
+
+ mpCapClearScr = tgetstr(ids[0], &pCap);
+ mpCapCursorOff = tgetstr(ids[1], &pCap);
+ mpCapCursorOn = tgetstr(ids[2], &pCap);
if (mpCapClearScr) write(mConFd, mpCapClearScr, strlen(mpCapClearScr));
if (mpCapCursorOff) write(mConFd, mpCapCursorOff, strlen(mpCapCursorOff));
--- src/display/vgadev.cpp.gcc43 2008-07-15 14:10:33.000000000 +1000
+++ src/display/vgadev.cpp 2008-07-15 14:10:57.000000000 +1000
@@ -33,6 +33,7 @@
#include <sys/mman.h>
#include <sys/io.h>
#include <cassert>
+#include <string.h>
#include "debug.h"
#include "vgadev.h"
#include "lrmi.h"

View File

@ -0,0 +1,49 @@
--- ./src/zhcon.cpp.keyswitch 2008-07-14 16:17:53.000000000 +1000
+++ ./src/zhcon.cpp 2008-07-14 16:20:16.000000000 +1000
@@ -132,6 +132,10 @@
//the InitXXX sequence is important,do not change
//unless you know what you are doing
InitTty();
+
+ /* Set to K_XLATE (ascii) */
+ ioctl(0, KDSKBMODE, K_XLATE);
+
// set blank line height, must before init font
InitGraphDev(f);
GraphMode();
--- ./src/inputmanager.cpp.keyswitch 2008-07-14 16:14:10.000000000 +1000
+++ ./src/inputmanager.cpp 2008-07-14 16:23:45.000000000 +1000
@@ -101,9 +101,12 @@
struct timeval tv;
int rcved, shift;
+ bool ctrlShiftPressed=false;
shift = GetShiftState();
- if (shift != 0) {
+ if (shift ==5){
+ /* Ctrl-Shift Pressed */
+ ctrlShiftPressed=true;
//printf("Shift stat %d\r\n", s);
}
@@ -120,7 +123,7 @@
tv.tv_sec = 0;
tv.tv_usec = 100000; /* 0.1 sec */
rcved = select(FD_SETSIZE, &mFdSet, NULL, NULL, &tv);
- if (rcved <= 0)
+ if (rcved <= 0 && !ctrlShiftPressed)
return;
#ifdef HAVE_GPM_H
@@ -154,7 +157,9 @@
mOutputRead = 0;
}
}
- }
+ }else if (ctrlShiftPressed){
+ DoCtrlShift();
+ }
if (FD_ISSET(mTtyFd, &mFdSet)) {
mInputRead += read(mTtyFd, mInputBuf+mInputRead, BUFSIZE-mInputRead);

69
zhcon-0.2.6-locale.patch Normal file
View File

@ -0,0 +1,69 @@
--- ./src/zhcon.h.locale 2008-07-14 11:14:23.000000000 +1000
+++ ./src/zhcon.h 2008-07-14 11:08:09.000000000 +1000
@@ -27,6 +27,10 @@
#include <string>
#include "global.h"
#include "cmdline.h"
+#define LOCALE_STR_UTF8 "utf8"
+#define LOCALE_STR_GB2312 "gb2312"
+#define LOCALE_STR_GBK "gbk"
+#define LOCALE_STR_BIG5 "big5"
using namespace std;
--- ./src/zhcon.cpp.locale 2008-07-14 11:21:29.000000000 +1000
+++ ./src/zhcon.cpp 2008-07-14 11:37:28.000000000 +1000
@@ -485,13 +485,13 @@
f = new BaseFont(mGB2312Font, 16, 16);
h = new GBDecoder();
}
- locale = "zh_CN.GB2312";
+ locale = "zh_CN." LOCALE_STR_GB2312;
break;
case GBK:
assert(font == GBK);
f = new BaseFont(mGBKFont, 16, 16);
h = new GBKDecoder();
- locale = "zh_CN.GBK";
+ locale = "zh_CN." LOCALE_STR_GBK;
break;
case BIG5:
assert(font == GB2312 || font == BIG5);
@@ -502,7 +502,7 @@
f = new BaseFont(mBIG5Font, 16, 16);
h = new BIG5Decoder();
}
- locale = "zh_TW.Big5";
+ locale = "zh_TW." LOCALE_STR_BIG5;
break;
case JIS:
assert(font == e);
@@ -647,22 +647,22 @@
setenv("LC_ALL", "zh_CN.EUC", 1);
#else
if (mArgs.utf8_flag)
- setenv("LC_ALL", "zh_CN.UTF-8", 1);
+ setenv("LC_ALL", "zh_CN." LOCALE_STR_UTF8, 1);
else
- setenv("LC_ALL", "zh_CN.GB2312", 1);
+ setenv("LC_ALL", "zh_CN." LOCALE_STR_GB2312, 1);
#endif
mDefaultEncode = GB2312;
} else if (s == "gbk") {
if (mArgs.utf8_flag)
- setenv("LC_ALL", "zh_CN.UTF-8", 1);
+ setenv("LC_ALL", "zh_CN." LOCALE_STR_UTF8, 1);
else
- setenv("LC_ALL", "zh_CN.GBK", 1);
+ setenv("LC_ALL", "zh_CN." LOCALE_STR_GBK, 1);
mDefaultEncode = GBK;
} else if (s == "big5") {
if (mArgs.utf8_flag)
- setenv("LC_ALL", "zh_TW.UTF-8", 1);
+ setenv("LC_ALL", "zh_TW." LOCALE_STR_UTF8, 1);
else
- setenv("LC_ALL", "zh_TW.Big5", 1);
+ setenv("LC_ALL", "zh_TW." LOCALE_STR_BIG5, 1);
mDefaultEncode = BIG5;
} else if (s == "jis") {
//SetEncode(JIS,JIS);

View File

@ -1,5 +1,19 @@
--- zhcon-0.2.5/configure.in.path_define 2007-02-16 03:47:08.000000000 +0900
+++ zhcon-0.2.5/configure.in 2007-02-16 03:48:31.000000000 +0900
--- ./doc/Makefile.am.path-define 2006-05-03 03:57:18.000000000 +1000
+++ ./doc/Makefile.am 2008-07-15 10:48:01.000000000 +1000
@@ -3,8 +3,8 @@
EXTRA_DIST = zhcon.1.in poem.big5 poem.gb poem.gb.utf8 bpsf.txt manual.tex manual.dvi manual.ps README.html default.css html.tar.gz
install-data-local:
- $(mkinstalldirs) $(mandir)/man1/
- $(INSTALL_DATA) $(top_builddir)/doc/zhcon.1 $(mandir)/man1/zhcon.1
+ $(mkinstalldirs) $(DESTDIR)$(mandir)/man1/
+ $(INSTALL_DATA) $(top_builddir)/doc/zhcon.1 $(DESTDIR)$(mandir)/man1/zhcon.1
uninstall-local:
- -rm -f $(mandir)/man1/zhcon.1
+ -rm -f $(DESTDIR)$(mandir)/man1/zhcon.1
--- ./configure.in.path-define 2006-07-06 04:20:09.000000000 +1000
+++ ./configure.in 2008-07-15 10:48:01.000000000 +1000
@@ -175,6 +175,16 @@
AC_CHECK_LIB(gpm,main,,usegpm="no")
@ -26,74 +40,61 @@
Config complete, now type make to build zhcon.
Good Luck!
--- zhcon-0.2.5/font/Makefile.am.path_define 2007-02-16 03:47:08.000000000 +0900
+++ zhcon-0.2.5/font/Makefile.am 2007-02-16 03:47:08.000000000 +0900
--- ./font/Makefile.am.path-define 2006-04-25 02:39:04.000000000 +1000
+++ ./font/Makefile.am 2008-07-15 10:48:01.000000000 +1000
@@ -1,8 +1,8 @@
EXTRA_DIST = *.bpsf
install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(libdir)/zhcon/font/
- $(INSTALL_DATA) $(srcdir)/*.bpsf $(DESTDIR)$(libdir)/zhcon/font/
- $(mkinstalldirs) $(libdir)/zhcon/font/
- $(INSTALL_DATA) $(srcdir)/*.bpsf $(libdir)/zhcon/font/
+ $(mkinstalldirs) $(DESTDIR)$(datadir)/zhcon/font/
+ $(INSTALL_DATA) $(srcdir)/*.bpsf $(DESTDIR)$(datadir)/zhcon/font/
uninstall-local:
- -rm -f $(DESTDIR)$(libdir)/zhcon/font/*.bpsf
- -rm -f $(libdir)/zhcon/font/*.bpsf
+ -rm -f $(DESTDIR)$(datadir)/zhcon/font/*.bpsf
--- zhcon-0.2.5/input/Makefile.am.path_define 2007-02-16 03:47:08.000000000 +0900
+++ zhcon-0.2.5/input/Makefile.am 2007-02-16 03:47:08.000000000 +0900
--- ./input/Makefile.am.path-define 2006-04-25 02:38:44.000000000 +1000
+++ ./input/Makefile.am 2008-07-15 10:48:01.000000000 +1000
@@ -1,8 +1,8 @@
EXTRA_DIST = *.mb
install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(libdir)/zhcon/input/
- $(INSTALL_DATA) $(srcdir)/*.mb $(DESTDIR)$(libdir)/zhcon/input/
- $(mkinstalldirs) $(libdir)/zhcon/input/
- $(INSTALL_DATA) $(srcdir)/*.mb $(libdir)/zhcon/input/
+ $(mkinstalldirs) $(DESTDIR)$(datadir)/zhcon/input/
+ $(INSTALL_DATA) $(srcdir)/*.mb $(DESTDIR)$(datadir)/zhcon/input/
uninstall-local:
- -rm -f $(DESTDIR)$(libdir)/zhcon/input/*.mb
- -rm -f $(libdir)/zhcon/input/*.mb
+ -rm -f $(DESTDIR)$(datadir)/zhcon/input/*.mb
--- zhcon-0.2.5/src/Makefile.am.path_define 2007-02-16 03:47:08.000000000 +0900
+++ zhcon-0.2.5/src/Makefile.am 2007-02-16 03:47:08.000000000 +0900
@@ -11,11 +11,11 @@
chmod 4755 $(DESTDIR)$(bindir)/zhcon
--- ./src/zhcon.conf.path-define 2008-07-15 11:15:09.000000000 +1000
+++ ./src/zhcon.conf 2008-07-15 11:16:36.000000000 +1000
@@ -2,10 +2,10 @@
#it can be named as ~/.zhconrc or /etc/zhcon.conf
#you can edit it manually
install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(prefix)/etc
- $(INSTALL_DATA) $(srcdir)/zhcon.conf $(DESTDIR)$(prefix)/etc/zhcon.conf
+ $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
+ $(INSTALL_DATA) $(srcdir)/zhcon.conf $(DESTDIR)$(sysconfdir)/zhcon.conf
-zhconpath = /usr/lib/zhcon/
+zhconpath = /usr/share/zhcon/
uninstall-local:
- -rm -f $(DESTDIR)$(prefix)/etc/zhcon.conf
+ -rm -f $(DESTDIR)$(sysconfdir)/zhcon.conf
#unicon(3.x) path
-uniconpath = /usr/lib/unicon/
+uniconpath = /usr/share/unicon/
# set the include path found by configure
INCLUDES= $(all_includes)
--- zhcon-0.2.5/src/nativeinputserver.cpp.path_define 2006-04-25 01:38:27.000000000 +0900
+++ zhcon-0.2.5/src/nativeinputserver.cpp 2007-02-16 03:47:08.000000000 +0900
@@ -30,7 +30,7 @@
#include "nativeinputserver.h"
#include "keymap.h"
-string NativeInputServer::mDataPath = PREFIX"/lib/zhcon/";
+string NativeInputServer::mDataPath = DATADIR"/zhcon/";
NativeInputServer::Symbol NativeInputServer::mFullSymbolTable[] = {
{'.', "¡£"}
--- zhcon-0.2.5/src/zhcon.cpp.path_define 2007-02-16 03:47:08.000000000 +0900
+++ zhcon-0.2.5/src/zhcon.cpp 2007-02-16 03:47:08.000000000 +0900
@@ -123,7 +123,7 @@
#defaultencode: default encoding can be :gb2312,gbk,big5,jis,ksc
defaultencode = gb2312
--- ./src/zhcon.cpp.path-define 2008-07-15 10:48:01.000000000 +1000
+++ ./src/zhcon.cpp 2008-07-15 10:49:15.000000000 +1000
@@ -123,7 +124,7 @@
string cfgfile = getenv("HOME");
cfgfile += "/.zhconrc";
if (access(cfgfile.c_str(), R_OK) != 0)
- cfgfile = PREFIX "/etc/zhcon.conf";
- cfgfile = "/etc/zhcon.conf";
+ cfgfile = SYSCONFDIR "/zhcon.conf";
//for debug,a pause enable us to attach zhcon's pid in gdb
//char c;cin>>c;
@@ -621,7 +621,7 @@
@@ -621,7 +628,7 @@
if (getenv("LC_ALL"))
mOldLocale = getenv("LC_ALL");
@ -102,7 +103,7 @@
mASCIIFont = prefix + f.GetOption(string("ascfont"), string(ASCIIFONT));
mGB2312Font = prefix + f.GetOption(string("gbfont"), string(GB2312FONT));
mGBKFont = prefix + f.GetOption(string("gbkfont"), string(GBKFONT));
@@ -752,10 +752,10 @@
@@ -752,10 +759,10 @@
InputManager::SetTty(mConFd, ttyno, mTtyFd);
string s;
@ -115,3 +116,35 @@
UniconInputServer::SetDataPath(s);
#endif
string sOverSpot, sNativeBar;
--- ./src/nativeinputserver.cpp.path-define 2006-04-25 02:38:27.000000000 +1000
+++ ./src/nativeinputserver.cpp 2008-07-15 10:48:01.000000000 +1000
@@ -30,7 +30,7 @@
#include "nativeinputserver.h"
#include "keymap.h"
-string NativeInputServer::mDataPath = PREFIX"/lib/zhcon/";
+string NativeInputServer::mDataPath = DATADIR"/zhcon/";
NativeInputServer::Symbol NativeInputServer::mFullSymbolTable[] = {
{'.', "¡£"}
--- ./src/Makefile.am.path-define 2006-05-03 03:12:41.000000000 +1000
+++ ./src/Makefile.am 2008-07-15 10:48:01.000000000 +1000
@@ -8,14 +8,14 @@
SUBDIRS = display
install-exec-local:
- chmod 4755 $(bindir)/zhcon
+ chmod 4755 $(DESTDIR)$(bindir)/zhcon
install-data-local:
- $(mkinstalldirs) $(prefix)/etc
- $(INSTALL_DATA) $(srcdir)/zhcon.conf $(prefix)/etc/zhcon.conf
+ $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
+ $(INSTALL_DATA) $(srcdir)/zhcon.conf $(DESTDIR)$(sysconfdir)/zhcon.conf
uninstall-local:
- -rm -f $(prefix)/etc/zhcon.conf
+ -rm -f $(DESTDIR)$(sysconfdir)/zhcon.conf
# set the include path found by configure
INCLUDES= $(all_includes)

View File

@ -1,67 +0,0 @@
diff -ru zhcon-0.2.5/doc/Makefile.am zhcon-0.2.6/doc/Makefile.am
--- zhcon-0.2.5/doc/Makefile.am 2006-05-03 01:57:18.000000000 +0800
+++ zhcon-0.2.6/doc/Makefile.am 2007-02-12 17:46:12.000000000 +0800
@@ -3,8 +3,8 @@
EXTRA_DIST = zhcon.1.in poem.big5 poem.gb poem.gb.utf8 bpsf.txt manual.tex manual.dvi manual.ps README.html default.css html.tar.gz
install-data-local:
- $(mkinstalldirs) $(mandir)/man1/
- $(INSTALL_DATA) $(top_builddir)/doc/zhcon.1 $(mandir)/man1/zhcon.1
+ $(mkinstalldirs) $(DESTDIR)$(mandir)/man1/
+ $(INSTALL_DATA) $(top_builddir)/doc/zhcon.1 $(DESTDIR)$(mandir)/man1/zhcon.1
uninstall-local:
- -rm -f $(mandir)/man1/zhcon.1
+ -rm -f $(DESTDIR)$(mandir)/man1/zhcon.1
diff -ru zhcon-0.2.5/font/Makefile.am zhcon-0.2.6/font/Makefile.am
--- zhcon-0.2.5/font/Makefile.am 2006-04-25 00:39:04.000000000 +0800
+++ zhcon-0.2.6/font/Makefile.am 2007-02-12 17:47:32.000000000 +0800
@@ -1,8 +1,8 @@
EXTRA_DIST = *.bpsf
install-data-local:
- $(mkinstalldirs) $(libdir)/zhcon/font/
- $(INSTALL_DATA) $(srcdir)/*.bpsf $(libdir)/zhcon/font/
+ $(mkinstalldirs) $(DESTDIR)$(libdir)/zhcon/font/
+ $(INSTALL_DATA) $(srcdir)/*.bpsf $(DESTDIR)$(libdir)/zhcon/font/
uninstall-local:
- -rm -f $(libdir)/zhcon/font/*.bpsf
+ -rm -f $(DESTDIR)$(libdir)/zhcon/font/*.bpsf
diff -ru zhcon-0.2.5/input/Makefile.am zhcon-0.2.6/input/Makefile.am
--- zhcon-0.2.5/input/Makefile.am 2006-04-25 00:38:44.000000000 +0800
+++ zhcon-0.2.6/input/Makefile.am 2007-02-12 17:48:22.000000000 +0800
@@ -1,8 +1,8 @@
EXTRA_DIST = *.mb
install-data-local:
- $(mkinstalldirs) $(libdir)/zhcon/input/
- $(INSTALL_DATA) $(srcdir)/*.mb $(libdir)/zhcon/input/
+ $(mkinstalldirs) $(DESTDIR)$(libdir)/zhcon/input/
+ $(INSTALL_DATA) $(srcdir)/*.mb $(DESTDIR)$(libdir)/zhcon/input/
uninstall-local:
- -rm -f $(libdir)/zhcon/input/*.mb
+ -rm -f $(DESTDIR)$(libdir)/zhcon/input/*.mb
diff -ru zhcon-0.2.5/src/Makefile.am zhcon-0.2.6/src/Makefile.am
--- zhcon-0.2.5/src/Makefile.am 2006-05-03 01:12:41.000000000 +0800
+++ zhcon-0.2.6/src/Makefile.am 2007-02-12 17:45:59.000000000 +0800
@@ -8,14 +8,14 @@
SUBDIRS = display
install-exec-local:
- chmod 4755 $(bindir)/zhcon
+ chmod 4755 $(DESTDIR)$(bindir)/zhcon
install-data-local:
- $(mkinstalldirs) $(prefix)/etc
- $(INSTALL_DATA) $(srcdir)/zhcon.conf $(prefix)/etc/zhcon.conf
+ $(mkinstalldirs) $(DESTDIR)$(prefix)/etc
+ $(INSTALL_DATA) $(srcdir)/zhcon.conf $(DESTDIR)$(prefix)/etc/zhcon.conf
uninstall-local:
- -rm -f $(prefix)/etc/zhcon.conf
+ -rm -f $(DESTDIR)$(prefix)/etc/zhcon.conf
# set the include path found by configure
INCLUDES= $(all_includes)

View File

@ -1,154 +0,0 @@
Only in zhcon-0.2.5: config.h
Only in zhcon-0.2.5: config.log
Only in zhcon-0.2.5: config.status
Only in zhcon-0.2.5/debian: Makefile
Only in zhcon-0.2.5/doc: Makefile
Only in zhcon-0.2.5/doc: zhcon.1
Only in zhcon-0.2.5/font: Makefile
Only in zhcon-0.2.5/input: Makefile
Only in zhcon-0.2.5: Makefile
diff -u -r zhcon-0.2.5/src/basefont.cpp zhcon-0.2.5.fix/src/basefont.cpp
--- zhcon-0.2.5/src/basefont.cpp 2006-04-25 00:38:27.000000000 +0800
+++ zhcon-0.2.5.fix/src/basefont.cpp 2008-02-26 17:00:11.000000000 +0800
@@ -16,6 +16,7 @@
* *
***************************************************************************/
+#include <cstring>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
Only in zhcon-0.2.5/src: .deps
Only in zhcon-0.2.5/src/display: .deps
Only in zhcon-0.2.5/src/display: fbdev.o
Only in zhcon-0.2.5/src/display: fblinear15.o
Only in zhcon-0.2.5/src/display: fblinear16.o
Only in zhcon-0.2.5/src/display: fblinear24.o
Only in zhcon-0.2.5/src/display: fblinear32.o
diff -u -r zhcon-0.2.5/src/display/fblinear4.cpp zhcon-0.2.5.fix/src/display/fblinear4.cpp
--- zhcon-0.2.5/src/display/fblinear4.cpp 2006-04-25 00:38:23.000000000 +0800
+++ zhcon-0.2.5.fix/src/display/fblinear4.cpp 2008-03-03 14:10:32.000000000 +0800
@@ -17,6 +17,7 @@
* *
***************************************************************************/
+#include <string.h>
#include <assert.h>
#include <endian.h>
#include "global.h"
diff -u -r zhcon-0.2.5/src/display/fblinear8.cpp zhcon-0.2.5.fix/src/display/fblinear8.cpp
--- zhcon-0.2.5/src/display/fblinear8.cpp 2006-04-25 00:38:23.000000000 +0800
+++ zhcon-0.2.5.fix/src/display/fblinear8.cpp 2008-02-26 16:59:23.000000000 +0800
@@ -17,6 +17,7 @@
* *
***************************************************************************/
+#include <cstring>
#include <assert.h>
#include <endian.h>
#include "global.h"
diff -u -r zhcon-0.2.5/src/display/fbvgaplanes.cpp zhcon-0.2.5.fix/src/display/fbvgaplanes.cpp
--- zhcon-0.2.5/src/display/fbvgaplanes.cpp 2006-04-25 00:38:23.000000000 +0800
+++ zhcon-0.2.5.fix/src/display/fbvgaplanes.cpp 2008-02-26 16:59:36.000000000 +0800
@@ -19,6 +19,7 @@
#include <config.h>
#endif
+#include <cstring>
#ifdef USING_VGA
#include <assert.h>
#include <unistd.h>
Only in zhcon-0.2.5/src/display: Makefile
diff -u -r zhcon-0.2.5/src/display/vgadev.cpp zhcon-0.2.5.fix/src/display/vgadev.cpp
--- zhcon-0.2.5/src/display/vgadev.cpp 2008-02-26 16:25:27.000000000 +0800
+++ zhcon-0.2.5.fix/src/display/vgadev.cpp 2008-02-26 16:59:57.000000000 +0800
@@ -23,6 +23,7 @@
#endif
+#include <cstring>
#ifdef USING_VGA
#if defined(linux)
diff -u -r zhcon-0.2.5/src/graphdev.cpp zhcon-0.2.5.fix/src/graphdev.cpp
--- zhcon-0.2.5/src/graphdev.cpp 2006-04-25 00:38:26.000000000 +0800
+++ zhcon-0.2.5.fix/src/graphdev.cpp 2008-02-26 17:00:19.000000000 +0800
@@ -20,6 +20,8 @@
#include <config.h>
#endif
+#include <cstring>
+#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
diff -u -r zhcon-0.2.5/src/inputclient.cpp zhcon-0.2.5.fix/src/inputclient.cpp
--- zhcon-0.2.5/src/inputclient.cpp 2006-04-25 00:38:27.000000000 +0800
+++ zhcon-0.2.5.fix/src/inputclient.cpp 2008-02-26 17:00:59.000000000 +0800
@@ -16,6 +16,7 @@
* *
***************************************************************************/
+#include <stdlib.h>
#include "inputclient.h"
Console* InputClient::mpCon = NULL;
diff -u -r zhcon-0.2.5/src/inputmanager.cpp zhcon-0.2.5.fix/src/inputmanager.cpp
--- zhcon-0.2.5/src/inputmanager.cpp 2006-05-03 01:18:39.000000000 +0800
+++ zhcon-0.2.5.fix/src/inputmanager.cpp 2008-02-26 17:00:52.000000000 +0800
@@ -21,6 +21,7 @@
using namespace std;
+#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
#include <string>
diff -u -r zhcon-0.2.5/src/inputmanager.h zhcon-0.2.5.fix/src/inputmanager.h
--- zhcon-0.2.5/src/inputmanager.h 2006-04-25 00:38:26.000000000 +0800
+++ zhcon-0.2.5.fix/src/inputmanager.h 2008-02-26 17:01:08.000000000 +0800
@@ -24,6 +24,7 @@
*@author ejoy
*/
using namespace std;
+#include <sys/select.h>
#include <cassert>
#include <vector>
Only in zhcon-0.2.5/src: Makefile
diff -u -r zhcon-0.2.5/src/window.cpp zhcon-0.2.5.fix/src/window.cpp
--- zhcon-0.2.5/src/window.cpp 2006-04-25 00:38:25.000000000 +0800
+++ zhcon-0.2.5.fix/src/window.cpp 2008-02-26 17:00:29.000000000 +0800
@@ -16,6 +16,7 @@
* *
***************************************************************************/
+#include <cstring>
#include <cassert>
#include <algorithm>
#include <sys/time.h>
diff -u -r zhcon-0.2.5/src/winime.cpp zhcon-0.2.5.fix/src/winime.cpp
--- zhcon-0.2.5/src/winime.cpp 2008-02-26 16:25:27.000000000 +0800
+++ zhcon-0.2.5.fix/src/winime.cpp 2008-02-26 17:00:35.000000000 +0800
@@ -16,6 +16,7 @@
* *
***************************************************************************/
+#include <cstring>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff -u -r zhcon-0.2.5/src/zhcon.cpp zhcon-0.2.5.fix/src/zhcon.cpp
--- zhcon-0.2.5/src/zhcon.cpp 2008-02-26 16:25:27.000000000 +0800
+++ zhcon-0.2.5.fix/src/zhcon.cpp 2008-02-26 17:00:44.000000000 +0800
@@ -19,6 +19,7 @@
#include <config.h>
#endif
+#include <cstring>
#include <iostream>
#include <unistd.h>
#include <cstdlib>
Only in zhcon-0.2.5: stamp-h1
Only in zhcon-0.2.5/tools: .deps
Only in zhcon-0.2.5/tools: Makefile

View File

@ -1,41 +1,52 @@
Name: zhcon
Summary: A Fast Console CJK System Using FrameBuffer
Version: 0.2.6
Release: 8%{?dist}
Release: 9%{?dist}
Group: Applications/System
License: GPL
License: GPLv2+
URL: http://www.sourceforge.net/projects/%{name}/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-0.2.5.tar.gz
Patch0: http://downloads.sourceforge.net/%{name}/%{name}-0.2.5-to-0.2.6.diff.gz
Patch1: zhcon-0.2.6-path.patch
Patch2: zhcon-0.2.6-path-define.patch
Patch3: zhcon-0.2.6-flags.patch
Patch4: zhcon-0.2.6-64bit-fix.patch
Patch5: zhcon-0.2.6.gcc43.patch
Source0: http://ftp.debian.org/debian/pool/main/z/zhcon/%{name}_%{version}.orig.tar.gz
Patch0: http://ftp.debian.org/debian/pool/main/z/zhcon/%{name}_%{version}-4.1.diff.gz
Patch1: %{name}-%{version}-flags.patch
Patch2: %{name}-%{version}-path-define.patch
Patch3: %{name}-%{version}-gcc43.patch
Patch4: %{name}-%{version}-locale.patch
Patch5: %{name}-%{version}-keyswitch.patch
Summary: A fast Linux Console Chinese System that supports framebuffer
Summary(zh_CN): Zhcon 是一个支持 Framebuffer Linux 中日韩文控制台
Summary(zh_TW): Zhcon 是一個支援 Framebuffer 及多內碼 Linux 中日韓文主控台
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Buildrequires: autoconf automake
Buildrequires: gettext-devel ncurses-devel gpm-devel
Requires: ncurses-libs
%description
Zhcon is a fast Linux Console Chinese System which supports
framebuffer device.It can display Chinese, Japanese or Korean
double byte characters.Supported language encodings include:
GB2312, GBK, BIG5, JIS and KSC.
double byte characters. Supported language encodings include:
UTF8, GB2312, GBK, BIG5, JIS and KSC.
%description -l zh_CN
zhcon是一个工作在Linux控制台下的多内码中文平台。
zhcon 是一个支持 Framebuffer Linux 中日韩文控制台。
它能够控制台上显示简体中文、繁体中文、日文、韩文
等双字节字符。支持多种输入法。
现支持的有: UTF8, GB2312, GBK, BIG5, JIS KSC。
%description -l zh_TW
zhcon 是一個支援 Framebuffer 與多内碼的 Linux 中日韓文主控台。
它能够在控制台上顯示簡體中文、繁體中文、日文、韓文
等雙位元組字元。支援多种输入法。
現支援的內碼有: UTF8, GB2312, GBK, BIG5, JIS KSC。
%prep
%setup -q -n zhcon-0.2.5
%patch0 -p1 -b .0.26
%patch1 -p1 -b .instpath
%patch2 -p1 -b .path_define
%patch3 -p1 -b .flags
%patch4 -p1 -b .64bit_fix
%patch5 -p1 -b .gcc43_fix
%setup -q
%patch0 -p1 -b .4-1
%patch1 -p1 -b .flags
%patch2 -p0 -b .path-define
%patch3 -p0 -b .gcc43
%patch4 -p0 -b .locale
%patch5 -p0 -b .keyswitch
iconv -f GB2312 -t UTF-8 ChangeLog -o ChangeLog.utf && mv -f ChangeLog.utf ChangeLog
( cd doc; tar -zxf html.tar.gz; chmod 755 manual)
@ -67,6 +78,11 @@ rm -rf ${RPM_BUILD_ROOT}
%{_datadir}/%{name}/
%changelog
* Tue Jul 15 2008 Ding-Yi Chen <dchen at redhat dot com> - 0.2.6-9
- [Bug 454228] [zhcon] Cannot start input method for x86_64 user
- [Bug 449625] FTBFS zhcon-0.2.6-8.fc9
- [Bug 441203] [zhcon] The input methods other than the default one were not changable for use
* Mon Mar 03 2008 Hu Zheng <zhu@redhat.com> - 0.2.6-8
- i386 build fix.