From c1f982c83f387e666efc85af66af59b1a332a9fd Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Mon, 11 Nov 2019 19:17:48 -0800 Subject: [PATCH] Meta (#154) * updates to Build.PL and Makefile.PL * move feature dependencies into sections * move optional deps to recommends * install_deps: update for Makefile.PL prereq format --- Build.PL | 149 ++++++++++++++------ MANIFEST | 3 +- MANIFEST.SKIP | 13 ++ META.json | 169 +++++++++++++++++------ META.yml | 115 ++++++++++++---- Makefile.PL | 326 ++++++++++++++++++++++++++------------------ TODO.md | 27 ++-- bin/install_deps.pl | 150 +++++++++++--------- 8 files changed, 626 insertions(+), 326 deletions(-) create mode 100644 MANIFEST.SKIP diff --git a/Build.PL b/Build.PL index 4a2e8087..49a3113b 100644 --- a/Build.PL +++ b/Build.PL @@ -1,16 +1,13 @@ - use strict; use warnings; use Module::Build 0.3601; - -my %module_build_args = ( +my $module_build_args = { "build_requires" => { "Module::Build" => "0.3601" }, "configure_requires" => { - "ExtUtils::MakeMaker" => 0, "File::ShareDir::Install" => "0.06", "Module::Build" => "0.3601" }, @@ -21,28 +18,17 @@ my %module_build_args = ( "Marc Bradshaw " ], "dist_name" => "Mail-DMARC", - "dist_version" => "1.20191024", "license" => "perl", "module_name" => "Mail::DMARC", + "release_status" => "stable", + "add_to_cleanup" => [ "dmarc_reports.sqlite", "t/reports-test.sqlite"], "recommends" => { - "CGI" => 0, - "Email::Simple" => 0, - "IO::Compress::Gzip" => 0, - "IO::Compress::Zip" => 0, - "IO::Uncompress::Gunzip" => 0, - "IO::Uncompress::Unzip" => 0, "Mail::DKIM" => 0, # "MIME::Lite" => 0, - "Net::HTTP" => 0, "Net::IMAP::Simple" => 0, - "Net::Server" => 2, - "XML::SAX::ParserFactory" => 0, - "XML::Validator::Schema" => 0, + "Net::SMTPS" => 0, }, - "recursive_test_files" => 1, "requires" => { - "CGI" => 0, - "CPAN" => 0, "Carp" => 0, "Config::Tiny" => 0, "DBD::SQLite" => "1.31", @@ -54,26 +40,16 @@ my %module_build_args = ( "English" => 0, "File::ShareDir" => 0, "Getopt::Long" => 0, - "HTTP::Request" => 0, - "HTTP::Tiny" => 0, "IO::Compress::Gzip" => 0, "IO::Compress::Zip" => 0, "IO::File" => 0, "IO::Socket::SSL" => 0, "IO::Uncompress::Gunzip" => 0, "IO::Uncompress::Unzip" => 0, - "JSON" => 0, - "LWP::UserAgent" => 0, - "Mail::DKIM::PrivateKey" => 0, - "Mail::DKIM::Signer" => 0, - "Mail::DKIM::TextWrap" => 0, "Net::DNS::Resolver" => 0, - "Net::HTTP" => 0, "Net::IDN::Encode" => 0, "Net::IP" => 0, - "Net::SMTPS" => 0, "Net::SSLeay" => 0, - "Net::Server::HTTP" => 0, "POSIX" => 0, "Pod::Usage" => 0, "Regexp::Common" => "2013031301", @@ -84,12 +60,66 @@ my %module_build_args = ( "Test::File::ShareDir" => 0, "URI" => 0, "XML::LibXML" => 0, - "lib" => 0, - "parent" => 0, - "perl" => "5.008", - "strict" => 0, - "warnings" => 0 }, + "auto_features" => { + "mysql" => { + "description" => "MySQL backend storage", + "prereqs" => { + "runtime" => { + "requires" => { + 'DBD::mysql' => '4.001', + } + } + } + }, + "postgres" => { + "description" => "PostgresQL backend storage", + "prereqs" => { + "runtime" => { + "requires" => { + 'DBD::Pg' => '0' + } + } + } + }, + "web_services" => { + "description" => "HTTP API and web UI to DMARC reports", + "prereqs" => { + "runtime" => { + "requires" => { + "CGI" => 0, + "HTTP::Request" => 0, + "HTTP::Tiny" => 0, + "JSON" => 0, + "LWP::UserAgent" => 0, + "Net::HTTP" => 0, + "Net::Server::HTTP" => 0, + "Net::Server" => 2, + } + } + } + }, + "smtp_sending" => { + "description" => "Send DMARC reports via SMTP", + "prereqs" => { + "runtime" => { + "Net::SMTPS" => 0, + "Mail::DKIM::PrivateKey" => 0, + "Mail::DKIM::Signer" => 0, + "Mail::DKIM::TextWrap" => 0, + } + } + }, + "imap_fetch" => { + "description" => "Retrieve DMARC reports from an IMAP account", + "prereqs" => { + "runtime" => { + "Net::IMAP::Simple" => 0, + } + } + } + }, + "recursive_test_files" => 1, "script_files" => [ "bin/dmarc_update_public_suffix_list", "bin/dmarc_send_reports", @@ -107,24 +137,61 @@ my %module_build_args = ( "Test::File::ShareDir" => 0, "Test::More" => 0, "Test::Output" => 0 + }, + "develop_requires" => { + "Test::Pod" => "1.41" + }, + "meta_add" => { + }, + "meta_merge" => { + "prereqs" => { + "test" => { + "recommends" => { + "XML::SAX::ParserFactory" => "0", + "XML::Validator::Schema" => "0" + }, + }, + "develop" => { + "requires" => { + "Test::Pod" => "1.41" + }, + "suggests" => { + "Test::Perl::Critic" => "0" + } + }, + }, + "resources" => { + "bugtracker" => "https://github.com/msimerson/mail-dmarc/issues", + "homepage" => "https://github.com/msimerson/mail-dmarc/wiki", + "repository" => "https://github.com/msimerson/mail-dmarc", + }, + "x_contributors" => [ + "Benny Pedersen ", + "Jean Paul Galea ", + "Marisa Clardy ", + "Priyadi Iman Nurcahyo ", + "Ricardo Signes " + ], } -); - +}; -my %fallback_build_requires = ( +my $fallback_build_requires = { "Module::Build" => "0.3601", "Test::Exception" => 0, "Test::File::ShareDir" => 0, "Test::More" => 0, "Test::Output" => 0 -); - +}; unless ( eval { Module::Build->VERSION(0.4004) } ) { - delete $module_build_args{test_requires}; - $module_build_args{build_requires} = \%fallback_build_requires; + delete $module_build_args->{test_requires}; + $module_build_args->{build_requires} = $fallback_build_requires; } -my $build = Module::Build->new(%module_build_args); +my $build = Module::Build->new(%$module_build_args); + +# if ( $build->prompt( "Database engine", "sqlite" ) ) { +# $build->notes( 'DB_ENGINE' => $build->args('db_engine') ); +# } $build->create_build_script; diff --git a/MANIFEST b/MANIFEST index e9d759fd..3e5a6d83 100644 --- a/MANIFEST +++ b/MANIFEST @@ -8,7 +8,7 @@ bin/dmarc_update_public_suffix_list bin/dmarc_view_reports bin/install_deps.pl Build.PL -Changes +Changes.md DEVELOP.md example/report_cgi.png FAQ.md @@ -43,6 +43,7 @@ lib/Mail/DMARC/Result/Reason.pm LICENSE Makefile.PL MANIFEST This list of files +MANIFEST.SKIP META.json META.yml README.md diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP new file mode 100644 index 00000000..a32d76d6 --- /dev/null +++ b/MANIFEST.SKIP @@ -0,0 +1,13 @@ +.DS_Store +.git +.release +.tar.gz +.travis.yml +^_build +^blib +^Makefile$ +^Build$ +^MANIFEST\.bak$ +^MYMETA. +dmarc_reports.sqlite +t/reports-test.sqlite diff --git a/META.json b/META.json index d39921a4..773b2738 100644 --- a/META.json +++ b/META.json @@ -5,48 +5,33 @@ "Davide Migliavacca ", "Marc Bradshaw " ], - "dynamic_config" : 0, + "dynamic_config" : 1, + "generated_by" : "Module::Build version 0.4229, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : 2 + "version" : "2" }, "name" : "Mail-DMARC", "prereqs" : { "build" : { - "requires" : { - "Module::Build" : "0.3601" - } + "requires" : {} }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", - "File::ShareDir::Install" : "0.06", - "Module::Build" : "0.3601" - } - }, - "develop" : { - "requires" : { - "Test::Pod" : "1.41" + "File::ShareDir::Install" : "0.06" } }, "runtime" : { "recommends" : { - "CGI" : "0", - "Email::Simple" : "0", - "IO::Compress::Gzip" : "0", - "IO::Compress::Zip" : "0", - "IO::Uncompress::Gunzip" : "0", - "IO::Uncompress::Unzip" : "0", "Mail::DKIM" : "0", - "Net::HTTP" : "0", "Net::IMAP::Simple" : "0", - "Net::Server" : "2" + "Net::SMTPS" : "0" }, "requires" : { - "CGI" : "0", "CPAN" : "0", "Carp" : "0", "Config::Tiny" : "0", @@ -59,26 +44,19 @@ "English" : "0", "File::ShareDir" : "0", "Getopt::Long" : "0", - "HTTP::Request" : "0", - "HTTP::Tiny" : "0", "IO::Compress::Gzip" : "0", "IO::Compress::Zip" : "0", "IO::File" : "0", "IO::Socket::SSL" : "0", "IO::Uncompress::Gunzip" : "0", "IO::Uncompress::Unzip" : "0", - "JSON" : "0", - "LWP::UserAgent" : "0", "Mail::DKIM::PrivateKey" : "0", "Mail::DKIM::Signer" : "0", "Mail::DKIM::TextWrap" : "0", "Net::DNS::Resolver" : "0", - "Net::HTTP" : "0", "Net::IDN::Encode" : "0", "Net::IP" : "0", - "Net::SMTPS" : "0", "Net::SSLeay" : "0", - "Net::Server::HTTP" : "0", "POSIX" : "0", "Pod::Usage" : "0", "Regexp::Common" : "2013031301", @@ -86,22 +64,12 @@ "Socket6" : "0.23", "Sys::Hostname" : "0", "Sys::Syslog" : "0", - "Test::File::ShareDir" : "0", "URI" : "0", "XML::LibXML" : "0", - "lib" : "0", - "parent" : "0", - "perl" : "5.008", - "strict" : "0", - "warnings" : "0" + "perl" : "5.008" } }, "test" : { - "recommends" : { - "Test::Output" : "0", - "XML::SAX::ParserFactory" : "0", - "XML::Validator::Schema" : "0" - }, "requires" : { "Test::Exception" : "0", "Test::File::ShareDir" : "0", @@ -110,25 +78,136 @@ } } }, + "provides" : { + "Mail::DMARC" : { + "file" : "lib/Mail/DMARC.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Base" : { + "file" : "lib/Mail/DMARC/Base.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::HTTP" : { + "file" : "lib/Mail/DMARC/HTTP.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Policy" : { + "file" : "lib/Mail/DMARC/Policy.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::PurePerl" : { + "file" : "lib/Mail/DMARC/PurePerl.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report" : { + "file" : "lib/Mail/DMARC/Report.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Aggregate" : { + "file" : "lib/Mail/DMARC/Report/Aggregate.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Aggregate::Metadata" : { + "file" : "lib/Mail/DMARC/Report/Aggregate/Metadata.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Aggregate::Record" : { + "file" : "lib/Mail/DMARC/Report/Aggregate/Record.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Aggregate::Record::Auth_Results" : { + "file" : "lib/Mail/DMARC/Report/Aggregate/Record/Auth_Results.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM" : { + "file" : "lib/Mail/DMARC/Report/Aggregate/Record/Auth_Results/DKIM.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF" : { + "file" : "lib/Mail/DMARC/Report/Aggregate/Record/Auth_Results/SPF.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Aggregate::Record::Identifiers" : { + "file" : "lib/Mail/DMARC/Report/Aggregate/Record/Identifiers.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Aggregate::Record::Row" : { + "file" : "lib/Mail/DMARC/Report/Aggregate/Record/Row.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Aggregate::Record::Row::Policy_Evaluated" : { + "file" : "lib/Mail/DMARC/Report/Aggregate/Record/Row/Policy_Evaluated.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Receive" : { + "file" : "lib/Mail/DMARC/Report/Receive.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Send" : { + "file" : "lib/Mail/DMARC/Report/Send.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Send::HTTP" : { + "file" : "lib/Mail/DMARC/Report/Send/HTTP.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Send::SMTP" : { + "file" : "lib/Mail/DMARC/Report/Send/SMTP.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Store" : { + "file" : "lib/Mail/DMARC/Report/Store.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Store::SQL" : { + "file" : "lib/Mail/DMARC/Report/Store/SQL.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Store::SQL::Grammars::MySQL" : { + "file" : "lib/Mail/DMARC/Report/Store/SQL/Grammars/MySQL.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Store::SQL::Grammars::PostgreSQL" : { + "file" : "lib/Mail/DMARC/Report/Store/SQL/Grammars/PostgreSQL.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::Store::SQL::Grammars::SQLite" : { + "file" : "lib/Mail/DMARC/Report/Store/SQL/Grammars/SQLite.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Report::URI" : { + "file" : "lib/Mail/DMARC/Report/URI.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Result" : { + "file" : "lib/Mail/DMARC/Result.pm", + "version" : "1.20191025" + }, + "Mail::DMARC::Result::Reason" : { + "file" : "lib/Mail/DMARC/Result/Reason.pm", + "version" : "1.20191025" + } + }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/msimerson/mail-dmarc/issues" }, "homepage" : "https://github.com/msimerson/mail-dmarc/wiki", + "license" : [ + "http://dev.perl.org/licenses/" + ], "repository" : { - "type" : "git", - "url" : "git://github.com/msimerson/mail-dmarc.git", - "web" : "https://github.com/msimerson/mail-dmarc" + "url" : "https://github.com/msimerson/mail-dmarc" } }, - "version" : "1.20191024", + "version" : "1.20191025", "x_contributors" : [ "Benny Pedersen ", "Jean Paul Galea ", "Marisa Clardy ", "Priyadi Iman Nurcahyo ", "Ricardo Signes " - ] + ], + "x_serialization_backend" : "JSON::PP version 2.27400_02" } - diff --git a/META.yml b/META.yml index ee32bf57..fd0c4fc1 100644 --- a/META.yml +++ b/META.yml @@ -3,9 +3,8 @@ abstract: 'Perl implementation of DMARC' author: - 'Matt Simerson ' - 'Davide Migliavacca ' - - 'Marc Bradshaw ' + - 'Marc Bradshaw ' build_requires: - Module::Build: '0.3601' Test::Exception: '0' Test::File::ShareDir: '0' Test::More: '0' @@ -13,26 +12,100 @@ build_requires: configure_requires: ExtUtils::MakeMaker: '0' File::ShareDir::Install: '0.06' - Module::Build: '0.3601' dynamic_config: 0 +generated_by: 'Module::Build version 0.4229, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Mail-DMARC +provides: + Mail::DMARC: + file: lib/Mail/DMARC.pm + version: '1.20191025' + Mail::DMARC::Base: + file: lib/Mail/DMARC/Base.pm + version: '1.20191025' + Mail::DMARC::HTTP: + file: lib/Mail/DMARC/HTTP.pm + version: '1.20191025' + Mail::DMARC::Policy: + file: lib/Mail/DMARC/Policy.pm + version: '1.20191025' + Mail::DMARC::PurePerl: + file: lib/Mail/DMARC/PurePerl.pm + version: '1.20191025' + Mail::DMARC::Report: + file: lib/Mail/DMARC/Report.pm + version: '1.20191025' + Mail::DMARC::Report::Aggregate: + file: lib/Mail/DMARC/Report/Aggregate.pm + version: '1.20191025' + Mail::DMARC::Report::Aggregate::Metadata: + file: lib/Mail/DMARC/Report/Aggregate/Metadata.pm + version: '1.20191025' + Mail::DMARC::Report::Aggregate::Record: + file: lib/Mail/DMARC/Report/Aggregate/Record.pm + version: '1.20191025' + Mail::DMARC::Report::Aggregate::Record::Auth_Results: + file: lib/Mail/DMARC/Report/Aggregate/Record/Auth_Results.pm + version: '1.20191025' + Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM: + file: lib/Mail/DMARC/Report/Aggregate/Record/Auth_Results/DKIM.pm + version: '1.20191025' + Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF: + file: lib/Mail/DMARC/Report/Aggregate/Record/Auth_Results/SPF.pm + version: '1.20191025' + Mail::DMARC::Report::Aggregate::Record::Identifiers: + file: lib/Mail/DMARC/Report/Aggregate/Record/Identifiers.pm + version: '1.20191025' + Mail::DMARC::Report::Aggregate::Record::Row: + file: lib/Mail/DMARC/Report/Aggregate/Record/Row.pm + version: '1.20191025' + Mail::DMARC::Report::Aggregate::Record::Row::Policy_Evaluated: + file: lib/Mail/DMARC/Report/Aggregate/Record/Row/Policy_Evaluated.pm + version: '1.20191025' + Mail::DMARC::Report::Receive: + file: lib/Mail/DMARC/Report/Receive.pm + version: '1.20191025' + Mail::DMARC::Report::Send: + file: lib/Mail/DMARC/Report/Send.pm + version: '1.20191025' + Mail::DMARC::Report::Send::HTTP: + file: lib/Mail/DMARC/Report/Send/HTTP.pm + version: '1.20191025' + Mail::DMARC::Report::Send::SMTP: + file: lib/Mail/DMARC/Report/Send/SMTP.pm + version: '1.20191025' + Mail::DMARC::Report::Store: + file: lib/Mail/DMARC/Report/Store.pm + version: '1.20191025' + Mail::DMARC::Report::Store::SQL: + file: lib/Mail/DMARC/Report/Store/SQL.pm + version: '1.20191025' + Mail::DMARC::Report::Store::SQL::Grammars::MySQL: + file: lib/Mail/DMARC/Report/Store/SQL/Grammars/MySQL.pm + version: '1.20191025' + Mail::DMARC::Report::Store::SQL::Grammars::PostgreSQL: + file: lib/Mail/DMARC/Report/Store/SQL/Grammars/PostgreSQL.pm + version: '1.20191025' + Mail::DMARC::Report::Store::SQL::Grammars::SQLite: + file: lib/Mail/DMARC/Report/Store/SQL/Grammars/SQLite.pm + version: '1.20191025' + Mail::DMARC::Report::URI: + file: lib/Mail/DMARC/Report/URI.pm + version: '1.20191025' + Mail::DMARC::Result: + file: lib/Mail/DMARC/Result.pm + version: '1.20191025' + Mail::DMARC::Result::Reason: + file: lib/Mail/DMARC/Result/Reason.pm + version: '1.20191025' recommends: - CGI: '0' - Email::Simple: '0' - IO::Compress::Gzip: '0' - IO::Compress::Zip: '0' - IO::Uncompress::Gunzip: '0' - IO::Uncompress::Unzip: '0' Mail::DKIM: '0' - Net::HTTP: '0' Net::IMAP::Simple: '0' - Net::Server: '2' + Net::SMTPS: '0' requires: - CGI: '0' CPAN: '0' Carp: '0' Config::Tiny: '0' @@ -45,26 +118,19 @@ requires: English: '0' File::ShareDir: '0' Getopt::Long: '0' - HTTP::Request: '0' - HTTP::Tiny: '0' IO::Compress::Gzip: '0' IO::Compress::Zip: '0' IO::File: '0' IO::Socket::SSL: '0' IO::Uncompress::Gunzip: '0' IO::Uncompress::Unzip: '0' - JSON: '0' - LWP::UserAgent: '0' Mail::DKIM::PrivateKey: '0' Mail::DKIM::Signer: '0' Mail::DKIM::TextWrap: '0' Net::DNS::Resolver: '0' - Net::HTTP: '0' Net::IDN::Encode: '0' Net::IP: '0' - Net::SMTPS: '0' Net::SSLeay: '0' - Net::Server::HTTP: '0' POSIX: '0' Pod::Usage: '0' Regexp::Common: '2013031301' @@ -72,22 +138,19 @@ requires: Socket6: '0.23' Sys::Hostname: '0' Sys::Syslog: '0' - Test::File::ShareDir: '0' URI: '0' XML::LibXML: '0' - lib: '0' - parent: '0' perl: '5.008' - strict: '0' - warnings: '0' resources: bugtracker: https://github.com/msimerson/mail-dmarc/issues homepage: https://github.com/msimerson/mail-dmarc/wiki - repository: git://github.com/msimerson/mail-dmarc.git -version: '1.20191024' + license: http://dev.perl.org/licenses/ + repository: https://github.com/msimerson/mail-dmarc +version: '1.20191025' x_contributors: - 'Benny Pedersen ' - 'Jean Paul Galea ' - 'Marisa Clardy ' - 'Priyadi Iman Nurcahyo ' - 'Ricardo Signes ' +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff --git a/Makefile.PL b/Makefile.PL index 22559210..fb5ef5b3 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,9 +1,7 @@ - use strict; -use warnings; +use warnings FATAL => 'all'; use 5.008; - use ExtUtils::MakeMaker; use File::ShareDir::Install; @@ -11,18 +9,159 @@ $File::ShareDir::Install::INCLUDE_DOTFILES = 1; $File::ShareDir::Install::INCLUDE_DOTDIRS = 1; install_share dist => "share"; +my %META = ( + "prereqs" => { + "configure" => { + "requires" => { + "ExtUtils::MakeMaker" => 0, + "File::ShareDir::Install" => "0.06", + } + }, + "build" => { + "requires" => { + } + }, + "test" => { + "recommends" => { + "XML::SAX::ParserFactory" => "0", + "XML::Validator::Schema" => "0" + }, + "requires" => { + "Test::Exception" => 0, + "Test::File::ShareDir" => 0, + "Test::More" => 0, + "Test::Output" => 0 + } + }, + "runtime" => { + "recommends" => { + "CGI" => 0, + "HTTP::Request" => 0, + "HTTP::Tiny" => 0, + "JSON" => 0, + "LWP::UserAgent" => 0, + "Mail::DKIM::PrivateKey" => 0, + "Mail::DKIM::Signer" => 0, + "Mail::DKIM::TextWrap" => 0, + "Net::HTTP" => 0, + "Net::SMTPS" => 0, + "Net::Server::HTTP" => 0, + }, + "requires" => { + "CPAN" => 0, + "Carp" => 0, + "Config::Tiny" => 0, + "DBD::SQLite" => "1.31", + "DBIx::Simple" => "1.35", + "Data::Dumper" => 0, + "Email::MIME" => 0, + "Email::Simple" => 0, + "Encode" => 0, + "English" => 0, + "File::ShareDir" => 0, + "Getopt::Long" => 0, + "IO::Compress::Gzip" => 0, + "IO::Compress::Zip" => 0, + "IO::File" => 0, + "IO::Socket::SSL" => 0, + "IO::Uncompress::Gunzip" => 0, + "IO::Uncompress::Unzip" => 0, + "Net::DNS::Resolver" => 0, + "Net::IDN::Encode" => 0, + "Net::IP" => 0, + "Net::SSLeay" => 0, + "POSIX" => 0, + "Pod::Usage" => 0, + "Regexp::Common" => "2013031301", + "Socket" => 0, + "Socket6" => "0.23", + "Sys::Hostname" => 0, + "Sys::Syslog" => 0, + "URI" => 0, + "XML::LibXML" => 0, + } + }, + "develop" => { + "requires" => { + }, + "suggests" => { + } + }, + }, + "resources" => { + "bugtracker" => { + "web" => "https://github.com/msimerson/mail-dmarc/issues" + }, + "homepage" => "https://github.com/msimerson/mail-dmarc/wiki", + "repository" => { + "type" => "git", + "url" => "git://github.com/msimerson/mail-dmarc.git", + "web" => "https://github.com/msimerson/mail-dmarc" + }, + "license" => [ 'http://dev.perl.org/licenses/' ], + }, + "optional_features" => { + "MySQL" => { + "description" => "MySQL backend storage", + "prereqs" => { + "runtime" => { + "requires" => { + 'DBD::mysql' => '4.001', + } + } + } + }, + "Postgres" => { + "description" => "PostgresQL backend storage", + "prereqs" => { + "runtime" => { + "requires" => { + 'DBD::Pg' => '0' + } + } + } + }, + "web_service" => { + "description" => "HTTP web UI to DMARC reports", + "prereqs" => { + "runtime" => { + "requires" => { + "CGI" => 0, + "HTTP::Request" => 0, + "HTTP::Tiny" => 0, + "JSON" => 0, + "Net::HTTP" => 0, + "Net::Server::HTTP" => 0, + } + } + } + }, + "smtp_sending" => { + "description" => "Send DMARC reports via SMTP", + "prereqs" => { + "runtime" => { + "Net::SMTPS" => 0, + "Mail::DKIM::PrivateKey" => 0, + "Mail::DKIM::Signer" => 0, + "Mail::DKIM::TextWrap" => 0, + } + } + }, + "imap_fetch" => { + "description" => "Retrieve DMARC reports from an IMAP account", + "prereqs" => { + "runtime" => { + "Net::IMAP::Simple" => 0, + } + } + } + }, +); -my %WriteMakefileArgs = ( +my %MM_ARGS = ( + "NAME" => "Mail::DMARC", "ABSTRACT" => "Perl implementation of DMARC", "AUTHOR" => "Matt Simerson , Davide Migliavacca , Marc Bradshaw ", - "BUILD_REQUIRES" => { - "Module::Build" => "0.3601" - }, - "CONFIGURE_REQUIRES" => { - "ExtUtils::MakeMaker" => 0, - "File::ShareDir::Install" => "0.06", - "Module::Build" => "0.3601" - }, "DISTNAME" => "Mail-DMARC", "EXE_FILES" => [ "bin/dmarc_update_public_suffix_list", @@ -33,136 +172,57 @@ my %WriteMakefileArgs = ( "bin/dmarc_http_client", "bin/dmarc_view_reports" ], - "LICENSE" => "perl", - "MIN_PERL_VERSION" => "5.008", - "NAME" => "Mail::DMARC", - "PREREQ_PM" => { - "CGI" => 0, - "CPAN" => 0, - "Carp" => 0, - "Config::Tiny" => 0, - "DBD::SQLite" => "1.31", - "DBIx::Simple" => "1.35", - "Data::Dumper" => 0, - "Email::MIME" => 0, - "Email::Simple" => 0, - "Encode" => 0, - "English" => 0, - "File::ShareDir" => 0, - "Getopt::Long" => 0, - "HTTP::Request" => 0, - "HTTP::Tiny" => 0, - "IO::Compress::Gzip" => 0, - "IO::Compress::Zip" => 0, - "IO::File" => 0, - "IO::Socket::SSL" => 0, - "IO::Uncompress::Gunzip" => 0, - "IO::Uncompress::Unzip" => 0, - "JSON" => 0, - "LWP::UserAgent" => 0, - "Mail::DKIM::PrivateKey" => 0, - "Mail::DKIM::Signer" => 0, - "Mail::DKIM::TextWrap" => 0, - "Net::DNS::Resolver" => 0, - "Net::HTTP" => 0, - "Net::IDN::Encode" => 0, - "Net::IP" => 0, - "Net::SMTPS" => 0, - "Net::SSLeay" => 0, - "Net::Server::HTTP" => 0, - "POSIX" => 0, - "Pod::Usage" => 0, - "Regexp::Common" => "2013031301", - "Socket" => 0, - "Socket6" => "0.23", - "Sys::Hostname" => 0, - "Sys::Syslog" => 0, - "Test::File::ShareDir" => 0, - "URI" => 0, - "XML::LibXML" => 0, - "lib" => 0, - "parent" => 0, - "strict" => 0, - "warnings" => 0 - }, - "TEST_REQUIRES" => { - "Test::Exception" => 0, - "Test::File::ShareDir" => 0, - "Test::More" => 0, - "Test::Output" => 0 + "META_MERGE" => { + "meta-spec" => { version => 2 }, + "x_contributors" => [ + "Benny Pedersen ", + "Jean Paul Galea ", + "Marisa Clardy ", + "Priyadi Iman Nurcahyo ", + "Ricardo Signes " + ], }, - "VERSION" => "1.20191024", + "MIN_PERL_VERSION" => "5.008", + "VERSION" => "1.20191025", "test" => { "TESTS" => "t/*.t" - } + }, + "clean" => { "FILES" => [ "dmarc_reports.sqlite", "t/reports-test.sqlite", 'MANIFEST.bak' ] }, ); +# some nifty boilerplate from local::lib +my $requires = $MM_ARGS{PREREQ_PM} = { %{$META{prereqs}{runtime}{requires}} }; -my %FallbackPrereqs = ( - "CGI" => 0, - "CPAN" => 0, - "Carp" => 0, - "Config::Tiny" => 0, - "DBD::SQLite" => "1.31", - "DBIx::Simple" => "1.35", - "Data::Dumper" => 0, - "Email::MIME" => 0, - "Email::Simple" => 0, - "Encode" => 0, - "English" => 0, - "ExtUtils::MakeMaker" => 0, - "File::ShareDir" => 0, - "File::ShareDir::Install" => "0.06", - "Getopt::Long" => 0, - "HTTP::Request" => 0, - "HTTP::Tiny" => 0, - "IO::Compress::Gzip" => 0, - "IO::Compress::Zip" => 0, - "IO::File" => 0, - "IO::Socket::SSL" => 0, - "IO::Uncompress::Gunzip" => 0, - "IO::Uncompress::Unzip" => 0, - "JSON" => 0, - "LWP::UserAgent" => 0, - "Mail::DKIM::PrivateKey" => 0, - "Mail::DKIM::Signer" => 0, - "Mail::DKIM::TextWrap" => 0, - "Module::Build" => "0.3601", - "Net::DNS::Resolver" => 0, - "Net::HTTP" => 0, - "Net::IDN::Encode" => 0, - "Net::IP" => 0, - "Net::SMTPS" => 0, - "Net::SSLeay" => 0, - "Net::Server::HTTP" => 0, - "POSIX" => 0, - "Pod::Usage" => 0, - "Regexp::Common" => "2013031301", - "Socket" => 0, - "Socket6" => "0.23", - "Sys::Hostname" => 0, - "Sys::Syslog" => 0, - "Test::Exception" => 0, - "Test::File::ShareDir" => 0, - "Test::More" => 0, - "Test::Output" => 0, - "URI" => 0, - "XML::LibXML" => 0, - "lib" => 0, - "parent" => 0, - "strict" => 0, - "warnings" => 0 -); +$MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }; + +for (qw(configure build test runtime)) { + my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES'; + my $r = $MM_ARGS{$key} = { + %{$META{prereqs}{$_}{requires} || {}}, + %{delete $MM_ARGS{$key} || {}}, + }; + defined $r->{$_} or delete $r->{$_} for keys %$r; +} + +my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; + +if ( $eumm_version < 6.47_01 ) { + delete $MM_ARGS{MIN_PERL_VERSION}; +} + +if ( $eumm_version < 6.51_03 ) { + delete $MM_ARGS{CONFIGURE_REQUIRES}; +} +if ( $eumm_version < 6.63_03 ) { + $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}; +} -unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { - delete $WriteMakefileArgs{TEST_REQUIRES}; - delete $WriteMakefileArgs{BUILD_REQUIRES}; - $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; +if ( $eumm_version < 6.55_01 ) { + $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}} } -delete $WriteMakefileArgs{CONFIGURE_REQUIRES} - unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; +my %WriteMakefileArgs = (%MM_ARGS); WriteMakefile(%WriteMakefileArgs); @@ -171,5 +231,3 @@ package MY; use File::ShareDir::Install qw(postamble); } - - diff --git a/TODO.md b/TODO.md index ea6b2c44..b44c5e5a 100644 --- a/TODO.md +++ b/TODO.md @@ -1,19 +1,20 @@ -* Forensic reports -* HTTP report delivery -* more SMTP error reporting -* Report SPF records in dmarc\_lookup output -* add a 'cron' mode for dmarc\_send and dmarc\_receive, if no controlling TTY, don't output status messages -* skip DMARC reporting for incoming DMARC reports destined to config->organization->email -* expand Public Suffix List tests with - http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test\_psl.txt?raw=1 +### Planned Features -# Maybe TODO: +* [ ] Forensic reports +* [ ] HTTP report delivery +* [ ] more SMTP error reporting +* [ ] Report SPF records in dmarc\_lookup output +* [ ] add a 'cron' mode for dmarc\_send and dmarc\_receive, if no controlling TTY, don't output status messages +* [ ] skip DMARC reporting for incoming DMARC reports destined to config->organization->email -* detect > 1 From recipient, apply strongest policy +### Maybe TODO: -# Done +* [ ] detect > 1 From recipient, apply strongest policy -* automatically delete reports after 12 delivery errors -* send a 'too big' notification email + +### Done + +* [x] automatically delete reports after 12 delivery errors +* [x] send a 'too big' notification email diff --git a/bin/install_deps.pl b/bin/install_deps.pl index 2604ee40..b00da1ef 100755 --- a/bin/install_deps.pl +++ b/bin/install_deps.pl @@ -1,10 +1,11 @@ #!/usr/bin/perl -# VERSION 1.10 +# VERSION 1.11 use strict; use warnings; use CPAN; +use Data::Dumper; use English qw( -no_match_vars ); my $apps = [ @@ -21,7 +22,6 @@ }; foreach ( get_perl_modules() ) { -#print Dumper($_); my $module = $_->{module} or die 'missing module name'; ## no critic (Carp) next if $module eq 'perl'; my $info = $_->{info}; @@ -55,31 +55,46 @@ sub get_perl_modules { return get_perl_modules_from_Makefile_PL(); }; die "unable to find module list. Run this script in the dist dir\n"; ## no critic (Carp) -}; +} sub get_perl_modules_from_Makefile_PL { my $fh = IO::File->new( 'Makefile.PL', 'r' ) or die "unable to read Makefile.PL\n"; ## no critic (Carp) - my $in = 0; + my $depth = 0; my @modules; while ( my $line = <$fh> ) { - if ( $line =~ /PREREQ_PM/ ) { - $in++; + chomp $line; + if ( $line =~ /"(PREREQ_PM|prereqs)"\s*=>\s*{/ ) { + $depth++; + # print "$depth: $line (" . scalar @modules . ")\n"; + next; + } + next if $depth < 1; + if ($line =~ /(prereqs|configure|build|test|runtime|develop|requires|recommends|suggests).*{/){ + $depth++; + # print "$depth: $line (" . scalar @modules . ")\n"; + next; + } + if ($line =~ /}/) { + # print "$depth: $line (" . scalar @modules . ")\n"; + $depth--; + last if $depth == 0; next; }; - next if ! $in; - last if $line =~ /}/; - next if $line !~ /=/; # no = char means not a module - my ($mod,$ver) = split /\s*=\s*/, $line; + if ($line !~ /=/) { # no = char means not a module + print "$line\n"; + next; + } + my ($mod, $ver) = split /\s*=\s*/, $line; $mod =~ s/[\s'"\#]*//xg; # strip whitespace & quotes ## no critic (Regex) next if ! $mod; push @modules, name_overrides($mod); -#print "module: .$mod.\n"; + # print "module: .$mod.\n"; } $fh->close; return @modules; -}; +} sub get_perl_modules_from_ini { my $fh = IO::File->new( 'dist.ini', 'r' ) @@ -96,7 +111,7 @@ sub get_perl_modules_from_ini { next; }; next if ! $in; -# print "line: $line\n"; + # print "line: $line\n"; next if ';' eq substr($line,0,1); # comment last if '[' eq substr($line,0,1); # [...] starts a new section my ($mod,$ver) = split /\s*=\s*/, $line; @@ -106,9 +121,9 @@ sub get_perl_modules_from_ini { print "module: $mod\n"; } $fh->close; -#print Dumper(\@modules); + # print Dumper(\@modules); return @modules; -}; +} sub install_app { my ( $app, $info ) = @_; @@ -123,7 +138,7 @@ sub install_app { install_app_linux( $app, $info ); }; return; -}; +} sub install_app_darwin { my ($app, $info ) = @_; @@ -161,7 +176,7 @@ sub install_app_freebsd { print "installing $app"; return install_app_freebsd_port($app, $info); -}; +} sub install_app_freebsd_port { my ( $app, $info ) = @_; @@ -177,7 +192,7 @@ sub install_app_freebsd_port { }; }; return; -}; +} sub install_app_freebsd_pkg { my ( $info, $app ) = @_; @@ -192,7 +207,7 @@ sub install_app_freebsd_pkg { system "$pkg install -y $app"; return 1 if is_freebsd_port_installed($app); return 0; -}; +} sub install_app_linux { my ($app, $info ) = @_; @@ -209,8 +224,7 @@ sub install_app_linux { warn "no Linux package manager detected\n"; ## no critic (Carp) }; return; -}; - +} sub install_module { @@ -231,7 +245,7 @@ sub install_module { install_module_cpan($module, $version); return; -}; +} sub install_module_cpan { @@ -318,7 +332,7 @@ sub install_module_freebsd_pkg { print "installing $module\n"; system "$pkg install -y $module"; return is_freebsd_port_installed($module); -}; +} sub is_freebsd_port_installed { my ( $module, $portname ) = @_; @@ -337,14 +351,14 @@ sub is_freebsd_port_installed { } return 0; -}; +} sub get_freebsd_pkg_info { if ( -x '/usr/sbin/pkg_info' ) { return '/usr/sbin/pkg_info'; }; return; -}; +} sub get_freebsd_pkgng { my $pkg = '/usr/local/sbin/pkg'; # port version is likely newest @@ -354,7 +368,7 @@ sub get_freebsd_pkgng { return 0; } return $pkg; -}; +} sub install_module_linux { my ($module, $info, $version) = @_; @@ -368,7 +382,7 @@ sub install_module_linux { } warn "no Linux package manager detected\n"; ## no critic (Carp) return; -}; +} sub install_module_linux_yum { my ($module, $info) = @_; @@ -382,7 +396,7 @@ sub install_module_linux_yum { }; system "/usr/bin/yum -y install $package"; return; -}; +} sub install_module_linux_apt { my ($module, $info) = @_; @@ -396,7 +410,7 @@ sub install_module_linux_apt { }; system "/usr/bin/apt-get -y install $package"; return; -}; +} sub get_cpan_config { @@ -407,41 +421,45 @@ sub get_cpan_config { my $make = `which make`; chomp $make; ## no critic (Backtick) my $wget = `which wget`; chomp $wget; ## no critic (Backtick) - return -{ - 'build_cache' => q[10], - 'build_dir' => qq[$ENV{HOME}/.cpan/build], - 'cache_metadata' => q[1], - 'cpan_home' => qq[$ENV{HOME}/.cpan], - 'ftp' => $ftp, - 'ftp_proxy' => q[], - 'getcwd' => q[cwd], - 'gpg' => q[], - 'gzip' => $gzip, - 'histfile' => qq[$ENV{HOME}/.cpan/histfile], - 'histsize' => q[100], - 'http_proxy' => q[], - 'inactivity_timeout' => q[5], - 'index_expire' => q[1], - 'inhibit_startup_message' => q[1], - 'keep_source_where' => qq[$ENV{HOME}/.cpan/sources], - 'lynx' => q[], - 'make' => $make, - 'make_arg' => q[], - 'make_install_arg' => q[], - 'makepl_arg' => q[], - 'ncftp' => q[], - 'ncftpget' => q[], - 'no_proxy' => q[], - 'pager' => q[less], - 'prerequisites_policy' => q[follow], - 'scan_cache' => q[atstart], - 'shell' => q[/bin/csh], - 'tar' => $tar, - 'term_is_latin' => q[1], - 'unzip' => $unzip, - 'urllist' => [ 'http://www.perl.com/CPAN/', 'http://mirrors.kernel.org/pub/CPAN/', 'ftp://cpan.cs.utah.edu/pub/CPAN/', 'ftp://mirrors.kernel.org/pub/CPAN', 'ftp://osl.uoregon.edu/CPAN/', 'http://cpan.yahoo.com/', 'ftp://ftp.funet.fi/pub/languages/perl/CPAN/' ], - 'wget' => $wget, }; + return { + 'build_cache' => q[10], + 'build_dir' => qq[$ENV{HOME}/.cpan/build], + 'cache_metadata' => q[1], + 'cpan_home' => qq[$ENV{HOME}/.cpan], + 'ftp' => $ftp, + 'ftp_proxy' => q[], + 'getcwd' => q[cwd], + 'gpg' => q[], + 'gzip' => $gzip, + 'histfile' => qq[$ENV{HOME}/.cpan/histfile], + 'histsize' => q[100], + 'http_proxy' => q[], + 'inactivity_timeout' => q[5], + 'index_expire' => q[1], + 'inhibit_startup_message' => q[1], + 'keep_source_where' => qq[$ENV{HOME}/.cpan/sources], + 'lynx' => q[], + 'make' => $make, + 'make_arg' => q[], + 'make_install_arg' => q[], + 'makepl_arg' => q[], + 'ncftp' => q[], + 'ncftpget' => q[], + 'no_proxy' => q[], + 'pager' => q[less], + 'prerequisites_policy' => q[follow], + 'scan_cache' => q[atstart], + 'shell' => q[/bin/csh], + 'tar' => $tar, + 'term_is_latin' => q[1], + 'unzip' => $unzip, + 'urllist' => [ 'http://www.perl.com/CPAN/', 'http://mirrors.kernel.org/pub/CPAN/', + 'ftp://cpan.cs.utah.edu/pub/CPAN/', 'ftp://mirrors.kernel.org/pub/CPAN', + 'ftp://osl.uoregon.edu/CPAN/', 'http://cpan.yahoo.com/', + 'ftp://ftp.funet.fi/pub/languages/perl/CPAN/' + ], + 'wget' => $wget, + }; } sub name_overrides { @@ -461,7 +479,7 @@ sub name_overrides { my ($match) = grep { $_->{module} eq $mod } @modules; return $match if $match; return { module=>$mod, info => { } }; -}; +} __END__ @@ -481,4 +499,4 @@ =head1 AUTHORS =back -=cut \ No newline at end of file +=cut