[packages/php-phpmailer] fix syntax linting for various php versions

glen glen at pld-linux.org
Fri Sep 4 11:40:24 CEST 2015


commit 253bd29fbfd406efab618bb431505ac7c23d472b
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Sep 4 12:39:36 2015 +0300

    fix syntax linting for various php versions

 php-phpmailer.spec | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)
---
diff --git a/php-phpmailer.spec b/php-phpmailer.spec
index 451c3ef..4944cef 100644
--- a/php-phpmailer.spec
+++ b/php-phpmailer.spec
@@ -75,15 +75,29 @@ Dokumentacja do %{name}.
 %prep
 %setup -q -n PHPMailer-%{version}%{?subver:-%{subver}}
 
-%if "%{pld_release}" == "ac"
-# requires php5.3
-rm test/bootstrap.php
-%endif
-
 %build
 # syntax lint
-for a in $(find -name '*.php' -o -name '*.inc'); do
-	php -n -l $a
+for f in $(find -name '*.php' -o -name '*.inc'); do
+
+%if "%{php_major_version}.%{php_minor_version}" < "5.4"
+	case $(basename $f) in
+	class.oauth.php|get_oauth_token.php)
+		# needs php 5.4
+		continue
+	;;
+	esac
+%endif
+
+%if "%{php_major_version}.%{php_minor_version}" < "5.3"
+	case $(basename $f) in
+	bootstrap.php|phpmailerTest.php)
+		# needs php 5.3
+		continue
+	;;
+	esac
+%endif
+
+	%{__php} -n -l $f
 done
 
 %if %{with tests}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php-phpmailer.git/commitdiff/db04397e96f185723f6031e444dd5d3b231cf47a



More information about the pld-cvs-commit mailing list