Subject: [alpine-devel] [PATCH] testing/squidguard

From: <[email-masked]>
Date: Tue, 31 Jul 2012 5:39:43 -0400

The attached file and APKBUILD patch fixes an incompatibility between 
squidguard 1.4 and Berkely DB versions >= 5

The symptoms include "BDB1656 DB->put: method not permitted before handle's open method" 
errors when compiling the databases.

See: http://anonscm.debian.org/gitweb/?p=collab-maint/squidguard.git;a=commitdiff;h=90dfdd475a9dfd16c9062d83c3ecfbf15cb23e63

-dean takemori

diff --git a/testing/squidguard/APKBUILD b/testing/squidguard/APKBUILD
index 4187bfb..575aa00 100644
--- a/testing/squidguard/APKBUILD
+++ b/testing/squidguard/APKBUILD
@@ -2,7 +2,7 @@
 pkgname=squidguard
 _realname=squidGuard
 pkgver=1.4
-pkgrel=3
+pkgrel=4
 pkgdesc="Squid URL redirector"
 url="http://www.squidguard.org"
 arch="all"
@@ -14,7 +14,8 @@ subpackages=""
 source="http://www.squidguard.org/Downloads/$_realname-$pkgver.tar.gz
 	squidguard-1.4-gentoo.patch
 	squidguard-1.4-upstream-fixes.patch
-	squidguard-1.4-vsnprintf.patch"
+	squidguard-1.4-vsnprintf.patch
+	squidguard-1.4-debian-bdb-51.patch"
 
 _builddir="$srcdir"/$_realname-$pkgver
 
@@ -23,6 +24,7 @@ prepare() {
 	patch -p1 < ../../squidguard-1.4-gentoo.patch
 	patch -p1 < ../../squidguard-1.4-upstream-fixes.patch
 	patch -p1 < ../../squidguard-1.4-vsnprintf.patch
+	patch -p1 < ../../squidguard-1.4-debian-bdb-51.patch
 }
 
 build() {
@@ -44,4 +46,5 @@ package() {
 md5sums="de834150998c1386c30feae196f16b06  squidGuard-1.4.tar.gz
 ba58e934fe2f75fcb5dfbe054e045449  squidguard-1.4-gentoo.patch
 4b512e930dede70ddf36d4f7c75a598f  squidguard-1.4-upstream-fixes.patch
-8878c72f27e45dab99e5d0197d50caec  squidguard-1.4-vsnprintf.patch"
+8878c72f27e45dab99e5d0197d50caec  squidguard-1.4-vsnprintf.patch
+ea2deca296c41107bc981d1a2a093846  squidguard-1.4-debian-bdb-51.patch"
Package:     squidguard
Subject:     make it useable with Berkeley DB version 5.x
Author:      Joachim Wiedorn <ad_debian at joonet.de>
Bug-Debian:  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=621376
Forwarded:   yes
Last-Update: 2011-05-31

Since the end of 2010 the is a new major version of Berkeley DB.
For use with squidguard it need this patch.

---

diff -urN s07/src/sgDb.c s08/src/sgDb.c
--- s07/src/sgDb.c	2008-07-14 20:29:41.000000000 +0200
+++ s08/src/sgDb.c	2011-05-31 20:06:26.328740739 +0200
@@ -114,7 +114,7 @@
     }
   }
 #endif
-#if DB_VERSION_MAJOR == 4
+#if DB_VERSION_MAJOR == 4 || DB_VERSION_MAJOR == 5
   if(globalUpdate || createdb || (dbfile != NULL && stat(dbfile,&st))){
     flag = DB_CREATE;
     if(createdb)

---

From: Leonardo <[email-masked]>
Date: Tue, 31 Jul 2012 13:23:55 +0200

> errors when compiling the databases.

Applied!

If you can send a git patch, it would be faster to apply it.

Thank you!

- leo