View | Details | Raw Unified | Return to bug 46102
Collapse All | Expand All

(-)/root/bogofilter/Makefile (-5 / +14 lines)
Lines 6-13 Link Here
6
#
6
#
7
7
8
PORTNAME=	bogofilter
8
PORTNAME=	bogofilter
9
PORTVERSION=	0.8.0
9
PORTVERSION=	0.9.1.2
10
PORTREVISION=	2
10
PORTREVISION=	0
11
CATEGORIES=	mail
11
CATEGORIES=	mail
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
13
MASTER_SITE_SUBDIR=	${PORTNAME}
13
MASTER_SITE_SUBDIR=	${PORTNAME}
Lines 22-39 Link Here
22
PATCH_STRIP=	-p1
22
PATCH_STRIP=	-p1
23
CONFIGURE_ENV=	CPPFLAGS="-I${PREFIX}/include/db4" \
23
CONFIGURE_ENV=	CPPFLAGS="-I${PREFIX}/include/db4" \
24
		LDFLAGS="-L${PREFIX}/lib"
24
		LDFLAGS="-L${PREFIX}/lib"
25
25
CONFIGURE_ARGS=	--sysconfdir=${PREFIX}/etc
26
MAN1=		bogofilter.1 bogoutil.1 bogoupgrade.1 bogolexer.1
26
MAN1=		bogofilter.1 bogoutil.1 bogoupgrade.1 bogolexer.1
27
27
28
post-build:
29
	cd ${WRKSRC} && make check SHELL=${SH}
30
31
do-install:
32
	cd ${WRKSRC} && make install prefix=${PREFIX}
33
28
.if !defined(NOPORTDOCS)
34
.if !defined(NOPORTDOCS)
29
post-install:
35
post-install:
30
	@${MKDIR} ${DOCSDIR}
36
	@${MKDIR} ${DOCSDIR}
31
.for i in AUTHORS COPYING INSTALL NEWS README TODO UPGRADE \
37
.for i in AUTHORS COPYING INSTALL NEWS README TODO UPGRADE \
32
	doc/integrating-with-qmail contrib/README.unbase64 \
38
	doc/integrating-with-qmail contrib/README.unbase64 \
33
	README.freebsd README.hp-ux README.solaris
39
	contrib/dot-qmail-bogofilter-default \
40
	README.freebsd README.hp-ux README.dcdflib \
41
	README.Robinson bogofilter-SA-2002-01 METHODS
34
	  ${INSTALL_MAN} ${WRKSRC}/${i} ${DOCSDIR}
42
	  ${INSTALL_MAN} ${WRKSRC}/${i} ${DOCSDIR}
35
.endfor
43
.endfor
36
.for i in bogo.R contrib/bogofilter-qfe contrib/unbase64
44
.for i in bogo.R contrib/bogofilter-qfe contrib/unbase64 \
45
	contrib/bogopass
37
	  ${INSTALL_SCRIPT} ${WRKSRC}/${i} ${DOCSDIR}
46
	  ${INSTALL_SCRIPT} ${WRKSRC}/${i} ${DOCSDIR}
38
.endfor
47
.endfor
39
.endif
48
.endif
(-)/root/bogofilter/distinfo (-1 / +1 lines)
Line 1 Link Here
1
MD5 (bogofilter-0.8.0.tar.gz) = 447d6045f0268c0f6f36c59176c08137
1
MD5 (bogofilter-0.9.1.2.tar.gz) = af65cc2a1dae5597762bc2144344075a
(-)/root/bogofilter/files/patch-Makefile.in (-84 lines)
Lines 1-84 Link Here
1
--- bogofilter-0.8.0/Makefile.in	Sat Nov  9 19:21:40 2002
2
+++ bogofilter-0.8.0.1/Makefile.in	Mon Nov 11 02:07:42 2002
3
@@ -1,4 +1,4 @@
4
-# Makefile.in generated by automake 1.7 from Makefile.am.
5
+# Makefile.in generated by automake 1.7.1 from Makefile.am.
6
 # @configure_input@
7
 
8
 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
9
@@ -119,7 +119,9 @@
10
 man1_MANS = bogofilter.1 bogoutil.1 bogoupgrade.1 bogolexer.1
11
 
12
 # what to build that from
