]> git.pld-linux.org Git - packages/php-phpmailer.git/commitdiff
add tests bcond and deps
authorElan Ruusamäe <glen@delfi.ee>
Fri, 4 Sep 2015 09:36:32 +0000 (12:36 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Fri, 4 Sep 2015 09:36:32 +0000 (12:36 +0300)
php-phpmailer.spec

index c93ccf5c2b620dada5593dbd4a6155f93cf2f900..451c3ef84dc885f2b512037c2f32308559ad0fe0 100644 (file)
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_with    tests           # build without tests
+
 %define                pkgname phpmailer
 %define                php_min_version 5.2.4
 %include       /usr/lib/rpm/macros.php
@@ -11,10 +15,15 @@ Group:              Development/Languages/PHP
 Source0:       https://github.com/PHPMailer/PHPMailer/archive/v%{version}/%{pkgname}-%{version}.tar.gz
 # Source0-md5: 5c2d02e6fc4a61c9ba8b20810b564b1c
 URL:           https://github.com/PHPMailer/PHPMailer
-%{?with_tests:BuildRequires:    %{php_name}-cli}
 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)
@@ -77,6 +86,12 @@ for a in $(find -name '*.php' -o -name '*.inc'); do
        php -n -l $a
 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
This page took 0.05134 seconds and 4 git commands to generate.