- utilize USE_BDB [1]
- support BDB 40+ PR: 89023 [1] Submitted by: swhetzel at gmail.com [1]
This commit is contained in:
parent
a08c5d86ff
commit
adc08f468e
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=159145
5 changed files with 164 additions and 57 deletions
|
@ -14,54 +14,45 @@ MASTER_SITES= ftp://ftp.linux.org.tw/pub/xcin/libtabe/devel/
|
|||
MAINTAINER= kcwu@csie.org
|
||||
COMMENT= Unified library for Chinese text processing
|
||||
|
||||
.if !defined(USE_DB2)
|
||||
LIB_DEPENDS= db3.3:${PORTSDIR}/databases/db3
|
||||
.else
|
||||
LIB_DEPENDS= db2.0:${PORTSDIR}/databases/db2
|
||||
.endif
|
||||
|
||||
WRKSRC= ${WRKDIR}/libtabe
|
||||
INSTALLS_SHLIB= yes
|
||||
HAS_CONFIGURE= yes
|
||||
USE_GMAKE= yes
|
||||
USE_XLIB= yes
|
||||
USE_BDB= yes
|
||||
OBSOLETE_BDB_VAR= USE_DB2
|
||||
NOT_FOR_ARCHS= amd64
|
||||
DATADIR= ${PREFIX}/share/tabe
|
||||
DOCSDIR= ${PREFIX}/share/doc/tabe
|
||||
CONFIGURE_ARGS= --prefix=${PREFIX} \
|
||||
--includedir=${PREFIX}/include/tabe \
|
||||
--with-db-lib=${LOCALBASE}/lib \
|
||||
--with-db-inc=${BDB_INCLUDE_DIR} \
|
||||
--with-db-lib=${BDB_LIB_DIR} \
|
||||
--with-db-bin=${LOCALBASE}/bin \
|
||||
--enable-shared
|
||||
|
||||
.if !defined(USE_DB2)
|
||||
CONFIGURE_ARGS+= --with-db-inc=${LOCALBASE}/include/db3
|
||||
.if !defined(WITHOUT_X11)
|
||||
PLIST_SUB+= X11=""
|
||||
USE_XLIB= yes
|
||||
.else
|
||||
CONFIGURE_ARGS+= --with-db-inc=${LOCALBASE}/include/db2
|
||||
.endif
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${ARCH} == "amd64"
|
||||
BROKEN= "Does not compile on amd64"
|
||||
.endif
|
||||
|
||||
pre-fetch:
|
||||
.if !defined(USE_DB2)
|
||||
@${ECHO} --
|
||||
@${ECHO} "Type \"make -DUSE_DB2\" if you want use DB2."
|
||||
@${ECHO} "Otherwise, xcin2.5 will use DB3."
|
||||
@${ECHO} --
|
||||
CONFIGURE_ARGS+=--without-x
|
||||
PLIST_SUB+= X11="@comment "
|
||||
post-patch:
|
||||
${REINPLACE_CMD} -e '/all:/s/ bims//; /bims/d' ${WRKSRC}/src/Makefile.in
|
||||
.endif
|
||||
|
||||
post-install:
|
||||
.if !defined(NOPORTDOCS)
|
||||
${MKDIR} ${PREFIX}/share/doc/tabe
|
||||
${INSTALL_DATA} ${WRKSRC}/tsi-src/README ${PREFIX}/share/doc/tabe/README.tsi
|
||||
${INSTALL_DATA} ${WRKSRC}/src/supports/bims/README ${PREFIX}/share/doc/tabe/README.bims
|
||||
${MKDIR} ${DOCSDIR}
|
||||
${INSTALL_DATA} ${WRKSRC}/tsi-src/README ${DOCSDIR}/README.tsi
|
||||
.if !defined(WITHOUT_X11)
|
||||
${INSTALL_DATA} ${WRKSRC}/src/supports/bims/README ${DOCSDIR}/README.bims
|
||||
.endif
|
||||
.for DOC in BoPoMoFo.shtml Changes Changes.pre-0.1 TODO ZuYinCode.txt \
|
||||
et26.txt libtabe.sgml
|
||||
${INSTALL_DATA} ${WRKSRC}/doc/${DOC} ${PREFIX}/share/doc/tabe
|
||||
${INSTALL_DATA} ${WRKSRC}/doc/${DOC} ${DOCSDIR}
|
||||
.endfor
|
||||
.endif
|
||||
${MKDIR} ${PREFIX}/share/tabe
|
||||
${TOUCH} ${PREFIX}/share/tabe/libtabe-0.2.5
|
||||
${MKDIR} ${DATADIR}
|
||||
${TOUCH} ${DATADIR}/${PORTNAME}-${PORTVERSION}
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
.include <bsd.port.mk>
|
||||
|
|
36
chinese/libtabe/files/patch-configure
Normal file
36
chinese/libtabe/files/patch-configure
Normal file
|
@ -0,0 +1,36 @@
|
|||
--- configure.orig Sat Oct 20 20:03:29 2001
|
||||
+++ configure Wed Apr 5 13:26:48 2006
|
||||
@@ -5315,18 +5315,15 @@
|
||||
cat conftest.$ac_ext >&5
|
||||
fi
|
||||
rm -f conftest*
|
||||
-test "$ac_cv_search_db_create" = "no" && for i in db db3; do
|
||||
+test "$ac_cv_search_db_create" = "no" && for i in db db3 db4 db41 db-4.2 db-4.3 db-4.4; do
|
||||
LIBS="-l$i $ac_func_search_save_LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 5322 "configure"
|
||||
#include "confdefs.h"
|
||||
-/* Override any gcc2 internal prototype to avoid an error. */
|
||||
-/* We use char because int might match the return type of a gcc2
|
||||
- builtin and then its argument prototype would still apply. */
|
||||
-char db_create();
|
||||
+#include "db.h"
|
||||
|
||||
int main() {
|
||||
-db_create()
|
||||
+db_create(0,0,0)
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:5333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
@@ -5726,11 +5723,6 @@
|
||||
echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
|
||||
fi
|
||||
|
||||
-if test x$no_x = xyes; then
|
||||
- echo "$ac_t""You need X11R6 header files to compile libtabe." 1>&6
|
||||
- echo "$ac_t""Please use --x-includes to configure." 1>&6
|
||||
- exit 1
|
||||
-fi
|
||||
|
||||
|
||||
|
|
@ -1,10 +1,50 @@
|
|||
--- src/tabe_tsidbint.c.orig Sun Nov 11 12:33:07 2001
|
||||
+++ src/tabe_tsidbint.c Thu Aug 22 02:14:53 2002
|
||||
@@ -267,3 +267,7 @@
|
||||
--- src/tabe_tsidbint.c.orig Sun Nov 11 20:33:07 2001
|
||||
+++ src/tabe_tsidbint.c Wed Apr 5 13:40:32 2006
|
||||
@@ -84,8 +84,10 @@
|
||||
else {
|
||||
#ifndef HAVE_DB3
|
||||
errno = db_open(db_name, DB_BTREE, DB_CREATE, 0644, NULL, NULL, &dbp);
|
||||
-#else
|
||||
+#elif (DB_VERSION_MAJOR == 3 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 0))
|
||||
errno = dbp->open(dbp, db_name, NULL, DB_BTREE, DB_CREATE, 0644);
|
||||
+#else
|
||||
+ errno = dbp->open(dbp, NULL, db_name, NULL, DB_BTREE, DB_CREATE, 0644);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -93,15 +95,19 @@
|
||||
if (flags & DB_FLAG_READONLY) {
|
||||
#ifndef HAVE_DB3
|
||||
errno = db_open(db_name, DB_BTREE, DB_RDONLY, 0444, NULL, NULL, &dbp);
|
||||
-#else
|
||||
+#elif (DB_VERSION_MAJOR == 3 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 0))
|
||||
errno = dbp->open(dbp, db_name, NULL, DB_BTREE, DB_RDONLY, 0444);
|
||||
+#else
|
||||
+ errno = dbp->open(dbp, NULL, db_name, NULL, DB_BTREE, DB_RDONLY, 0444);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#ifndef HAVE_DB3
|
||||
errno = db_open(db_name, DB_BTREE, 0, 0644, NULL, NULL, &dbp);
|
||||
-#else
|
||||
+#elif (DB_VERSION_MAJOR == 3 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 0))
|
||||
errno = dbp->open(dbp, db_name, NULL, DB_BTREE, 0, 0644);
|
||||
+#else
|
||||
+ errno = dbp->open(dbp, NULL, db_name, NULL, DB_BTREE, 0, 0644);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -265,7 +271,13 @@
|
||||
switch(tsidb->type) {
|
||||
case DB_TYPE_DB:
|
||||
dbp = (DB *)tsidb->dbp;
|
||||
+#ifndef HAVE_DB3
|
||||
errno = dbp->stat(dbp, &sp, NULL, 0);
|
||||
+#else
|
||||
+#elif (DB_VERSION_MAJOR == 3 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR <= 2))
|
||||
+ errno = dbp->stat(dbp, &sp, 0);
|
||||
+#else
|
||||
+ errno = dbp->stat(dbp, NULL, &sp, 0);
|
||||
+#endif
|
||||
if (!errno) {
|
||||
#ifndef HAVE_DB3
|
||||
return(sp->bt_nrecs);
|
||||
|
|
|
@ -1,10 +1,50 @@
|
|||
--- src/tabe_tsiyindbint.c.orig Sun Nov 11 12:33:08 2001
|
||||
+++ src/tabe_tsiyindbint.c Thu Aug 22 02:16:00 2002
|
||||
@@ -270,3 +270,7 @@
|
||||
--- src/tabe_tsiyindbint.c.orig Sun Nov 11 20:33:08 2001
|
||||
+++ src/tabe_tsiyindbint.c Wed Apr 5 14:30:18 2006
|
||||
@@ -87,8 +87,10 @@
|
||||
else {
|
||||
#ifndef HAVE_DB3
|
||||
errno = db_open(db_name, DB_BTREE, DB_CREATE, 0644, NULL, NULL, &dbp);
|
||||
-#else
|
||||
+#elif (DB_VERSION_MAJOR == 3 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 0))
|
||||
errno = dbp->open(dbp, db_name, NULL, DB_BTREE, DB_CREATE, 0644);
|
||||
+#else
|
||||
+ errno = dbp->open(dbp, NULL, db_name, NULL, DB_BTREE, DB_CREATE, 0644);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -96,15 +98,19 @@
|
||||
if (flags & DB_FLAG_READONLY) {
|
||||
#ifndef HAVE_DB3
|
||||
errno = db_open(db_name, DB_BTREE, DB_RDONLY, 0444, NULL, NULL, &dbp);
|
||||
-#else
|
||||
+#elif (DB_VERSION_MAJOR == 3 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 0))
|
||||
errno = dbp->open(dbp, db_name, NULL, DB_BTREE, DB_RDONLY, 0444);
|
||||
+#else
|
||||
+ errno = dbp->open(dbp, NULL, db_name, NULL, DB_BTREE, DB_RDONLY, 0444);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#ifndef HAVE_DB3
|
||||
errno = db_open(db_name, DB_BTREE, 0, 0644, NULL, NULL, &dbp);
|
||||
-#else
|
||||
+#elif (DB_VERSION_MAJOR == 3 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 0))
|
||||
errno = dbp->open(dbp, db_name, NULL, DB_BTREE, 0, 0644);
|
||||
+#else
|
||||
+ errno = dbp->open(dbp, NULL, db_name, NULL, DB_BTREE, 0, 0644);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -268,7 +274,13 @@
|
||||
switch(tsiyindb->type) {
|
||||
case DB_TYPE_DB:
|
||||
dbp = (DB *)tsiyindb->dbp;
|
||||
+#ifndef HAVE_DB3
|
||||
errno = dbp->stat(dbp, &sp, NULL, 0);
|
||||
+#else
|
||||
+#elif (DB_VERSION_MAJOR == 3 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR <= 2))
|
||||
+ errno = dbp->stat(dbp, &sp, 0);
|
||||
+#else
|
||||
+ errno = dbp->stat(dbp, NULL, &sp, 0);
|
||||
+#endif
|
||||
if (!errno) {
|
||||
#ifndef HAVE_DB3
|
||||
return(sp->bt_nrecs);
|
||||
|
|
|
@ -3,29 +3,29 @@ bin/tsidel
|
|||
bin/tsidump
|
||||
bin/tsiyincheck
|
||||
bin/tsiyindump
|
||||
include/tabe/bims.h
|
||||
%%X11%%include/tabe/bims.h
|
||||
include/tabe/tabe.h
|
||||
lib/libbims.a
|
||||
lib/libbims.la
|
||||
lib/libbims.so
|
||||
lib/libbims.so.2
|
||||
%%X11%%lib/libbims.a
|
||||
%%X11%%lib/libbims.la
|
||||
%%X11%%lib/libbims.so
|
||||
%%X11%%lib/libbims.so.2
|
||||
lib/libtabe.a
|
||||
lib/libtabe.la
|
||||
lib/libtabe.so
|
||||
lib/libtabe.so.2
|
||||
lib/tabe/tsi.db
|
||||
lib/tabe/yin.db
|
||||
%%PORTDOCS%%share/doc/tabe/BoPoMoFo.shtml
|
||||
%%PORTDOCS%%share/doc/tabe/Changes
|
||||
%%PORTDOCS%%share/doc/tabe/Changes.pre-0.1
|
||||
%%PORTDOCS%%share/doc/tabe/README.bims
|
||||
%%PORTDOCS%%share/doc/tabe/README.tsi
|
||||
%%PORTDOCS%%share/doc/tabe/TODO
|
||||
%%PORTDOCS%%share/doc/tabe/ZuYinCode.txt
|
||||
%%PORTDOCS%%share/doc/tabe/et26.txt
|
||||
%%PORTDOCS%%share/doc/tabe/libtabe.sgml
|
||||
share/tabe/libtabe-0.2.5
|
||||
%%PORTDOCS%%%%DOCSDIR%%/BoPoMoFo.shtml
|
||||
%%PORTDOCS%%%%DOCSDIR%%/Changes
|
||||
%%PORTDOCS%%%%DOCSDIR%%/Changes.pre-0.1
|
||||
%%X11%%%%PORTDOCS%%%%DOCSDIR%%/README.bims
|
||||
%%PORTDOCS%%%%DOCSDIR%%/README.tsi
|
||||
%%PORTDOCS%%%%DOCSDIR%%/TODO
|
||||
%%PORTDOCS%%%%DOCSDIR%%/ZuYinCode.txt
|
||||
%%PORTDOCS%%%%DOCSDIR%%/et26.txt
|
||||
%%PORTDOCS%%%%DOCSDIR%%/libtabe.sgml
|
||||
%%DATADIR%%/libtabe-0.2.5
|
||||
@dirrm include/tabe
|
||||
@dirrm lib/tabe
|
||||
%%PORTDOCS%%@dirrm share/doc/tabe
|
||||
@dirrm share/tabe
|
||||
%%PORTDOCS%%@dirrm %%DOCSDIR%%
|
||||
@dirrm %%DATADIR%%
|
||||
|
|
Loading…
Reference in a new issue