13
-MYCOMMON = xmalloc.h xmalloc.c xstrdup.h xstrdup.c globals.h debug.h debug.c
14
+MYCOMMON = xmalloc.h xmalloc.c xstrdup.h xstrdup.c globals.h debug.h \
15
+debug.c find_home.c find_home.h
16
+
17
 
18
 BUILT_SOURCES = version.h
19
 
20
@@ -164,7 +166,8 @@
21
 check_PROGRAMS = debugtest$(EXEEXT) configtest$(EXEEXT)
22
 PROGRAMS = $(bin_PROGRAMS)
23
 
24
-am__objects_1 = xmalloc.$(OBJEXT) xstrdup.$(OBJEXT) debug.$(OBJEXT)
25
+am__objects_1 = xmalloc.$(OBJEXT) xstrdup.$(OBJEXT) debug.$(OBJEXT) \
26
+	find_home.$(OBJEXT)
27
 am_bogofilter_OBJECTS = bogofilter.$(OBJEXT) main.$(OBJEXT) \
28
 	lexer.$(OBJEXT) datastore_db.$(OBJEXT) config.$(OBJEXT) \
29
 	rstats.$(OBJEXT) wordhash.$(OBJEXT) wordlists.$(OBJEXT) \
30
@@ -206,10 +209,11 @@
31
 @AMDEP_TRUE@	./$(DEPDIR)/bogolexer.Po ./$(DEPDIR)/bogoutil.Po \
32
 @AMDEP_TRUE@	./$(DEPDIR)/config.Po ./$(DEPDIR)/configtest.Po \
33
 @AMDEP_TRUE@	./$(DEPDIR)/datastore_db.Po ./$(DEPDIR)/debug.Po \
34
-@AMDEP_TRUE@	./$(DEPDIR)/debug.main.Po ./$(DEPDIR)/lexer.Po \
35
-@AMDEP_TRUE@	./$(DEPDIR)/main.Po ./$(DEPDIR)/rstats.Po \
36
-@AMDEP_TRUE@	./$(DEPDIR)/wordhash.Po ./$(DEPDIR)/wordlists.Po \
37
-@AMDEP_TRUE@	./$(DEPDIR)/xmalloc.Po ./$(DEPDIR)/xstrdup.Po
38
+@AMDEP_TRUE@	./$(DEPDIR)/debug.main.Po ./$(DEPDIR)/find_home.Po \
39
+@AMDEP_TRUE@	./$(DEPDIR)/lexer.Po ./$(DEPDIR)/main.Po \
40
+@AMDEP_TRUE@	./$(DEPDIR)/rstats.Po ./$(DEPDIR)/wordhash.Po \
41
+@AMDEP_TRUE@	./$(DEPDIR)/wordlists.Po ./$(DEPDIR)/xmalloc.Po \
42
+@AMDEP_TRUE@	./$(DEPDIR)/xstrdup.Po
43
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
44
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
45
 CCLD = $(CC)
46
@@ -351,6 +355,7 @@
47
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/datastore_db.Po@am__quote@
48
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@
49
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.main.Po@am__quote@
50
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/find_home.Po@am__quote@
51
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lexer.Po@am__quote@
52
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
53
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rstats.Po@am__quote@
54
@@ -567,9 +572,11 @@
55
 	mkdir $(distdir)
56
 	$(mkinstalldirs) $(distdir)/. $(distdir)/contrib $(distdir)/doc
57
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
58
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
59
 	list='$(DISTFILES)'; for file in $$list; do \
60
 	  case $$file in \
61
 	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
62
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
63
 	  esac; \
64
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
65
 	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
66
@@ -628,7 +635,6 @@
67
 	chmod a-w $(distdir)
68
 	dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
69
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
70
-	  && $(mkinstalldirs) $$dc_destdir \
71
 	  && cd $(distdir)/=build \
72
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
73
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
74
@@ -641,7 +647,9 @@
75
 	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
76
 	        distuninstallcheck \
77
 	  && chmod -R a-w "$$dc_install_base" \
