SpamAssassin
v4 cover SpamAssassin
V3 -> V4: add remarks from Bernd Kuhls
- SpamAssassin
- add perl-db-file as optional dependency
- set VENDORPREFIX
- set INSTALLVENDORCONF
- fix perl-db-file
- patch from Bernd Kuhls, see https://patchwork.ozlabs.org/patch/553054/
V3:
- fix Perl/CPAN infrastructure
- patch SpamAssassin in order to avoid host-perl modules dependencies
See previous discussion in https://patchwork.ozlabs.org/patch/464635/
Francois Perrad (2):
pkg-perl: avoid insertion of host-perl in shebang of scripts
perl-mail-spamassassin: new package
Bernd Kuhls (1):
package/perl-db-file: Fix berkeleydb detection
package/Config.in | 1 + package/perl-db-file/perl-db-file.mk | 8 +++ .../0001-without-host-perl-dependencies.patch | 64 ++++++++++++++++++++++ package/perl-mail-spamassassin/Config.in | 26 +++++++++ .../perl-mail-spamassassin.hash | 3 + .../perl-mail-spamassassin.mk | 38 +++++++++++++ package/pkg-perl.mk | 1 + 7 files changed, 141 insertions(+) create mode 100644 package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch create mode 100644 package/perl-mail-spamassassin/Config.in create mode 100644 package/perl-mail-spamassassin/perl-mail-spamassassin.hash create mode 100644 package/perl-mail-spamassassin/perl-mail-spamassassin.mk
--
2.5.0
PATCH v4 1/3 pkg-perl: avoid insertion of host-perl in shebang of scripts
--- package/pkg-perl.mk | 1 + 1 file changed, 1 insertion(+)
package/pkg-perl.mk +1 -0
@@ -140,6 +140,7 @@ define $(2)_BUILD_CMDS else \ $$(MAKE1) \ PERL_INC=$$(STAGING_DIR)/usr/lib/perl5/$$(PERL_VERSION)/$$(PERL_ARCHNAME)/CORE \ + FIXIN=: \ $$($(2)_BUILD_OPTS) pure_all; \ fi endef
Signature · 1 line
2.5.0
Thomas Petazzoni
AppliedPATCH v4 1/3 pkg-perl: avoid insertion of host-perl in shebang of scripts
Dear Francois Perrad,
Quoted 4 lines · Francois Perrad
Signed-off-by Francois Perrad <[email protected]>--- package/pkg-perl.mk | 1 + 1 file changed, 1 insertion(+)
Applied, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 2/3 perl-mail-spamassassin: new package
In reply to Francois Perrad--- package/Config.in | 1 + .../0001-without-host-perl-dependencies.patch | 64 ++++++++++++++++++++++ package/perl-mail-spamassassin/Config.in | 26 +++++++++ .../perl-mail-spamassassin.hash | 3 + .../perl-mail-spamassassin.mk | 38 +++++++++++++ 5 files changed, 132 insertions(+) create mode 100644 package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch create mode 100644 package/perl-mail-spamassassin/Config.in create mode 100644 package/perl-mail-spamassassin/perl-mail-spamassassin.hash create mode 100644 package/perl-mail-spamassassin/perl-mail-spamassassin.mk
package/Config.in +1 -0
@@ -553,6 +553,7 @@ menu "Perl libraries/modules" source "package/perl-libwww-perl/Config.in" source "package/perl-lwp-mediatypes/Config.in" source "package/perl-mail-dkim/Config.in" + source "package/perl-mail-spamassassin/Config.in" source "package/perl-mailtools/Config.in" source "package/perl-mime-base64/Config.in" source "package/perl-mojolicious/Config.in"
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch new file +64 -0
64 lines not on this page · raw message
package/perl-mail-spamassassin/Config.in new file +26 -0
@@ -0,0 +1,26 @@ +config BR2_PACKAGE_PERL_MAIL_SPAMASSASSIN + bool "perl-mail-spamassassin" + depends on !BR2_STATIC_LIBS + select BR2_PACKAGE_PERL_DIGEST_SHA1 + select BR2_PACKAGE_PERL_HTML_PARSER + select BR2_PACKAGE_PERL_MAIL_DKIM + select BR2_PACKAGE_PERL_NET_DNS + select BR2_PACKAGE_PERL_NETADDR_IP + help + SpamAssassin is an extensible email filter which is used to identify spam + + http://spamassassin.apache.com/ + +comment "perl-mail-spamassassin needs a toolchain w/ dynamic library" + depends on BR2_STATIC_LIBS + +if BR2_PACKAGE_PERL_MAIL_SPAMASSASSIN + +config BR2_PACKAGE_PERL_MAIL_SPAMASSASSIN_CONTACT_ADDRESS + string "contact address" + default "the administrator of that BR system" + help + What email address or URL should be used in the suspected-spam report + text for users who want more information on your filter installation? + +endif
package/perl-mail-spamassassin/perl-mail-spamassassin.hash new file +3 -0
@@ -0,0 +1,3 @@ +# retrieved by scancpan from http://cpan.metacpan.org/ +md5 76eca1f38c11635d319e62c26d5b034b Mail-SpamAssassin-3.4.1.tar.gz +sha256 9b7a95a594cdca4f265707364478b57813b82a0ec7e520d9bc818bfbcafdd726 Mail-SpamAssassin-3.4.1.tar.gz
package/perl-mail-spamassassin/perl-mail-spamassassin.mk new file +38 -0
@@ -0,0 +1,38 @@ +################################################################################ +# +# perl-mail-spamassassin +# +################################################################################ + +PERL_MAIL_SPAMASSASSIN_VERSION = 3.4.1 +PERL_MAIL_SPAMASSASSIN_SOURCE = Mail-SpamAssassin-$(PERL_MAIL_SPAMASSASSIN_VERSION).tar.gz +PERL_MAIL_SPAMASSASSIN_SITE = $(BR2_CPAN_MIRROR)/authors/id/K/KM/KMCGRAIL/SpamAssassin +PERL_MAIL_SPAMASSASSIN_DEPENDENCIES = perl-digest-sha1 perl-html-parser perl-mail-dkim perl-net-dns perl-netaddr-ip +PERL_MAIL_SPAMASSASSIN_LICENSE = Apache-2.0 + +ifeq ($(BR2_PACKAGE_PERL_DB_FILE),y) +PERL_MAIL_SPAMASSASSIN_DEPENDENCIES += perl-db-file +endif + +ifeq ($(BR2_PACKAGE_PERL_ENCODE_DETECT),y) +PERL_MAIL_SPAMASSASSIN_DEPENDENCIES += perl-encode-detect +endif + +ifeq ($(BR2_PACKAGE_PERL_HTTP_DATE),y) +PERL_MAIL_SPAMASSASSIN_DEPENDENCIES += perl-http-date +endif + +ifeq ($(BR2_PACKAGE_PERL_IO_SOCKET_SSL),y) +PERL_MAIL_SPAMASSASSIN_DEPENDENCIES += perl-io-socket-ssl +endif + +ifeq ($(BR2_PACKAGE_PERL_LIBWWW_PERL),y) +PERL_MAIL_SPAMASSASSIN_DEPENDENCIES += perl-libwww-perl +endif + +PERL_MAIL_SPAMASSASSIN_CONF_OPTS += \ + VENDORPREFIX=/usr \ + INSTALLVENDORCONF=/etc/mail/spamassassin \ + CONTACT_ADDRESS="$(call qstrip,$(BR2_PACKAGE_PERL_MAIL_SPAMASSASSIN_CONTACT_ADDRESS))" + +$(eval $(perl-package))
Signature · 1 line
2.5.0
PATCH v4 2/3 perl-mail-spamassassin: new package
Dear Francois Perrad,
Thanks a lot for working on this. Definitely a lot better than the previous solution from Bernd that required tons of host Perl packages to be added. A few comments below.
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch line 6
Quoted 12 lines · Francois Perrad
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch new file +6
-0@@ -0,0 +1,64 @@ +Remove host-perl-* dependencies + +The module Mail-SpamAssassin tries to do the following things: +1) as usual CPAN module, install many .pm files in /usr/lib/perl5/site_perl/ +and few scripts in /usr/bin. +No issue here.
So, if there's no issue, why do you mention this?
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch line 9
Quoted 3 lines
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch new file +3
-0+2) "compile" SpamAssassin rules, that requires to install/run SpamAssassin on the host side. +As we don't want install host-perl modules, this step is disabled. +Please, considere the installed script `sa-update` for installing the rules for the first time.
considere -> consider
Also, I think this should probably be mentioned in the Config.in help text.
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch line 11
Quoted 2 lines
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch new file +2
-0+3) spamc, an executable which embeds libperl +The cross compilation is not handled, I obtain an host executable.
I -> not good to use such formulation. What about:
"The cross-compilation case is not supported, a host executable gets built. For this reason, this step is disabled."
Also, since you're fixing several independent problems, what about doing a single patch for each problem ?
Do you think you could write the patches in a way that makes them potentially acceptable upstream ?
Quoted 17 lines
package/perl-mail-spamassassin/Config.in new file +11
-0@@ -0,0 +1,26 @@ +config BR2_PACKAGE_PERL_MAIL_SPAMASSASSIN + bool "perl-mail-spamassassin" + depends on !BR2_STATIC_LIBS + select BR2_PACKAGE_PERL_DIGEST_SHA1 + select BR2_PACKAGE_PERL_HTML_PARSER + select BR2_PACKAGE_PERL_MAIL_DKIM + select BR2_PACKAGE_PERL_NET_DNS + select BR2_PACKAGE_PERL_NETADDR_IP + help + SpamAssassin is an extensible email filter which is used to identify spam +
package/perl-mail-spamassassin/Config.in line 21
Quoted 10 lines
package/perl-mail-spamassassin/Config.in new file +10
-0+ http://spamassassin.apache.com/ + +comment "perl-mail-spamassassin needs a toolchain w/ dynamic library" + depends on BR2_STATIC_LIBS + +if BR2_PACKAGE_PERL_MAIL_SPAMASSASSIN + +config BR2_PACKAGE_PERL_MAIL_SPAMASSASSIN_CONTACT_ADDRESS + string "contact address" + default "the administrator of that BR system"
Do we really need a compile time option for this? Can't this be configured at run-time in some configuration file?
Shouldn't the default be an empty string rather than the "the administrator of that BR system" ?
package/perl-mail-spamassassin/Config.in line 24
Quoted 3 lines
package/perl-mail-spamassassin/Config.in new file +3
-0+ help + What email address or URL should be used in the suspected-spam report + text for users who want more information on your filter installation?
Lines too long I believe, please wrap at 72 characters.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 2/3 perl-mail-spamassassin: new package
2015-12-13 16:00 GMT+01:00 Thomas Petazzoni
<[email protected]>:
Quoted 23 lines
Dear Francois Perrad,
Thanks a lot for working on this. Definitely a lot better than the previous solution from Bernd that required tons of host Perl packages to be added. A few comments below.
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch line 6
Quoted 12 lines · Francois Perrad
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch new file +6
-0@@ -0,0 +1,64 @@ +Remove host-perl-* dependencies + +The module Mail-SpamAssassin tries to do the following things: +1) as usual CPAN module, install many .pm files in /usr/lib/perl5/site_perl/ +and few scripts in /usr/bin. +No issue here.So, if there's no issue, why do you mention this?
Quoted 6 lines
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch line 9
Quoted 3 lines
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch new file +3
-0+2) "compile" SpamAssassin rules, that requires to install/run SpamAssassin on the host side. +As we don't want install host-perl modules, this step is disabled. +Please, considere the installed script `sa-update` for installing the rules for the first time.considere -> consider
Ok
Quoted 11 lines
Also, I think this should probably be mentioned in the Config.in help text.
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch line 11
Quoted 2 lines
package/perl-mail-spamassassin/0001-without-host-perl-dependencies.patch new file +2
-0+3) spamc, an executable which embeds libperl +The cross compilation is not handled, I obtain an host executable.I -> not good to use such formulation. What about:
"The cross-compilation case is not supported, a host executable gets built. For this reason, this step is disabled."
Ok.
Quoted 6 lines
Also, since you're fixing several independent problems, what about doing a single patch for each problem ?
Do you think you could write the patches in a way that makes them potentially acceptable upstream ?
No way.
Quoted 22 lines
Quoted 22 lines
package/perl-mail-spamassassin/Config.in new file +16
-0@@ -0,0 +1,26 @@ +config BR2_PACKAGE_PERL_MAIL_SPAMASSASSIN + bool "perl-mail-spamassassin" + depends on !BR2_STATIC_LIBS + select BR2_PACKAGE_PERL_DIGEST_SHA1 + select BR2_PACKAGE_PERL_HTML_PARSER + select BR2_PACKAGE_PERL_MAIL_DKIM + select BR2_PACKAGE_PERL_NET_DNS + select BR2_PACKAGE_PERL_NETADDR_IP + help + SpamAssassin is an extensible email filter which is used to identify spam + + http://spamassassin.apache.com/ + +comment "perl-mail-spamassassin needs a toolchain w/ dynamic library" + depends on BR2_STATIC_LIBS +
Quoted 9 lines
package/perl-mail-spamassassin/Config.in line 21
Quoted 5 lines
package/perl-mail-spamassassin/Config.in new file +5
-0+if BR2_PACKAGE_PERL_MAIL_SPAMASSASSIN + +config BR2_PACKAGE_PERL_MAIL_SPAMASSASSIN_CONTACT_ADDRESS + string "contact address" + default "the administrator of that BR system"Do we really need a compile time option for this? Can't this be configured at run-time in some configuration file?
Yes, the string is subsituted in several scripts, not in single configuration file.
Quoted 3 lines
Shouldn't the default be an empty string rather than the "the administrator of that BR system" ?
This is the default value from the SpamAssassin Makefile.PL, I just added "BR".
Fran?ois
Quoted 17 lines
package/perl-mail-spamassassin/Config.in line 24
Quoted 3 lines
package/perl-mail-spamassassin/Config.in new file +3
-0+ help + What email address or URL should be used in the suspected-spam report + text for users who want more information on your filter installation?Lines too long I believe, please wrap at 72 characters.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
PATCH v4 2/3 perl-mail-spamassassin: new package
Fran?ois,
Quoted 8 lines · Fran?ois Perrad
Quoted 6 lines
Also, since you're fixing several independent problems, what about doing a single patch for each problem ?
Do you think you could write the patches in a way that makes them potentially acceptable upstream ?
No way.
Why ? After all, everything that you did could be made conditional under a CROSS_COMPILE boolean variable for example. Or the BUILD_SPAMC variable could be made to work also on Linux and not only on Windows, etc.
Quoted 10 lines
Quoted 7 lines
package/perl-mail-spamassassin/Config.in line 21
Quoted 3 lines
package/perl-mail-spamassassin/Config.in new file +3
-0+config BR2_PACKAGE_PERL_MAIL_SPAMASSASSIN_CONTACT_ADDRESS + string "contact address" + default "the administrator of that BR system"Do we really need a compile time option for this? Can't this be configured at run-time in some configuration file?
Yes, the string is subsituted in several scripts, not in single configuration file.
Argh :/
Quoted 4 lines
Quoted 2 lines
Shouldn't the default be an empty string rather than the "the administrator of that BR system" ?
This is the default value from the SpamAssassin Makefile.PL, I just added "BR".
I think "the administrator of that BR system" is a pretty silly default string, especially when what is wanted is an e-mail address or URL. So either put contact at dummy.net, or http://dummy.net or something like that.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 3/3 package/perl-db-file: Fix berkeleydb detection
In reply to Francois PerradWithout this patch libdb.so is not detected and lib/perl5/site_perl/5.22.0/i586-linux/auto/DB_File/DB_File.so is not linked against it:
Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -ldb Generating a Unix-style Makefile
Writing Makefile for DB_File
Writing MYMETA.yml and MYMETA.json
Quoted 1 line
Quoted 1 line
Quoted 1 line
perl-db-file 1.835 Building
$ output/host/usr/bin/i586-buildroot-linux-uclibc-readelf -a output/target/usr/lib/perl5/site_perl/5.22.0/i586-linux/auto/DB_File/DB_File.so | grep NEEDED 0x00000001 (NEEDED) Shared library: [libc.so.1]
After applying this patch configure output will look like this:
Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for DB_File
Writing MYMETA.yml and MYMETA.json
Quoted 1 line
Quoted 1 line
Quoted 1 line
perl-db-file 1.835 Building
and the resulting library is correctly linked against libdb:
$ output/host/usr/bin/i586-buildroot-linux-uclibc-readelf -a output/target/usr/lib/perl5/site_perl/5.22.0/i586-linux/auto/DB_File/DB_File.so | grep NEEDED 0x00000001 (NEEDED) Shared library: [libdb-5.3.so] 0x00000001 (NEEDED) Shared library: [libc.so.1]
--- package/perl-db-file/perl-db-file.mk | 8 ++++++++ 1 file changed, 8 insertions(+)
package/perl-db-file/perl-db-file.mk +8 -0
@@ -11,4 +11,12 @@ PERL_DB_FILE_DEPENDENCIES = berkeleydb PERL_DB_FILE_LICENSE = Artistic or GPLv1+ PERL_DB_FILE_LICENSE_FILES = README +define PERL_DB_FILE_FIX_CONFIG_IN + $(SED) 's%^INCLUDE.*%INCLUDE = $(STAGING_DIR)/usr/include%' \ + $(@D)/config.in + $(SED) 's%^LIB.*%LIB = $(STAGING_DIR)/usr/lib%' \ + $(@D)/config.in +endef +PERL_DB_FILE_POST_PATCH_HOOKS += PERL_DB_FILE_FIX_CONFIG_IN + $(eval $(perl-package))
Thomas Petazzoni
AppliedPATCH v4 3/3 package/perl-db-file: Fix berkeleydb detection
Dear Francois Perrad,
Quoted 30 lines · Francois Perrad
Without this patch libdb.so is not detected and
lib/perl5/site_perl/5.22.0/i586-linux/auto/DB_File/DB_File.sois not linked against it:Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -ldb Generating a Unix-styleMakefile
WritingMakefileforDB_File
Writing MYMETA.yml and MYMETA.jsonQuoted 1 line
Quoted 1 line
Quoted 1 line
perl-db-file 1.835 Building
$ output/host/usr/bin/i586-buildroot-linux-uclibc-readelf -a output/target/usr/lib/perl5/site_perl/5.22.0/i586-linux/auto/DB_File/DB_File.so | grep NEEDED 0x00000001 (NEEDED) Shared library: [libc.so.1]After applying this patch configure output will look like this:
Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
Generating a Unix-styleMakefile
WritingMakefileforDB_File
Writing MYMETA.yml and MYMETA.jsonQuoted 1 line
Quoted 1 line
Quoted 1 line
perl-db-file 1.835 Building
and the resulting library is correctly linked against libdb:
Quoted 8 lines
$ output/host/usr/bin/i586-buildroot-linux-uclibc-readelf -a output/target/usr/lib/perl5/site_perl/5.22.0/i586-linux/auto/DB_File/DB_File.so | grep NEEDED 0x00000001 (NEEDED) Shared library: [libdb-5.3.so] 0x00000001 (NEEDED) Shared library: [libc.so.1]Signed-off-by Bernd Kuhls <[email protected]>--- package/perl-db-file/perl-db-file.mk | 8 ++++++++ 1 file changed, 8 insertions(+)
Applied, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com