1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

- utilize USE_BDB

PR:		89023
This commit is contained in:
Yen-Ming Lee 2006-12-19 01:27:09 +00:00
parent bf4c620ed8
commit c417b0776e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=180111
4 changed files with 52 additions and 31 deletions

View File

@ -16,12 +16,12 @@ MASTER_SITES= http://ftp.teledanmark.no/pub/www/proxy/squidGuard/ \
MAINTAINER= ports@tyfon.net
COMMENT= A fast redirector for squid
LIB_DEPENDS= db3.3:${PORTSDIR}/databases/db3
RUN_DEPENDS= ${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid
USE_BDB= 3+
HAS_CONFIGURE= yes
CONFIGURE_ARGS= --with-db-inc=${LOCALBASE}/include/db3 \
--with-db-lib=${LOCALBASE}/lib \
CONFIGURE_ARGS= --with-db-inc=${BDB_INCLUDE_DIR} \
--with-db-lib=${BDB_LIB_DIR} \
--with-sg-config=${PREFIX}/etc/squid/${PORTNAME}.conf \
--with-sg-dbhome=${DATADIR} \
--with-sg-logdir=${LOGDIR} \
@ -45,6 +45,14 @@ pre-fetch:
${ECHO_MSG} " make SQUID_UID=squid SQUID_GID=squid" ; \
fi
post-patch:
@${REINPLACE_CMD} \
-e 's,-ldb,-l${BDB_LIB_NAME},' ${WRKSRC}/configure
@if [ "${BDB_LIB_NAME}" = "db-4.2" ] ; then \
${REINPLACE_CMD} -E -e 's,(db_version),\1_4002,g' \
${WRKSRC}/configure ; \
fi
pre-install:
@${CP} ${PKGDIR}/pkg-plist ${PLIST}

View File

@ -1,28 +0,0 @@
--- configure.orig Tue Dec 18 11:16:53 2001
+++ configure Thu Dec 27 01:46:53 2001
@@ -2402,13 +2402,13 @@
CPPFLAGS="$CPPFLAGS $db_inc"
LDFLAGS="$LDFLAGS $db_lib"
-echo "$as_me:2405: checking for db_version in -ldb" >&5
-echo $ECHO_N "checking for db_version in -ldb... $ECHO_C" >&6
+echo "$as_me:2405: checking for db_version in -ldb3" >&5
+echo $ECHO_N "checking for db_version in -ldb3... $ECHO_C" >&6
if test "${ac_cv_lib_db_db_version+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldb $LIBS"
+LIBS="-ldb3 $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line 2413 "configure"
#include "confdefs.h"
@@ -2456,7 +2456,7 @@
#define HAVE_LIBDB 1
EOF
- LIBS="-ldb $LIBS"
+ LIBS="-ldb3 $LIBS"
else

View File

@ -0,0 +1,14 @@
--- src/main.c.orig Thu Jun 14 01:56:54 2001
+++ src/main.c Sun Jan 1 17:04:13 2006
@@ -108,7 +108,11 @@
globalUpdate = 1;
break;
case 'v':
+#if DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR == 42
+ fprintf(stderr, "SquidGuard: %s %s\n", VERSION,db_version_4002(NULL,NULL,NULL));
+#else
fprintf(stderr, "SquidGuard: %s %s\n", VERSION,db_version(NULL,NULL,NULL));
+#endif
exit(0);
break;
case 't':

View File

@ -0,0 +1,27 @@
--- src/sgDb.c.orig Mon May 14 08:40:12 2001
+++ src/sgDb.c Thu Dec 29 23:31:32 2005
@@ -97,14 +97,20 @@
flag = DB_CREATE;
if(createdb)
flag = flag | DB_TRUNCATE;
- if ((ret =
- Db->dbp->open(Db->dbp, dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
+ if ((ret = Db->dbp->open(Db->dbp,
+#if DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR >= 41
+ NULL,
+#endif
+ dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
(void) Db->dbp->close(Db->dbp, 0);
sgLogFatalError("Error db_open: %s", strerror(ret));
}
} else {
- if ((ret =
- Db->dbp->open(Db->dbp, dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
+ if ((ret = Db->dbp->open(Db->dbp,
+#if DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR >= 41
+ NULL,
+#endif
+ dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
sgLogFatalError("Error db_open: %s", strerror(ret));
}
}