78
-	  && ({   $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
79
+	  && ({ \
80
+	       (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
81
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
82
 	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
83
 	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
84
 	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
(-)/root/bogofilter/files/patch-config.c (-19 lines)
Lines 1-19 Link Here
1
--- bogofilter-0.8.0/config.c	Thu Oct 31 06:23:32 2002
2
+++ bogofilter-0.8.0.1/config.c	Mon Nov 11 02:06:36 2002
3
@@ -21,6 +21,7 @@
4
 #include "wordlists.h"
5
 #include "xmalloc.h"
6
 #include "xstrdup.h"
7
+#include "find_home.h"
8
 
9
 #ifndef	DEBUG_CONFIG
10
 #define DEBUG_CONFIG(level)	(verbose > level)
11
@@ -150,7 +151,7 @@
12
 
13
     if ( *filename == '~' )
14
     {
15
-	char *home = getenv( "HOME" );
16
+	char *home = find_home(TRUE);
17
 	if ( home == NULL )
18
 	{
19
 	    fprintf( stderr, "Can't find $HOME.\n" );
(-)/root/bogofilter/files/patch-configure (-20 lines)
Lines 1-20 Link Here
1
--- bogofilter-0.8.0/configure	Sat Nov  9 19:21:44 2002
2
+++ bogofilter-0.8.0.1/configure	Mon Nov 11 02:07:43 2002
3
@@ -1500,7 +1500,7 @@
4
 
5
 # Define the identity of the package.
6
  PACKAGE=bogofilter
7
- VERSION=0.8.0
8
+ VERSION=0.8.0.1
9
 
10
 
11
 cat >>confdefs.h <<_ACEOF
12
@@ -2563,7 +2563,7 @@
13
     if depmode=$depmode \
14
        source=conftest.c object=conftest.o \
15
        depfile=conftest.Po tmpdepfile=conftest.TPo \
16
-       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
17
+       $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
18
        grep conftest.h conftest.Po > /dev/null 2>&1 &&
19
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
20
       am_cv_CC_dependencies_compiler_type=$depmode
(-)/root/bogofilter/files/patch-find_home.c (-59 lines)
Lines 1-59 Link Here
1
--- bogofilter-0.8.0/find_home.c	Thu Jan  1 01:00:00 1970
2
+++ bogofilter-0.8.0.1/find_home.c	Mon Nov 11 02:05:44 2002
3
@@ -0,0 +1,56 @@
4
+/* find_home.c -- library function to figure out the home dir of current user */
5
+
6
+/* (C) 2002 by Matthias Andree <matthias.andree@gmx.de>
7
+ *
8
+ * This program is free software; you can redistribute it and/or modify
9
+ * it under the terms of version 2 of the GNU General Public License as
10
+ * published by the Free Software Foundation.
11
+ *
12
+ * This program is distributed in the hope that it will be useful, but
13
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
+ * General Public License for more details, it is in the file named
16
+ * COPYING.
17
+ */
18
+
19
+/* $Id: find_home.c,v 1.5 2002/11/11 00:03:25 m-a Exp $ */
20
+
21
+#include <stdio.h>
22
+#include <stdlib.h>
23
+#include <string.h>
24
+
25
+#include <unistd.h>
26
+#include <pwd.h>
27
+#include <sys/types.h>
28
+
29
+#include "find_home.h"
30
+#include "xmalloc.h"
31
+#include "xstrdup.h"
32
+
33
+/* This function will try to figure out the home directory of the user.
34
+ * 
35
+ * If read_env is not zero, it will try to obtain the HOME environment
36
+ * variable and return if it is defined and not empty.
37
+ * 
38
+ * Then, it will look up the password entry of the current effective
39
+ * user id and return the pw_dir field.
40
+ *
41
+ * This function returns NULL in case of failure.
42
+ */
43
+const char *find_home(int read_env) {
44
+    char *r;
45
+    uid_t u;
46
+    struct passwd *pw;
47
+
48
+    if (read_env) {
49
+	if ((r = getenv("HOME")) != NULL && *r != '\0')
50
+	    return r;
51
+    }
52
+
53
+    u = geteuid();
54
+    pw = getpwuid(u);
55
+    if (pw != NULL) {
56
+	return pw -> pw_dir;
57
+    }
58
+    return NULL;
59
+}
(-)/root/bogofilter/files/patch-find_home.h (-36 lines)
Lines 1-36 Link Here
1
--- bogofilter-0.8.0/find_home.h	Thu Jan  1 01:00:00 1970
2
+++ bogofilter-0.8.0.1/find_home.h	Mon Nov 11 02:05:44 2002
3
@@ -0,0 +1,33 @@
4
+/* $Id: find_home.h,v 1.7 2002/11/11 00:03:25 m-a Exp $ */
5
+
6
+/* find_home.h -- library function to figure out the home dir of current user */
7
+
8
+#ifndef FIND_HOME_H
9
+#define FIND_HOME_H
10
+
11
+/* (C) 2002 by Matthias Andree <matthias.andree@gmx.de>
12
+ *
13
+ * This program is free software; you can redistribute it and/or modify
14
+ * it under the terms of version 2 of the GNU General Public License as
15
+ * published by the Free Software Foundation.
16
+ *
17
+ * This program is distributed in the hope that it will be useful, but
18
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20
+ * General Public License for more details, it is in the file named
21
+ * COPYING.
22
+ */
23
+
24
+/*@null@*/ /*@observer@*/
25
+const char *
26
+find_home(int read_env) /*@globals errno@*/;
27
+
28
+/*@null@*/ /*@observer@*/
29
+const char *
30
+find_home_user(const char *username) /*@globals errno@*/;
31
+
32
+/*@only@*/
33
+char *
34
+tildeexpand(const char *filename) /*@globals errno@*/;
35
+
36
+#endif
(-)/root/bogofilter/files/patch-main.c (-29 lines)
Lines 1-29 Link Here
1
--- bogofilter-0.8.0/main.c	Wed Nov  6 01:07:59 2002
2
+++ bogofilter-0.8.0.1/main.c	Mon Nov 11 02:28:08 2002
3
@@ -26,6 +26,9 @@
4
 #include "version.h"
5
 #include "common.h"
6
 #include "bogofilter.h"
7
+#include "find_home.h"
8
+#include "xmalloc.h"
9
+#include "xstrdup.h"
10
 
11
 #define BOGODIR ".bogofilter"
12
 
13
@@ -254,6 +257,16 @@
14
 {
15
     int   exitcode;
16
 
17
+    if (NULL == getenv("HOME")) {
18
+	const char *t;
19
+	if ((t = find_home(FALSE)) != NULL) {
20
+	    char *t2 = xmalloc(strlen(t) + 6);
21
+	    strcpy(t2, "HOME=");
22
+	    strcat(t2, t);
23
+	    putenv(xstrdup(t2)); /* putenv may leak memory by copying again */
24
+	    free(t2);
25
+	}
26
+    }
27
     set_dir_from_env(directory, "HOME", BOGODIR);
28
     set_dir_from_env(directory, "BOGOFILTER_DIR", NULL);
29
 
(-)/root/bogofilter/files/patch-version.h (-6 lines)
Lines 1-6 Link Here
1
--- bogofilter-0.8.0/version.h	Sat Nov  9 19:22:01 2002
2
+++ bogofilter-0.8.0.1/version.h	Mon Nov 11 02:28:09 2002
3
@@ -1,2 +1,2 @@
4
 #undef  VERSION
5
-#define VERSION "0.8.0"
6
+#define VERSION "0.8.0.1"
(-)/root/bogofilter/files/patch-z-stats (-57 lines)
Lines 1-57 Link Here
1
--- bogofilter.c	Thu Nov  7 07:05:58 2002
2
+++ bogofilter.c	Fri Nov 22 12:51:33 2002
3
@@ -255,10 +255,14 @@
4
 
5
 int compare_extrema(const void *id1, const void *id2)
6
 { 
7
+    double d;
8
     const discrim_t *d1 = id1;
9
     const discrim_t *d2 = id2;
10
-    return ( (d1->prob > d2->prob) ||
11
-	     ((d1->prob == d2->prob) && (strcmp(d1->key, d2->key) > 0)));
12
+    d = d2->prob - d1->prob;
13
+    if (fabs(d) < EPS) return strcmp(d1->key, d2->key);
14
+    if (d1->prob > d2->prob) return 1;
15
+    if (d1->prob < d2->prob) return -1;
16
+    return 0;
17
 }
18
 
19
 void init_bogostats(bogostat_t *bogostats)
20
--- common.h	Mon Oct 28 03:46:17 2002
21
+++ common.h	Fri Nov 22 12:53:23 2002
22
@@ -9,6 +9,10 @@
23
 #include <sys/param.h>
24
 #endif
25
 
26
+#include <float.h>
27
+#define EPS (100.0 * DBL_EPSILON)
28
+
29
+
30
 #include "debug.h"
31
 
32
 #define GOODFILE	"goodlist.db"
33
--- rstats.c	Wed Nov  6 11:45:03 2002
34
+++ rstats.c	Fri Nov 22 12:52:12 2002
35
@@ -84,10 +84,14 @@
36
 
37
 int compare_rstats_t(const void *ir1, const void *ir2)
38
 { 
39
+    double d;
40
     const rstats_t *r1 = *(rstats_t **)ir1;
41
     const rstats_t *r2 = *(rstats_t **)ir2;
42
-    return ( (r1->prob > r2->prob) ||
43
-	     ((r1->prob == r2->prob) && (strcmp(r1->token, r2->token) > 0)));
44
+    d = r1->prob - r2->prob;
45
+    if (fabs(d) < EPS) return strcmp(r1->token, r2->token);
46
+    if (r1->prob > r2->prob) return 1;
47
+    if (r1->prob < r2->prob) return -1;
48
+    return 0;
49
 }
50
 
51
 #define	INTERVALS	10
52
--- version.h	Fri Nov 22 12:55:52 2002
53
+++ version.h	Fri Nov 22 12:55:13 2002
54
@@ -1,2 +1,2 @@
55
 #undef  VERSION
56
-#define VERSION "0.8.0.1"
57
+#define VERSION "0.8.0.freebsd2"
(-)/root/bogofilter/pkg-plist (-16 / +22 lines)
Lines 2-20 Link Here
2
bin/bogolexer
2
bin/bogolexer
3
bin/bogoutil
3
bin/bogoutil
4
bin/bogoupgrade
4
bin/bogoupgrade
5
%%PORTDOCS%%share/doc/bogofilter/AUTHORS
5
etc/bogofilter.cf.example
6
%%PORTDOCS%%share/doc/bogofilter/COPYING
6
%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
7
%%PORTDOCS%%share/doc/bogofilter/INSTALL
7
%%PORTDOCS%%%%DOCSDIR%%/COPYING
8
%%PORTDOCS%%share/doc/bogofilter/NEWS
8
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
9
%%PORTDOCS%%share/doc/bogofilter/README
9
%%PORTDOCS%%%%DOCSDIR%%/METHODS
10
%%PORTDOCS%%share/doc/bogofilter/README.freebsd
10
%%PORTDOCS%%%%DOCSDIR%%/NEWS
11
%%PORTDOCS%%share/doc/bogofilter/README.hp-ux
11
%%PORTDOCS%%%%DOCSDIR%%/README
12
%%PORTDOCS%%share/doc/bogofilter/README.solaris
12
%%PORTDOCS%%%%DOCSDIR%%/README.Robinson
13
%%PORTDOCS%%share/doc/bogofilter/README.unbase64
13
%%PORTDOCS%%%%DOCSDIR%%/README.dcdflib
14
%%PORTDOCS%%share/doc/bogofilter/TODO
14
%%PORTDOCS%%%%DOCSDIR%%/README.freebsd
15
%%PORTDOCS%%share/doc/bogofilter/UPGRADE
15
%%PORTDOCS%%%%DOCSDIR%%/README.hp-ux
16
%%PORTDOCS%%share/doc/bogofilter/bogo.R
16
%%PORTDOCS%%%%DOCSDIR%%/README.unbase64
17
%%PORTDOCS%%share/doc/bogofilter/bogofilter-qfe
17
%%PORTDOCS%%%%DOCSDIR%%/TODO
18
%%PORTDOCS%%share/doc/bogofilter/integrating-with-qmail
18
%%PORTDOCS%%%%DOCSDIR%%/UPGRADE
19
%%PORTDOCS%%share/doc/bogofilter/unbase64
19
%%PORTDOCS%%%%DOCSDIR%%/bogo.R
20
%%PORTDOCS%%@dirrm share/doc/bogofilter
20
%%PORTDOCS%%%%DOCSDIR%%/bogofilter-SA-2002-01
21
%%PORTDOCS%%%%DOCSDIR%%/bogofilter-qfe
22
%%PORTDOCS%%%%DOCSDIR%%/bogopass
23
%%PORTDOCS%%%%DOCSDIR%%/dot-qmail-bogofilter-default
24
%%PORTDOCS%%%%DOCSDIR%%/integrating-with-qmail
25
%%PORTDOCS%%%%DOCSDIR%%/unbase64
26
%%PORTDOCS%%@dirrm %%DOCSDIR%%

Return to bug 46102