From 253bd29fbfd406efab618bb431505ac7c23d472b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Fri, 4 Sep 2015 12:39:36 +0300 Subject: [PATCH] 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} -- 2.43.0