--- /dev/null
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DIST_AUTHOR=PLOBBES
+DIST_VERSION=3.39
+DIST_EXAMPLES=("examples/*")
+inherit perl-module
+
+DESCRIPTION="IMAP client module for Perl"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="test ntlm md5 ssl zlib"
+
+PATCHES=(
+ "${FILESDIR}/${DIST_VERSION}-makefilepl.patch"
+)
+PERL_RM_FILES=(
+ "t/quota.t" # Requires imap server config in test.txt
+ "t/basic.t"
+ "t/pod.t" # Bad author test
+)
+# IO::File, IO::Select, IO::Socket, IO::Socket::INET -> perl-IO
+# Digest::HMAC_MD5 -> Digest-HMAC
+RDEPEND="
+ virtual/perl-Carp
+ virtual/perl-File-Temp
+ >=virtual/perl-IO-1.260.0
+ virtual/perl-Scalar-List-Utils
+ virtual/perl-MIME-Base64
+ >=dev-perl/Parse-RecDescent-1.967.9
+ ntlm? ( dev-perl/Authen-NTLM )
+ md5? (
+ dev-perl/Authen-SASL
+ dev-perl/Digest-HMAC
+ virtual/perl-Digest-MD5
+ )
+ ssl? ( dev-perl/IO-Socket-SSL )
+ zlib? ( virtual/perl-IO-Compress )
+"
+DEPEND="${RDEPEND}
+ virtual/perl-ExtUtils-MakeMaker
+ test? (
+ virtual/perl-Test-Simple
+ )
+"
--- /dev/null
+diff -Naur Mail-IMAPClient-3.38/Makefile.PL Mail-IMAPClient-3.38/Makefile.PL
+--- Mail-IMAPClient-3.38/Makefile.PL
++++ Mail-IMAPClient-3.38/Makefile.PL
+@@ -4,39 +4,6 @@
+
+ use 5.008_001;
+
+-my @missing;
+-my %optional = (
+- "Authen::NTLM" => { for => "Authmechanism 'NTLM'" },
+- "Authen::SASL" => { for => "Authmechanism 'DIGEST-MD5'" },
+- "Compress::Zlib" => { for => "COMPRESS DEFLATE support" },
+- "Digest::HMAC_MD5" => { for => "Authmechanism 'CRAM-MD5'" },
+- "Digest::MD5" => { for => "Authmechanism 'DIGEST-MD5'" },
+- "IO::Socket::SSL" => { for => "SSL enabled connections (Ssl => 1)" },
+- "Test::Pod" => { for => "Pod tests", ver => "1.00" },
+-);
+-
+-foreach my $mod ( sort keys %optional ) {
+- my $for = $optional{$mod}->{"for"} || "";
+- my $ver = $optional{$mod}->{"ver"} || "";
+- eval "use $mod $ver ();";
+- push @missing, $mod . ( $for ? " for $for" : "" ) if $@;
+-}
+-
+-# similar message to one used in DBI:
+-if (@missing) {
+- print( "The following optional modules were not found:",
+- map( "\n\t" . $_, @missing ), "\n" );
+-
+- print <<'MSG';
+-Optional modules are available from any CPAN mirror, reference:
+- http://search.cpan.org/
+- http://www.perl.com/CPAN/modules/by-module
+- http://www.perl.org/CPAN/modules/by-module
+-
+-MSG
+- sleep 3;
+-}
+-
+ # HACK: die on broken Parse::RecDescent 1.966002 through 1.967009
+ # - rt.cpan.org#74593: Recent changes break Module::ExtractUse and ...
+ # - rt.cpan.org#74733: Fails with Parse::RecDescent >= 1.966_002
+@@ -94,45 +61,4 @@
+ clean => { FILES => 'test.txt' },
+ );
+
+-set_test_data();
+-
+ exit 0;
+-
+-###
+-### HELPERS
+-###
+-
+-sub set_test_data {
+- unless ( -f "lib/Mail/IMAPClient.pm" ) {
+- warn("ERROR: not in installation directory\n");
+- return;
+- }
+-
+- if ( -s "./test.txt" ) {
+- print("The file test.txt will be used for extended tests.\n");
+- return;
+- }
+-
+- print <<EOF;
+-
+-(OPTIONAL) For extended tests during 'make test', create a file
+-'test.txt' in the top level directory of this distribution (the same
+-directory as the Makefile.PL, etc.). This file must contain an IMAP
+-server name or IP (server=...), a user account (user=...), and a
+-password (passed=...). A port (port=....) and an authentication
+-mechanism to be used (authmechanism=...) can also be specified.
+-
+-Example:
+-
+---- BEGIN: test.txt ---
+-server=localhost
+-user=mytestuser
+-passed=mypassword
+-port=143
+---- END: test.txt ---
+-
+-NOTE: When testing is completed, be sure to remove test.txt (either by
+-hand or by 'make clean').
+-
+-EOF
+-}