# Source0-md5: 2ef9a089aa9aae9899b4ab785ef873c3
Patch0: paths.patch
Patch1: phpmailer-update-et.patch
+Patch2: tests.patch
URL: http://code.google.com/a/apache-extras.org/p/phpmailer/
BuildRequires: rpm-php-pearprov >= 4.4.2-11
-BuildRequires: rpmbuild(macros) >= 1.520
+BuildRequires: rpmbuild(macros) >= 1.553
Requires: php-common >= 4:%{php_min_version}
Requires: php-date
Requires: php-pcre
%setup -q -n PHPMailer_%{version}
%patch0 -p1
%patch1 -p1
+%patch2 -p1
-find '(' -name '*.php' -o -name '*.html' -o -name '*.txt' ')' -print0 | xargs -0 %{__sed} -i -e 's,\r$,,'
-%{__sed} -i -e 's,\r$,,' README LICENSE
+%undos -f php,html,txt README LICENSE
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_appdir}/language
-cp -a class.phpmailer.php $RPM_BUILD_ROOT%{php_data_dir}
+cp -p class.phpmailer.php $RPM_BUILD_ROOT%{php_data_dir}
# plugins: for smtp and pop before smtp auth
-cp -a class.{smtp,pop3}.php $RPM_BUILD_ROOT%{_appdir}
+cp -p class.{smtp,pop3}.php $RPM_BUILD_ROOT%{_appdir}
# language: translations of error messages
-cp -a language/*.php $RPM_BUILD_ROOT%{_appdir}/language
+cp -p language/*.php $RPM_BUILD_ROOT%{_appdir}/language
# examples
install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
--- /dev/null
+--- PHPMailer_5.2.1/test/phpmailerTest.php~ 2012-04-22 14:55:00.201857103 +0300
++++ PHPMailer_5.2.1/test/phpmailerTest.php 2012-04-22 14:54:00.232668489 +0300
+@@ -13,7 +13,6 @@
+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
+ */
+
+-require 'PHPUnit/Framework.php';
+
+ $INCLUDE_DIR = "../";
+
+@@ -146,7 +145,7 @@
+ $ReportBody .= "---------------------" . $eol;
+ $ReportBody .= "Unit Test Information" . $eol;
+ $ReportBody .= "---------------------" . $eol;
+- $ReportBody .= "phpmailer version: " . PHPMailer::VERSION . $eol;
++ $ReportBody .= "phpmailer version: " . $this->Mail->Version . $eol;
+ $ReportBody .= "Content Type: " . $this->Mail->ContentType . $eol;
+
+ if(strlen($this->Mail->Host) > 0)
+@@ -637,7 +636,6 @@
+ $this->Mail->CreateHeader();
+ $this->assertFalse($this->Mail->set('x', 'y'), 'Invalid property set succeeded');
+ $this->assertTrue($this->Mail->set('Timeout', 11), 'Valid property set failed');
+- $this->Mail->getFile(__FILE__);
+ }
+ }
+