From 950a4fbfe6b3e57c4b3311896844b984ecbb6470 Mon Sep 17 00:00:00 2001 From: lars Date: Thu, 2 Oct 2008 01:29:56 +0000 Subject: [PATCH] release preparations for Mail::Ezmlm package: * update Changes * add version test for ezmlm-make to the Makefile * add configuration for gpg-ezmlm and gpg locations to the Makefile --- Ezmlm/trunk/Changes | 7 +-- Ezmlm/trunk/Makefile.PL | 105 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 106 insertions(+), 6 deletions(-) diff --git a/Ezmlm/trunk/Changes b/Ezmlm/trunk/Changes index 04fd9e9..14b5212 100644 --- a/Ezmlm/trunk/Changes +++ b/Ezmlm/trunk/Changes @@ -50,8 +50,9 @@ Revision history for Perl extension Mail::Ezmlm. 0.07.2 Tue Jun 20 01:05:56 UTC 2006 - fixed 'get_charset' and 'set_charset' for idx < 5.0 -0.08 +0.08 Thu Oct 2 03:23:06 CEST 2008 - fixed handling of the 'owner' setting for ezmlm-idx > v5 - - better ezmlm-idx version detection - - admit "@" in the path of a mailing list + - updated ezmlm-idx version detection + - allow "@" in the path of a mailing list + - add modules Mail::Ezmlm::GpgKeyRing and Mail::Ezmlm::GpgEzmlm diff --git a/Ezmlm/trunk/Makefile.PL b/Ezmlm/trunk/Makefile.PL index d28f315..e591cac 100644 --- a/Ezmlm/trunk/Makefile.PL +++ b/Ezmlm/trunk/Makefile.PL @@ -7,13 +7,15 @@ WriteMakefile( 'CONFIGURE' => \&set_paths, 'NAME' => 'Mail::Ezmlm', 'VERSION_FROM' => 'Ezmlm.pm', # finds $VERSION + 'PREREQ_PM' => { 'File::Copy' => 0, 'Crypt::GPG' => 0 }, 'DISTNAME' => 'Ezmlm', 'dist' => { COMPRESS => 'gzip', SUFFIX => 'gz' }, 'clean' => { FILES => 'ezmlmtmp' } ); sub set_paths { - my($qmail_path, $ezmlm_path); + my ($qmail_path, $ezmlm_path, $gpg_ezmlm_path, $gpg_ezmlm_requested); + my ($gpg_bin, $gpg_bin_requested); # special case to handle the FreeBSD ports system if ($ENV{BSD_BATCH_INSTALL}) { @@ -53,6 +55,10 @@ EOM unless (-e "$ezmlm_path/ezmlm-make") { print STDERR "Warning: No correct input after $_ attempts. Continuing with warnings ...\n"; } + unless (system(("$ezmlm_path/ezmlm-make", "-V")) == 0) { + print STDERR "Warning: your version of ezmlm-make does not support the '-V' argument. Please upgrade to ezmlm-idx v0.400 or above.\n"; + } + print << 'EOM'; @@ -71,6 +77,60 @@ EOM print STDERR "Warning: No correct input after $_ attempts. Continuing with warnings ...\n"; } + + # check if gpg-ezmlm is installed (for Mail::Ezmlm::GpgEzmlm) + $gpg_ezmlm_requested = prompt('Is gpg-ezmlm installed for encrypted mailing list support? (y/N)', "n"); + $gpg_ezmlm_requested = ($gpg_ezmlm_requested =~ /^y/i); + if ($gpg_ezmlm_requested) { + undef $gpg_ezmlm_path; + foreach ('/usr/local/bin', '/usr/bin', '/usr/local/bin/gpg-ezmlm', + '/usr/bin/gpg-ezmlm') { + if (-e "$_/gpg-ezmlm-manage.pl") { + $gpg_ezmlm_path = $_; + last; + } + } + $gpg_ezmlm_path = '/usr/bin' unless (defined($gpg_ezmlm_path)); + # ask the user to confirm our guessing + foreach (1..10) { + $gpg_ezmlm_path = prompt('gpg-ezmlm installation directory?', + "$gpg_ezmlm_path"); + last if (-e "$gpg_ezmlm_path/gpg-ezmlm-manage.pl"); + print "I can't find $gpg_ezmlm_path/gpg-ezmlm-manage.pl. " + . "Please try again\n"; + } + unless (-e "$gpg_ezmlm_path/gpg-ezmlm-manage.pl") { + print STDERR "Warning: No correct input after $_ attempts. " + . "Continuing with warnings ...\n"; + } + } + + # check if gpg is installed (for Mail::Ezmlm::GpgKeyRing) + $gpg_bin_requested = prompt('Is gnupg installed (for keyring support in encrypted mailing lists)? (y/N)', "n"); + $gpg_bin_requested = ($gpg_bin_requested =~ /^y/i); + if ($gpg_bin_requested) { + undef $gpg_bin; + foreach ('/usr/local/bin/gpg', '/usr/bin/gpg', '/bin/gpg', + '/usr/local/bin/gpg2', '/usr/bin/gpg2', '/bin/gpg2') { + if (-x "$_") { + $gpg_bin = $_; + last; + } + } + $gpg_bin = '/usr/bin' unless (defined($gpg_bin)); + # ask the user to confirm our guessing + foreach (1..10) { + $gpg_bin = prompt('Path to the gpg or gpg2 binary?', "$gpg_bin"); + last if (-x "$gpg_bin"); + print "I can't find $gpg_bin. Please try again\n"; + } + unless (-x "$gpg_bin") { + print STDERR "Warning: No correct input after $_ attempts. " + . "Continuing with warnings ...\n"; + } + } + + # check if mysql support is necessary if(`strings $ezmlm_path/ezmlm-sub | grep -i 'MySQL'`) { print << 'EOM'; @@ -107,12 +167,12 @@ Thank you. I will use this information to configure Mail::Ezmlm for you EOM + # set the variables in Ezmlm.pm # Back up file open(EZMLM, 'Ezmlm.pm.tmp.$$") or die "Unable to create temp file: $!"; while() { print TMP; } close TMP; close EZMLM; - # Do variable substitution open(EZMLM, '>Ezmlm.pm') or die "Unable to open Ezmlm.pm for write: $!"; open(TMP, "Ezmlm/GpgEzmlm.pm.tmp.$$") or die "Unable to create temp file: $!"; + while() { print TMP; } + close TMP; close GPGEZMLM; + # Do variable substitution + open(GPGEZMLM, '>Ezmlm/GpgEzmlm.pm') + or die "Unable to open Ezmlm/GpgEzmlm.pm for write: $!"; + open(TMP, ") { + s{^\$GPG_EZMLM_BASE\s*=\s*['"].+?['"]\s*;\s*(#.*|)$}{\$GPG_EZMLM_BASE = '$gpg_ezmlm_path'; # Autoinserted by Makefile.PL}; + print GPGEZMLM; + } + close TMP; close GPGEZMLM; + unlink "Ezmlm/GpgEzmlm.pm.tmp.$$"; + } + + # set the variables in GpgKeyRing.pm + if ($gpg_bin_requested) { + # Back up file + open(GPGKEYRING, 'Ezmlm/GpgKeyRing.pm.tmp.$$") or die "Unable to create temp file: $!"; + while() { print TMP; } + close TMP; close GPGKEYRING; + # Do variable substitution + open(GPGKEYRING, '>Ezmlm/GpgKeyRing.pm') or die "Unable to open Ezmlm/GpgKeyRing.pm for write: $!"; + open(TMP, ") { + s{^\$GPG_BIN\s*=\s*['"].+?['"]\s*;\s*(#.*|)$}{\$GPG_BIN = '$gpg_bin'; # Autoinserted by Makefile.PL}; + print GPGKEYRING; + } + close TMP; close GPGKEYRING; + unlink "Ezmlm/GpgKeyRing.pm.tmp.$$"; + } + return {}; }