summaryrefslogtreecommitdiff
path: root/japanese/libjconv/files
diff options
context:
space:
mode:
authorAkinori MUSHA <knu@FreeBSD.org>2001-01-16 18:27:26 +0000
committerAkinori MUSHA <knu@FreeBSD.org>2001-01-16 18:27:26 +0000
commit6bec4838d31ffd2c7cc740a720079d622ae9c63c (patch)
tree02cdfe86d3cd1973cabc92e5afeac65a80e3a59d /japanese/libjconv/files
parentMassive style enforcement - use ^I instead of spaces for variables identation. (diff)
Add ja-libconv, Japanese charset conversion library powered by iconv(3).
Notes
Notes: svn path=/head/; revision=37253
Diffstat (limited to 'japanese/libjconv/files')
-rw-r--r--japanese/libjconv/files/Makefile13
-rw-r--r--japanese/libjconv/files/Makefile.lib34
-rw-r--r--japanese/libjconv/files/Makefile.prog12
-rw-r--r--japanese/libjconv/files/patch-conv.c24
-rw-r--r--japanese/libjconv/files/patch-info.c11
5 files changed, 94 insertions, 0 deletions
diff --git a/japanese/libjconv/files/Makefile b/japanese/libjconv/files/Makefile
new file mode 100644
index 000000000000..388949b9624d
--- /dev/null
+++ b/japanese/libjconv/files/Makefile
@@ -0,0 +1,13 @@
+# $FreeBSD$
+
+all:
+ ${MAKE} LOCALBASE=${LOCALBASE} -f Makefile.lib
+ ${MAKE} LOCALBASE=${LOCALBASE} -f Makefile.prog
+
+install:
+ ${MAKE} LOCALBASE=${LOCALBASE} -f Makefile.lib install
+ ${MAKE} LOCALBASE=${LOCALBASE} -f Makefile.prog install
+
+clean:
+ ${MAKE} LOCALBASE=${LOCALBASE} -f Makefile.lib clean
+ ${MAKE} LOCALBASE=${LOCALBASE} -f Makefile.prog clean
diff --git a/japanese/libjconv/files/Makefile.lib b/japanese/libjconv/files/Makefile.lib
new file mode 100644
index 000000000000..72d3557e6188
--- /dev/null
+++ b/japanese/libjconv/files/Makefile.lib
@@ -0,0 +1,34 @@
+# $FreeBSD$
+
+LIB= jconv
+SHLIB_MAJOR?= 0
+SHLIB_MINOR?= 0
+CFLAGS+= -Wall -I${LOCALBASE}/include -DLOCALBASE=${LOCALBASE}
+LDADD= -liconv -L${LOCALBASE}/lib
+SRCS= conv.c info.c compat.c
+INCS= jconv.h
+NOMAN= YES
+LIBDIR= ${LOCALBASE}/lib
+INCDIR= ${LOCALBASE}/include
+ETCDIR= ${LOCALBASE}/etc
+
+.include <bsd.lib.mk>
+
+# For FreeBSD 3.x or older
+.if !target(_includeinstall)
+_includeinstall:
+.if defined(INCS)
+.for header in ${INCS}
+ cd ${.CURDIR} && \
+ ${INSTALL} -C -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} \
+ ${header} ${DESTDIR}${INCDIR}
+
+.endfor
+.endif
+
+beforeinstall: _includeinstall
+.endif
+
+afterinstall:
+ mkdir -p ${DESTDIR}/${ETCDIR}/libjconv
+ ${INSTALL} -C default.conf ${DESTDIR}/${ETCDIR}/libjconv/
diff --git a/japanese/libjconv/files/Makefile.prog b/japanese/libjconv/files/Makefile.prog
new file mode 100644
index 000000000000..023771d670b8
--- /dev/null
+++ b/japanese/libjconv/files/Makefile.prog
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+LOCALBASE?= /usr/local
+
+PROG= jconv
+SRCS= jconv.c
+CFLAGS+= -I${LOCALBASE}/include
+LDADD= -L${.CURDIR} -ljconv
+NOMAN= YES
+BINDIR= ${LOCALBASE}/bin
+
+.include <bsd.prog.mk>
diff --git a/japanese/libjconv/files/patch-conv.c b/japanese/libjconv/files/patch-conv.c
new file mode 100644
index 000000000000..ab5b6c041641
--- /dev/null
+++ b/japanese/libjconv/files/patch-conv.c
@@ -0,0 +1,24 @@
+--- conv.c.orig Sat Aug 5 05:52:38 2000
++++ conv.c Fri Jan 12 02:31:33 2001
+@@ -130,11 +130,19 @@
+ *dest_r = NULL;
+ *dest_len_r = 0;
+ *actual_codeset_r = num_src_codesets;
++
++ if (strcasecmp(dest_codeset, "SJIS") == 0)
++ dest_codeset = "Shift_JIS";
+
+ for (i = 0; i < num_src_codesets; i++) {
+ iconv_t cd;
+- DEBUG_DO(printf("jconv_alloc_conv: try %s\n", src_codesets[i]));
+- cd = iconv_open(dest_codeset, src_codesets[i]);
++ const char *src_codeset = src_codesets[i];
++
++ if (strcasecmp(src_codeset, "SJIS") == 0)
++ src_codeset = "Shift_JIS";
++
++ DEBUG_DO(printf("jconv_alloc_conv: try %s\n", src_codeset));
++ cd = iconv_open(dest_codeset, src_codeset);
+ if (cd == (iconv_t)-1) {
+ /* EMFILE, ENFILE, ENOMEM, or EINVAL */
+ error_code = errno;
diff --git a/japanese/libjconv/files/patch-info.c b/japanese/libjconv/files/patch-info.c
new file mode 100644
index 000000000000..f4a6c2c829d3
--- /dev/null
+++ b/japanese/libjconv/files/patch-info.c
@@ -0,0 +1,11 @@
+--- info.c.orig Sat Aug 5 05:52:38 2000
++++ info.c Fri Jan 12 02:12:40 2001
+@@ -13,7 +13,7 @@
+
+ #define DEBUG_DO(x)
+
+-#define JCONV_DEFAULT_CONFFILE "/etc/libjconv/default.conf"
++#define JCONV_DEFAULT_CONFFILE "!!LOCALBASE!!/etc/libjconv/default.conf"
+
+ typedef struct {
+ char *name;