summaryrefslogtreecommitdiffstats
path: root/php-mongodb.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-mongodb.spec')
-rw-r--r--php-mongodb.spec41
1 files changed, 13 insertions, 28 deletions
diff --git a/php-mongodb.spec b/php-mongodb.spec
index 166ea37..90513eb 100644
--- a/php-mongodb.spec
+++ b/php-mongodb.spec
@@ -14,10 +14,8 @@
# Upstream only support 64bits, see https://jira.mongodb.org/browse/CDRIVER-1186
# Server only available on LE arch (ExcludeArch: ppc ppc64 %{sparc} s390 s390x)
%global with_tests 0%{?_with_tests:1}
-# remirepo:3
-%if 0%{?fedora} >= 21 || 0%{?rhel} >= 6
+# remirepo:1
%global with_tests 0%{!?_without_tests:1}
-%endif
%global psr0 MongoDB
#global prever beta2
@@ -26,7 +24,7 @@ Version: 1.1.2
%if 0%{?gh_date}
Release: 0.2.%{gh_date}git%{gh_short}%{?dist}
%else
-Release: 1%{?dist}
+Release: 2%{?dist}
%endif
Summary: MongoDB driver library
@@ -38,7 +36,6 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
# Autoloader
Source1: %{name}-autoload.php
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%if %{with_tests}
BuildRequires: php(language) >= 5.4
@@ -94,7 +91,6 @@ cp %{SOURCE1} src/autoload.php
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{_datadir}/php
cp -pr src %{buildroot}%{_datadir}/php/%{psr0}
@@ -105,7 +101,7 @@ cp -pr src %{buildroot}%{_datadir}/php/%{psr0}
mkdir dbtest
: Choose a port to allow parallel build
-port=$(php -r 'echo (27010+PHP_INT_SIZE);')
+port=$(php -r 'echo (27010+PHP_INT_SIZE+%{?fedora}%{?rhel});')
mongod \
--journal \
@@ -125,37 +121,23 @@ require_once '%{buildroot}%{_datadir}/php/%{psr0}/autoload.php';
EOF
: Run the test suite
-RET=0
-# remirepo:10
-run=0
-if which php56; then
- php56 %{_bindir}/phpunit --verbose || RET=1
- run=1
-fi
-if which php71; then
- php71 %{_bindir}/phpunit --verbose || RET=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit --verbose || RET=1
-# remirepo:1
-fi
+ret=0
+for cmd in php php56 php70 php71 php72; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit --verbose || ret=1
+ fi
+done
: Cleanup
[ -s server.pid ] && kill $(cat server.pid)
-exit $RET
+exit $ret
%else
: Test suite disabled
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc composer.json
@@ -165,6 +147,9 @@ rm -rf %{buildroot}
%changelog
+* Sun May 14 2017 Remi Collet <remi@remirepo.net> - 1.1.2-2
+- ensure fedora/autoloader is used
+
* Fri Feb 17 2017 Remi Collet <remi@remirepo.net> - 1.1.2-1
- update to 1.1.2