]> git.pld-linux.org Git - packages/php-phpmailer.git/blobdiff - php-phpmailer.spec
Version 5.2.18 (December 24th 2016); SECURITY
[packages/php-phpmailer.git] / php-phpmailer.spec
index c93ccf5c2b620dada5593dbd4a6155f93cf2f900..feb38c17847c5dfae224dcfbb15fddbada378635 100644 (file)
@@ -1,20 +1,30 @@
+#
+# Conditional build:
+%bcond_with    tests           # build without tests
+
 %define                pkgname phpmailer
 %define                php_min_version 5.2.4
 %include       /usr/lib/rpm/macros.php
 Summary:       Full featured email transfer class for PHP
 Summary(pl.UTF-8):     W pełni funkcjonalna klasa PHP do przesyłania e-maili
 Name:          php-%{pkgname}
-Version:       5.2.12
+Version:       5.2.18
 Release:       1
 License:       LGPL v2.1
 Group:         Development/Languages/PHP
 Source0:       https://github.com/PHPMailer/PHPMailer/archive/v%{version}/%{pkgname}-%{version}.tar.gz
-# Source0-md5: 5c2d02e6fc4a61c9ba8b20810b564b1c
+# Source0-md5: 68e05bbdd4196920ba6342cc63628ca2
 URL:           https://github.com/PHPMailer/PHPMailer
-%{?with_tests:BuildRequires:    %{php_name}-cli}
+BuildRequires: php-devel
 BuildRequires: php-pear-PhpDocumentor
 BuildRequires: rpm-php-pearprov >= 4.4.2-11
 BuildRequires: rpmbuild(macros) >= 1.663
+%if %{with tests}
+BuildRequires: %{php_name}-cli
+BuildRequires: %{php_name}-mbstring
+BuildRequires: phpunit
+BuildRequires: which
+%endif
 Requires:      php(core) >= %{php_min_version}
 Requires:      php(date)
 Requires:      php(pcre)
@@ -34,7 +44,7 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                _noautophp      php-openssl php-mbstring php-filter php-hash
 
 # bad depsolver
-%define                _noautoreq_pear extras/ntlm_sasl_client.php PHPMailerAutoload.php
+%define                _noautoreq_pear extras/ntlm_sasl_client.php PHPMailerAutoload.php extras/.*
 
 # put it together for rpmbuild
 %define                _noautoreq      %{?_noautophp}
@@ -66,17 +76,37 @@ 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.phpmaileroauthgoogle.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}
+cd test
+%{__php} $(which phpunit) .
+cd -
+%endif
+
 rm -rf phpdoc
 phpdoc --title 'PHPMailer version %{version}' --target phpdoc --defaultpackagename PHPMailer \
        --directory . --ignore test/,examples/,extras/,test_script/,language/,phpdoc/ --sourcecode
@@ -121,9 +151,9 @@ rm -rf $RPM_BUILD_ROOT
 
 %dir %{_appdir}
 %{_appdir}/PHPMailerAutoload.php
-%{_appdir}/class.oauth.php
 %{_appdir}/class.phpmailer.php
 %{_appdir}/class.phpmaileroauth.php
+%{_appdir}/class.phpmaileroauthgoogle.php
 %{_appdir}/class.pop3.php
 %{_appdir}/class.smtp.php
 %dir %{_appdir}/language
This page took 0.131119 seconds and 4 git commands to generate.