1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
diff -Nru squidGuard-1.2.1.orig/configure.in squidGuard-1.2.1/configure.in
--- squidGuard-1.2.1.orig/configure.in 2007-06-24 13:19:45.000000000 +0300
+++ squidGuard-1.2.1/configure.in 2007-06-24 13:17:36.000000000 +0300
@@ -85,7 +85,7 @@
AC_HEADER_STDC
AC_CHECK_HEADERS(db.h regex.h unistd.h)
-+AC_CHECK_HEADER(db.h,,[
+AC_CHECK_HEADER(db.h,,[
echo
echo "** No db.h found"
echo " The Berkley DB library is required for squidGuard"
@@ -110,13 +110,24 @@
dnl
dnl Check ldap
-AC_CHECK_LIB(ldap,ldap_init,,[
- echo
- echo "LDAP library not found"
- echo
- exit 1
- ])
-AC_RUN_IFELSE([
+AC_ARG_WITH(ldap,
+ AC_HELP_STRING([--with-ldap], [use ldap (default=yes)]))
+if test "$with_ldap" = "no" -o "$with_ldap" = "false"
+then
+ with_ldap=no
+else
+ AC_CHECK_LIB( ldap, ldap_init,
+ [
+ with_ldap=yes
+ LIBS="$LIBS -lldap"
+ ],[
+ AC_MSG_WARN([Cannot find LDAP libraries. LDAP support disabled])
+ with_ldap=no
+ ])
+fi
+if test "$with_ldap" = "yes"; then
+ AC_DEFINE(HAVE_LIBLDAP)
+ AC_RUN_IFELSE([
#include <ldap.h>
int main()
{
@@ -130,6 +141,7 @@
echo
exit 1
],)
+fi
dnl Check threads... ok if it fails
AC_CHECK_LIB(pthread,pthread_create,,[
@@ -141,15 +153,7 @@
])
dnl Check DB
-AC_CHECK_LIB(db,db_version,,[
- echo
- echo "** The Berkley DB library is required for squidGuard"
- echo " to compile. Get it from http://www.sleepycat.com"
- echo " use --with-db=DIR or --with-db-lib=DIR to specify"
- echo " its location. (default is $dbprefix/BerkeleyDB)"
- echo
- exit 1
- ])
+LIBS="$LIBS -ldb"
AC_RUN_IFELSE([
#include <db.h>
int main()
diff -Nru squidGuard-1.2.1.orig/Makefile.in squidGuard-1.2.1/Makefile.in
--- squidGuard-1.2.1.orig/Makefile.in 2007-06-24 13:09:47.000000000 +0300
+++ squidGuard-1.2.1/Makefile.in 2007-06-24 12:55:17.000000000 +0300
@@ -40,7 +40,7 @@
# Dependencies for installing
#
-install: install-build install-conf
+install: install-build
install-conf:
@echo Installing configuration file
@@ -67,10 +67,10 @@
install-build:
@echo Installing squidGuard
- @if [ ! -d $(bindir) ]; then \
- $(MKINSTALLDIRS) $(bindir) ; \
+ @if [ ! -d "$(INSTDIR)"/$(bindir) ]; then \
+ $(MKINSTALLDIRS) "$(INSTDIR)"/$(bindir) ; \
fi ; \
- cp src/squidGuard $(bindir) || exit 1 ; \
+ cp src/squidGuard "$(INSTDIR)"/$(bindir) || exit 1 ; \
echo Done. ;
clean::
diff -Nru squidGuard-1.2.1.orig/src/Makefile.in squidGuard-1.2.1/src/Makefile.in
--- squidGuard-1.2.1.orig/src/Makefile.in 2007-06-24 13:09:47.000000000 +0300
+++ squidGuard-1.2.1/src/Makefile.in 2007-06-24 12:55:17.000000000 +0300
@@ -103,8 +103,8 @@
install.bin:: squidGuard
@echo making $@ in `basename \`pwd\``
- @$(MKDIR) $(bindir) $(logdir) $(cfgdir)
- $(INSTALL_PROGRAM) squidGuard $(bindir)/squidGuard
+ @$(MKDIR) "$(INSTDIR)"/$(bindir) "$(INSTDIR)"/$(logdir) "$(INSTDIR)"/$(cfgdir)
+ $(INSTALL_PROGRAM) squidGuard "$(INSTDIR)"/$(bindir)/squidGuard
uninstall.bin::
@echo making $@ in `basename \`pwd\``
diff -Nru squidGuard-1.2.1.orig/src/sgDb.c squidGuard-1.2.1/src/sgDb.c
--- squidGuard-1.2.1.orig/src/sgDb.c 2007-06-24 13:19:45.000000000 +0300
+++ squidGuard-1.2.1/src/sgDb.c 2007-06-24 12:55:17.000000000 +0300
@@ -101,13 +101,21 @@
if(createdb)
flag = flag | DB_TRUNCATE;
if ((ret =
+#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
+ Db->dbp->open(Db->dbp, NULL, dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
+#else
Db->dbp->open(Db->dbp, dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
+#endif
(void) Db->dbp->close(Db->dbp, 0);
sgLogFatalError("Error db_open: %s", strerror(ret));
}
} else {
if ((ret =
+#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
+ Db->dbp->open(Db->dbp, NULL, dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
+#else
Db->dbp->open(Db->dbp, dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
+#endif
sgLogFatalError("Error db_open: %s", strerror(ret));
}
}
|