summaryrefslogtreecommitdiff
path: root/misc/hanzim
diff options
context:
space:
mode:
authordholland <dholland>2012-04-30 04:01:08 +0000
committerdholland <dholland>2012-04-30 04:01:08 +0000
commit7f9952feb94a2bee681beb1e85a02599a2362097 (patch)
tree5e3fece935e61d94f32e09ed40e4cb52690c896b /misc/hanzim
parent719cc75faad2390bd3b38341af2c95d40c5c8452 (diff)
downloadpkgsrc-7f9952feb94a2bee681beb1e85a02599a2362097.tar.gz
DESTDIR support. Fix problems building the database.
Diffstat (limited to 'misc/hanzim')
-rw-r--r--misc/hanzim/Makefile4
-rw-r--r--misc/hanzim/distinfo8
-rw-r--r--misc/hanzim/patches/patch-aa32
-rw-r--r--misc/hanzim/patches/patch-ab31
-rw-r--r--misc/hanzim/patches/patch-hanzim_h15
-rw-r--r--misc/hanzim/patches/patch-hutil_c15
6 files changed, 87 insertions, 18 deletions
diff --git a/misc/hanzim/Makefile b/misc/hanzim/Makefile
index c8d47618bb3..209d9275875 100644
--- a/misc/hanzim/Makefile
+++ b/misc/hanzim/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2010/10/03 13:03:51 obache Exp $
+# $NetBSD: Makefile,v 1.8 2012/04/30 04:01:08 dholland Exp $
#
DISTNAME= hanzim-1.3
@@ -11,6 +11,8 @@ MAINTAINER= rxg@NetBSD.org
HOMEPAGE= http://kamares.ucsd.edu/~arobert/hanzim.html
COMMENT= Chinese character learning-aid program
+PKG_DESTDIR_SUPPORT= user-destdir
+
WRKSRC= ${WRKDIR}/Hanzim
BUILD_TARGET= hanzim
diff --git a/misc/hanzim/distinfo b/misc/hanzim/distinfo
index 27f6cf7ad0a..b0f1bbde73d 100644
--- a/misc/hanzim/distinfo
+++ b/misc/hanzim/distinfo
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.2 2007/12/27 15:37:44 joerg Exp $
+$NetBSD: distinfo,v 1.3 2012/04/30 04:01:08 dholland Exp $
SHA1 (hanzim-1.3.tgz) = f81cc5a5b382520f4304815f2e59488731cae9a6
RMD160 (hanzim-1.3.tgz) = 650b65017fdb271554995f886fa79f60586b3de8
Size (hanzim-1.3.tgz) = 570776 bytes
-SHA1 (patch-aa) = 98b7ef24a3a87d5ef1f7039999eaf888f254dc70
-SHA1 (patch-ab) = cbbf10a46d6c2267074e30bf1684f7332f847d50
+SHA1 (patch-aa) = 6dee6654a2bda3ab2e94f7f641fe9ce63d92bc90
+SHA1 (patch-ab) = 5a6326b0bb735b5c816680726d74fc272f5ad169
+SHA1 (patch-hanzim_h) = d88fedc60b180e7aa3baa8a006b0f42e99e0c7fc
+SHA1 (patch-hutil_c) = fad3cda984a44fc125fff16f1f266b16cb3a73e2
diff --git a/misc/hanzim/patches/patch-aa b/misc/hanzim/patches/patch-aa
index edf1b0ac92e..f27b425fa22 100644
--- a/misc/hanzim/patches/patch-aa
+++ b/misc/hanzim/patches/patch-aa
@@ -1,6 +1,9 @@
-$NetBSD: patch-aa,v 1.2 2007/12/27 15:37:44 joerg Exp $
+$NetBSD: patch-aa,v 1.3 2012/04/30 04:01:08 dholland Exp $
---- Makefile.orig 2002-03-20 13:59:19.000000000 +0800
+- configure for pkgsrc
+- destdir support
+
+--- Makefile.orig 2002-03-20 05:59:19.000000000 +0000
+++ Makefile
@@ -6,11 +6,11 @@
@@ -57,7 +60,7 @@ $NetBSD: patch-aa,v 1.2 2007/12/27 15:37:44 joerg Exp $
DIST_FILES = Hanzim/hanzim.h Hanzim/hgb_utf.h \
Hanzim/hanzim.c Hanzim/hanwin.c Hanzim/hinit.c Hanzim/hutil.c \
-@@ -87,13 +87,13 @@ DIST_FILES = Hanzim/hanzim.h Hanzim/hgb_
+@@ -87,16 +87,17 @@ DIST_FILES = Hanzim/hanzim.h Hanzim/hgb_
$(CC) $(CFLAGS) -c hutil.c
install : hanzim
@@ -66,14 +69,21 @@ $NetBSD: patch-aa,v 1.2 2007/12/27 15:37:44 joerg Exp $
- $(INSTALL) -m 0755 -d $(DOCDIR)
- $(INSTALL) -m 0644 hanzim.doc $(DOCDIR)
- $(INSTALL) -m 0755 -d $(LIBDIR)
-+ $(BSD_INSTALL_PROGRAM) hanzim $(BINDIR)
-+ $(BSD_INSTALL_MAN) hanzim.man $(MANDIR)/man1/hanzim.1
-+ $(BSD_INSTALL_DATA_DIR) $(DOCDIR)
-+ $(BSD_INSTALL_DATA) hanzim.doc $(DOCDIR)
-+ $(BSD_INSTALL_DATA_DIR) $(LIBDIR)
- cd Data ; \
+- cd Data ; \
- $(INSTALL) -m 0644 hanwin.tcl fonts.unix fonts.windows \
++ $(BSD_INSTALL_PROGRAM) hanzim $(DESTDIR)$(BINDIR)
++ $(BSD_INSTALL_MAN) hanzim.man $(DESTDIR)$(MANDIR)/man1/hanzim.1
++ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(DOCDIR)
++ $(BSD_INSTALL_DATA) hanzim.doc $(DESTDIR)$(DOCDIR)
++ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(LIBDIR)
++ cd Data && \
+ $(BSD_INSTALL_DATA) hanwin.tcl fonts.unix \
zidianf.gb zidianfl.b5 bushou.gb \
- cidianf.gb sanzicidianf.gb parts.gb $(LIBDIR)
- $(BINDIR)/hanzim -buildDB
+- cidianf.gb sanzicidianf.gb parts.gb $(LIBDIR)
+- $(BINDIR)/hanzim -buildDB
++ cidianf.gb sanzicidianf.gb parts.gb \
++ $(DESTDIR)$(LIBDIR)
++ HANZIM_LIB=$(DESTDIR)$(LIBDIR) $(DESTDIR)$(BINDIR)/hanzim -buildDB
+
+ uninstall :
+ $(RM) $(BINDIR)/hanzim
diff --git a/misc/hanzim/patches/patch-ab b/misc/hanzim/patches/patch-ab
index 23aec16f423..bc736e5d544 100644
--- a/misc/hanzim/patches/patch-ab
+++ b/misc/hanzim/patches/patch-ab
@@ -1,8 +1,33 @@
-$NetBSD: patch-ab,v 1.1.1.1 2006/01/16 13:18:29 rxg Exp $
+$NetBSD: patch-ab,v 1.2 2012/04/30 04:01:08 dholland Exp $
---- hanzim.c.orig Wed Jun 26 17:26:48 2002
+- honor HANZIM_LIB when doing -buildDB, for destdir support
+- use time_t properly
+
+--- hanzim.c.orig 2002-03-20 06:34:31.000000000 +0000
+++ hanzim.c
-@@ -460,10 +460,10 @@
+@@ -164,13 +164,19 @@ int
+ buildOnly(char *dst, char *key, char *nextArg)
+ {
+ char fname[100];
+- char datadir[80];
++ char datadir[400];
++ char *ev;
+
+ fprintf(stderr,"Hanzim: (re)building database...\n");
+
+ /* set datadir to LIBDIR; in future should allow simultaneous use of
+ '-db' and '-buildDB' */
+- strcpy(datadir,LIBDIR);
++ ev = getenv("HANZIM_LIB");
++ if (ev != NULL && strlen(ev) < sizeof(datadir)) {
++ strcpy(datadir, ev);
++ } else {
++ strcpy(datadir,LIBDIR);
++ }
+
+ /* This code a subset of what occurs in db_init() below. */
+ if (!init_vars(datadir)) {
+@@ -460,10 +466,10 @@ db_init(char *datadir, Tcl_Interp *inter
struct _timeb tp;
_ftime(&tp);
#else
diff --git a/misc/hanzim/patches/patch-hanzim_h b/misc/hanzim/patches/patch-hanzim_h
new file mode 100644
index 00000000000..1be28d25db6
--- /dev/null
+++ b/misc/hanzim/patches/patch-hanzim_h
@@ -0,0 +1,15 @@
+$NetBSD: patch-hanzim_h,v 1.1 2012/04/30 04:01:08 dholland Exp $
+
+- Avoid overflows indexing own data file.
+
+--- hanzim.h~ 2002-03-20 06:31:28.000000000 +0000
++++ hanzim.h
+@@ -27,7 +27,7 @@
+ /* max number of characters with same pronunciation */
+ #define MAXPCHAR 56
+ /* max number of pronunciations for one character */
+-#define MAXCPRON 5
++#define MAXCPRON 19
+ /* max number of characters one character will be remainder of */
+ #define MAXREMOF 25
+ /* number of radicals (depends on file "bushou.gb") */
diff --git a/misc/hanzim/patches/patch-hutil_c b/misc/hanzim/patches/patch-hutil_c
new file mode 100644
index 00000000000..1f11bac30b3
--- /dev/null
+++ b/misc/hanzim/patches/patch-hutil_c
@@ -0,0 +1,15 @@
+$NetBSD: patch-hutil_c,v 1.1 2012/04/30 04:01:08 dholland Exp $
+
+- Use ctype.h functions correctly; fixes problems reading in the data files.
+
+--- hutil.c~ 2001-03-29 07:50:51.000000000 +0000
++++ hutil.c
+@@ -207,7 +207,7 @@ getnextline(FILE *fp, char *line, int ma
+ }
+
+ /*read in line*/
+- while(isspace(c)) c=getc(fp); /* skip any indentation */
++ while(isascii((u_char)c) && isspace((u_char)c)) c=getc(fp); /* skip any indentation */
+ for (tpos=line;(c!='\n') && (++numRead < maxlen);c=getc(fp))
+ *tpos++ = c;
+