Hi all, I have written a patch for bogofilter for wrt. problems were: - configure script tries to compile and run a libdb test program but since we are not on the target, it fails. test has been removed - configure tries other tests like the first one that have also been removed by now. patch is for configure and configure.ac - maybe one should only include the configure patch in order to keep the configure.ac with an old timestamp and preventing the autoconf from beeing run.
Hopfuly the dependancies are correct ... (libiconv and libdb) Greetings, Clemens
Index: package/Makefile =================================================================== --- package/Makefile (Revision 2306) +++ package/Makefile (Arbeitskopie) @@ -21,6 +21,7 @@ #package-$(FWRT_PACKAGE_BINUTILS) += binutils package-$(FWRT_PACKAGE_BITCHX) += bitchx package-$(FWRT_PACKAGE_BITLBEE) += bitlbee +package-$(FWRT_PACKAGE_BOGOFILTER) += bogofilter package-$(FWRT_PACKAGE_BLUEZ_FIRMWARE) += bluez-firmware package-$(FWRT_PACKAGE_BLUEZ_LIBS) += bluez-libs package-$(FWRT_PACKAGE_BLUEZ_UTILS) += bluez-utils Index: package/bogofilter/patches/patch-configure_ac =================================================================== --- package/bogofilter/patches/patch-configure_ac (Revision 0) +++ package/bogofilter/patches/patch-configure_ac (Revision 0) @@ -0,0 +1,97 @@ +$FreeWRT$ +--- bogofilter-1.1.3.orig/configure.ac 2006-12-03 04:55:30.000000000 +0100 ++++ bogofilter-1.1.3/configure.ac 2007-03-29 19:25:53.000000000 +0200 +@@ -526,55 +526,55 @@ Cannot link against libdb? Try these ste + dnl check if run-time link works + saveLIBS="$LIBS" + LIBS="$LIBS $LIBDB" +- AC_MSG_CHECKING(if a program can be linked against Berkeley DB and run) +- AC_RUN_IFELSE( +- AC_LANG_PROGRAM([[ ++# AC_MSG_CHECKING(if a program can be linked against Berkeley DB and run) ++# AC_RUN_IFELSE( ++# AC_LANG_PROGRAM([[ + #ifdef HAVE_INTTYPES_H + #include <inttypes.h> + #endif + #include <db.h> +- ]], [[ +-return 0; +- ]]),, +- [AC_MSG_RESULT(no) +- AC_MSG_ERROR([Cannot run a program linked against libdb. +-Did you adjust your library search path to include your libdb?])],) +- AC_MSG_RESULT(yes) ++# ]], [[ ++#return 0; ++# ]]),, ++# [AC_MSG_RESULT(no) ++# AC_MSG_ERROR([Cannot run a program linked against libdb. ++#Did you adjust your library search path to include your libdb?])],) ++# AC_MSG_RESULT(yes) + +- dnl check if header and library of DB library match +- dnl ignore if cross compiling +- AC_MSG_CHECKING(if Berkeley DB header and library versions match) +- rm -r -f bfadtestdir +- mkdir bfadtestdir +- AC_RUN_IFELSE( +- AC_LANG_PROGRAM([[ +- #include <stdlib.h> +- #include <stdio.h> ++# dnl check if header and library of DB library match ++# dnl ignore if cross compiling ++# AC_MSG_CHECKING(if Berkeley DB header and library versions match) ++# rm -r -f bfadtestdir ++# mkdir bfadtestdir ++# AC_RUN_IFELSE( ++# AC_LANG_PROGRAM([[ ++# #include <stdlib.h> ++# #include <stdio.h> + #ifdef HAVE_INTTYPES_H + #include <inttypes.h> + #endif +- #include <db.h> +- ]], [[ +- int maj, min; +- (void)db_version(&maj, &min, 0); +- (void)fprintf(stderr, "headers: %d.%d, library: %d.%d\n", +- DB_VERSION_MAJOR, DB_VERSION_MINOR, maj, min); +- if (maj != DB_VERSION_MAJOR) exit(1); +- if (min != DB_VERSION_MINOR) exit(1); +- exit(0); +- ]]),, +- [AC_MSG_RESULT(no) +- AC_MSG_ERROR(db.h header file and db library version do not match.)],) +- AC_MSG_RESULT(yes) +- AC_CHECK_DECLS(db_create,, +- AC_MSG_ERROR([[Can not locate a suitable Berkeley DB db.h header file. +-Use --with-libdb-prefix=PATH to specify the path to a v3+ install directory. +-You can download Berkeley DB 4.3.x from http://www.sleepycat.com/]]), +- [[#ifdef HAVE_INTTYPES_H ++# #include <db.h> ++# ]], [[ ++# int maj, min; ++# (void)db_version(&maj, &min, 0); ++# (void)fprintf(stderr, "headers: %d.%d, library: %d.%d\n", ++# DB_VERSION_MAJOR, DB_VERSION_MINOR, maj, min); ++# if (maj != DB_VERSION_MAJOR) exit(1); ++# if (min != DB_VERSION_MINOR) exit(1); ++# exit(0); ++# ]]),, ++# [AC_MSG_RESULT(no) ++# AC_MSG_ERROR(db.h header file and db library version do not match.)],) ++# AC_MSG_RESULT(yes) ++# AC_CHECK_DECLS(db_create,, ++# AC_MSG_ERROR([[Can not locate a suitable Berkeley DB db.h header file. ++#Use --with-libdb-prefix=PATH to specify the path to a v3+ install directory. ++#You can download Berkeley DB 4.3.x from http://www.sleepycat.com/]]), ++# [[#ifdef HAVE_INTTYPES_H + #include <inttypes.h> + #endif + #include <db.h>]] +- ) ++# ) + AC_MSG_CHECKING(if Berkeley DB supports shared environments) + if test "x$enable_dbshared_test" != xno && test "x$USE_TRANSACTIONS" != xNO ; then + AC_RUN_IFELSE( Index: package/bogofilter/patches/patch-config_in =================================================================== --- package/bogofilter/patches/patch-config_in (Revision 0) +++ package/bogofilter/patches/patch-config_in (Revision 0) @@ -0,0 +1,14 @@ +$FreeWRT$ +--- bogofilter-1.1.3.orig/config.in 2006-12-03 05:17:24.000000000 +0100 ++++ bogofilter-1.1.3/config.in 2007-03-29 19:28:01.000000000 +0200 +@@ -51,10 +51,6 @@ + /* Have suitable db.h header */ + #undef HAVE_DB_H + +-/* Define to 1 if you have the declaration of `db_create', and to 0 if you +- don't. */ +-#undef HAVE_DECL_DB_CREATE +- + /* Define to 1 if you have the declaration of `getopt', and to 0 if you don't. + */ + #undef HAVE_DECL_GETOPT Index: package/bogofilter/patches/patch-configure =================================================================== --- package/bogofilter/patches/patch-configure (Revision 0) +++ package/bogofilter/patches/patch-configure (Revision 0) @@ -0,0 +1,281 @@ +$FreeWRT$ +--- bogofilter-1.1.3.orig/configure 2006-12-03 05:17:15.000000000 +0100 ++++ bogofilter-1.1.3/configure 2007-03-29 19:27:35.000000000 +0200 +@@ -13464,238 +13464,55 @@ echo "${ECHO_T}$LIBDB" >&6; } + + saveLIBS="$LIBS" + LIBS="$LIBS $LIBDB" +- { echo "$as_me:$LINENO: checking if a program can be linked against Berkeley DB and run" >&5 +-echo $ECHO_N "checking if a program can be linked against Berkeley DB and run... $ECHO_C" >&6; } +- if test "$cross_compiling" = yes; then +- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- ++# AC_MSG_CHECKING(if a program can be linked against Berkeley DB and run) ++# AC_RUN_IFELSE( ++# AC_LANG_PROGRAM([[ + #ifdef HAVE_INTTYPES_H + #include <inttypes.h> + #endif + #include <db.h> ++# ]], [[ ++#return 0; ++# ]]),, ++# [AC_MSG_RESULT(no) ++# AC_MSG_ERROR([Cannot run a program linked against libdb. ++#Did you adjust your library search path to include your libdb?])],) ++# AC_MSG_RESULT(yes) + +-int +-main () +-{ +- +-return 0; +- +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest$ac_exeext +-if { (ac_try="$ac_link" +-case "(($ac_try" in +- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +- *) ac_try_echo=$ac_try;; +-esac +-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +- (eval "$ac_link") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (case "(($ac_try" in +- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +- *) ac_try_echo=$ac_try;; +-esac +-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +- (eval "$ac_try") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- : +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-{ echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } +- { { echo "$as_me:$LINENO: error: Cannot run a program linked against libdb. +-Did you adjust your library search path to include your libdb?" >&5 +-echo "$as_me: error: Cannot run a program linked against libdb. +-Did you adjust your library search path to include your libdb?" >&2;} +- { (exit 1); exit 1; }; } +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- +- { echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6; } +- +- { echo "$as_me:$LINENO: checking if Berkeley DB header and library versions match" >&5 +-echo $ECHO_N "checking if Berkeley DB header and library versions match... $ECHO_C" >&6; } +- rm -r -f bfadtestdir +- mkdir bfadtestdir +- if test "$cross_compiling" = yes; then +- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot run test program while cross compiling +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +- #include <stdlib.h> +- #include <stdio.h> ++# dnl check if header and library of DB library match ++# dnl ignore if cross compiling ++# AC_MSG_CHECKING(if Berkeley DB header and library versions match) ++# rm -r -f bfadtestdir ++# mkdir bfadtestdir ++# AC_RUN_IFELSE( ++# AC_LANG_PROGRAM([[ ++# #include <stdlib.h> ++# #include <stdio.h> + #ifdef HAVE_INTTYPES_H + #include <inttypes.h> + #endif +- #include <db.h> +- +-int +-main () +-{ +- +- int maj, min; +- (void)db_version(&maj, &min, 0); +- (void)fprintf(stderr, "headers: %d.%d, library: %d.%d\n", +- DB_VERSION_MAJOR, DB_VERSION_MINOR, maj, min); +- if (maj != DB_VERSION_MAJOR) exit(1); +- if (min != DB_VERSION_MINOR) exit(1); +- exit(0); +- +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest$ac_exeext +-if { (ac_try="$ac_link" +-case "(($ac_try" in +- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +- *) ac_try_echo=$ac_try;; +-esac +-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +- (eval "$ac_link") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (case "(($ac_try" in +- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +- *) ac_try_echo=$ac_try;; +-esac +-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +- (eval "$ac_try") 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- : +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-{ echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6; } +- { { echo "$as_me:$LINENO: error: db.h header file and db library version do not match." >&5 +-echo "$as_me: error: db.h header file and db library version do not match." >&2;} +- { (exit 1); exit 1; }; } +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +- +- { echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6; } +- { echo "$as_me:$LINENO: checking whether db_create is declared" >&5 +-echo $ECHO_N "checking whether db_create is declared... $ECHO_C" >&6; } +-if test "${ac_cv_have_decl_db_create+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#ifdef HAVE_INTTYPES_H ++# #include <db.h> ++# ]], [[ ++# int maj, min; ++# (void)db_version(&maj, &min, 0); ++# (void)fprintf(stderr, "headers: %d.%d, library: %d.%d\n", ++# DB_VERSION_MAJOR, DB_VERSION_MINOR, maj, min); ++# if (maj != DB_VERSION_MAJOR) exit(1); ++# if (min != DB_VERSION_MINOR) exit(1); ++# exit(0); ++# ]]),, ++# [AC_MSG_RESULT(no) ++# AC_MSG_ERROR(db.h header file and db library version do not match.)],) ++# AC_MSG_RESULT(yes) ++# AC_CHECK_DECLS(db_create,, ++# AC_MSG_ERROR([[Can not locate a suitable Berkeley DB db.h header file. ++#Use --with-libdb-prefix=PATH to specify the path to a v3+ install directory. ++#You can download Berkeley DB 4.3.x from http://www.sleepycat.com/]]), ++# [[#ifdef HAVE_INTTYPES_H + #include <inttypes.h> + #endif +-#include <db.h> +- +- +-int +-main () +-{ +-#ifndef db_create +- (void) db_create; +-#endif +- +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (ac_try="$ac_compile" +-case "(($ac_try" in +- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +- *) ac_try_echo=$ac_try;; +-esac +-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +- (eval "$ac_compile") 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { +- test -z "$ac_c_werror_flag" || +- test ! -s conftest.err +- } && test -s conftest.$ac_objext; then +- ac_cv_have_decl_db_create=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_cv_have_decl_db_create=no +-fi +- +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_db_create" >&5 +-echo "${ECHO_T}$ac_cv_have_decl_db_create" >&6; } +-if test $ac_cv_have_decl_db_create = yes; then +- +-cat >>confdefs.h <<_ACEOF +-#define HAVE_DECL_DB_CREATE 1 +-_ACEOF +- +- +-else +- cat >>confdefs.h <<_ACEOF +-#define HAVE_DECL_DB_CREATE 0 +-_ACEOF +- +-{ { echo "$as_me:$LINENO: error: Can not locate a suitable Berkeley DB db.h header file. +-Use --with-libdb-prefix=PATH to specify the path to a v3+ install directory. +-You can download Berkeley DB 4.3.x from http://www.sleepycat.com/" >&5 +-echo "$as_me: error: Can not locate a suitable Berkeley DB db.h header file. +-Use --with-libdb-prefix=PATH to specify the path to a v3+ install directory. +-You can download Berkeley DB 4.3.x from http://www.sleepycat.com/" >&2;} +- { (exit 1); exit 1; }; } +-fi +- +- ++#include <db.h>]] ++# ) + { echo "$as_me:$LINENO: checking if Berkeley DB supports shared environments" >&5 + echo $ECHO_N "checking if Berkeley DB supports shared environments... $ECHO_C" >&6; } + if test "x$enable_dbshared_test" != xno && test "x$USE_TRANSACTIONS" != xNO ; then Index: package/bogofilter/Config.in =================================================================== --- package/bogofilter/Config.in (Revision 0) +++ package/bogofilter/Config.in (Revision 0) @@ -0,0 +1,25 @@ +config FWRT_PACKAGE_BOGOFILTER + prompt "bogofilter......................... Mail (spam) filter utility" + tristate + default n + select FWRT_PACKAGE_LIBDB + select FWRT_PACKAGE_LIBICONV + help + Filters mail, must be trained. + + http://bogofilter.sourceforge.net + + +config FWRT_PACKAGE_BOGOFILTER_BOGOUTIL + prompt " include bogoutil in firmware image and package file" + bool + default n + depends FWRT_PACKAGE_BOGOFILTER + +config FWRT_PACKAGE_BOGOFILTER_BOGOTUNE + prompt " include bogotune in firmware image and package file" + bool + default n + depends FWRT_PACKAGE_BOGOFILTER + + Index: package/bogofilter/ipkg/bogofilter.control =================================================================== --- package/bogofilter/ipkg/bogofilter.control (Revision 0) +++ package/bogofilter/ipkg/bogofilter.control (Revision 0) @@ -0,0 +1,4 @@ +Package: bogofilter +Priority: optional +Section: mail +Description: Mail filter Index: package/bogofilter/Makefile =================================================================== --- package/bogofilter/Makefile (Revision 0) +++ package/bogofilter/Makefile (Revision 0) @@ -0,0 +1,48 @@ +# $FreeWRT$ +#- +# This file is part of the FreeWRT project. FreeWRT is copyrighted +# material, please see the LICENCE file in the top-level directory +# or at http://www.freewrt.org/licence for details. + +include ${TOPDIR}/rules.mk + +PKG_NAME:= bogofilter +PKG_VERSION:= 1.1.3 +#PKG_RELEASE:= +PKG_MD5SUM:= a816f509324ccb9946a4d89fefe525e1 +PKG_SOURCE_URL:= http://ftp.debian.org/debian/pool/main/b/bogofilter/ +PKG_SOURCE:= ${PKG_NAME}_${PKG_VERSION}.orig.tar.gz + +include ${TOPDIR}/mk/package.mk + +$(eval $(call PKG_template,BOGOFILTER,bogofilter,${PKG_VERSION}-${PKG_RELEASE},${ARCH})) + +CONFIGURE_STYLE= gnu +CONFIGURE_ENV+= ac_cv_c_bigendian=no \ + ac_cv_sizeof_off_t=8 \ + ac_cv_sizeof_int=4 \ + ac_cv_sizeof_long=4 \ + LIBS="-liconv" +CONFIGURE_ARGS+= --without-libsqlite3-prefix \ + --without-libqdbm-prefix \ + --with-included-gsl \ + --with-libdb-prefix=${STAGING_DIR}/usr \ + --disable-transactions +# --without-libdb-prefix +BUILD_STYLE= auto +INSTALL_STYLE= auto + +PKG_DEPENDS:= libdb libiconv + +post-install: + echo 'Depends: ${PKG_DEPENDS}' >>${IDIR_BOGOFILTER}/CONTROL/control + ${INSTALL_DIR} ${IDIR_BOGOFILTER}/usr/bin + ${INSTALL_BIN} ${WRKINST}/usr/bin/${PKG_NAME} ${IDIR_BOGOFILTER}/usr/bin/ +ifeq (${FWRT_PACKAGE_BOGOFILTER_BOGOUTIL},y) + ${INSTALL_BIN} ${WRKINST}/usr/bin/bogoutil ${IDIR_BOGOFILTER}/usr/bin/ +endif +ifeq (${FWRT_PACKAGE_BOGOFILTER_BOGOTUNE},y) + ${INSTALL_BIN} ${WRKINST}/usr/bin/bogotune ${IDIR_BOGOFILTER}/usr/bin/ +endif + +include ${TOPDIR}/mk/pkg-bottom.mk Index: package/Config.in =================================================================== --- package/Config.in (Revision 2306) +++ package/Config.in (Arbeitskopie) @@ -38,6 +38,7 @@ source "package/autossh/Config.in" #source "package/binutils/Config.in" source "package/bitchx/Config.in" +source "package/bogofilter/Config.in" source "package/collectd/Config.in" source "package/cbtt/Config.in" source "package/ctorrent/Config.in" Index: mk/pkg-depend.mk =================================================================== --- mk/pkg-depend.mk (Revision 2306) +++ mk/pkg-depend.mk (Arbeitskopie) @@ -17,6 +17,7 @@ bitchx-compile: ncurses-compile bitlbee-compile: libiconv-compile openssl-compile glib-compile bluez-utils-compile: bluez-libs-compile libusb-compile +bogofilter-compile: libiconv-compile libdb-compile cbtt-compile: mysql-compile zlib-compile uclibc++-compile clinkc-compile: expat-compile cups-compile: zlib-compile
_______________________________________________ freewrt-developers mailing list [email protected] https://www.freewrt.org/lists/listinfo/freewrt-developers
