diff options
-rw-r--r-- | php-mongodb-autoload.patch | 13 | ||||
-rw-r--r-- | php-mongodb.spec | 29 |
2 files changed, 36 insertions, 6 deletions
diff --git a/php-mongodb-autoload.patch b/php-mongodb-autoload.patch new file mode 100644 index 0000000..df451b1 --- /dev/null +++ b/php-mongodb-autoload.patch @@ -0,0 +1,13 @@ +diff -up tests/PedantryTest.php.rpm tests/PedantryTest.php +--- tests/PedantryTest.php.rpm 2015-11-02 17:58:41.319791130 +0100 ++++ tests/PedantryTest.php 2015-11-02 17:58:45.599811089 +0100 +@@ -65,6 +65,9 @@ class PedantryTest extends \PHPUnit_Fram + if ($file->getFilename() === 'functions.php') { + continue; + } ++ if ($file->getFilename() === 'autoload.php') { ++ continue; ++ } + + $classNames[][] = 'MongoDB\\' . str_replace(DIRECTORY_SEPARATOR, '\\', substr($file->getRealPath(), strlen($srcDir) + 1, -4)); + } diff --git a/php-mongodb.spec b/php-mongodb.spec index 561f0c7..2d4c791 100644 --- a/php-mongodb.spec +++ b/php-mongodb.spec @@ -6,20 +6,26 @@ # # Please, preserve the changelog entries # -%global gh_commit 39cb5bf858b7989f16b4f1c960f08fb4349fa666 +%global gh_commit a3c0b97b23ea8b111e332055cfd5d072312fd9e1 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner mongodb -#global gh_date 20150820 +%global gh_date 20151102 %global gh_project mongo-php-library -# Test suite not ready -# see https://github.com/mongodb/mongo-php-library/issues/41 +%if 0%{?fedora} >= 21 || 0%{?rhel} >= 6 +%global with_tests 0%{!?_without_tests:1} +%else %global with_tests 0%{?_with_tests:1} +%endif %global psr0 MongoDB -%global prever alpha1 +#global prever alpha1 Name: php-%{gh_owner} Version: 1.0.0 +%if 0%{?gh_date} +Release: 0.2.%{gh_date}git%{gh_short}%{?dist} +%else Release: 0.1.%{prever}%{?dist} +%endif Summary: MongoDB driver library Group: Development/Libraries @@ -29,6 +35,7 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit # Autoloader Source1: %{name}-autoload.php +Patch0: %{name}-autoload.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -38,7 +45,7 @@ BuildRequires: php-reflection BuildRequires: php-spl BuildRequires: php-pecl(mongodb) BuildRequires: php-composer(phpunit/phpunit) -BuildRequires: mongodb-server +BuildRequires: mongodb-server >= 2.4 # For autoloader BuildRequires: php-composer(symfony/class-loader) %endif @@ -76,6 +83,7 @@ To use this library, you just have to add, in your project: %setup -q -n %{gh_project}-%{gh_commit} cp %{SOURCE1} src/autoload.php +%patch0 -p0 %build @@ -92,13 +100,19 @@ cp -pr src %{buildroot}%{_datadir}/php/%{psr0} %if %{with_tests} : Run a server mkdir dbtest + +: Choose a port to allow parallel build +port=$(php -r 'echo (27010+PHP_INT_SIZE);') + mongod \ --journal \ --logpath $PWD/server.log \ --pidfilepath $PWD/server.pid \ --dbpath $PWD/dbtest \ + --port $port \ --fork +sed -e "s/27017/$port/" phpunit.xml.dist >phpunit.xml cat << 'EOF' | tee tests/bootstrap.php <?php // Library @@ -140,5 +154,8 @@ rm -rf %{buildroot} %changelog +* Mon Nov 2 2015 Remi Collet <remi@fedoraproject.org> - 1.0.0-0.2.20151102gita3c0b97 +- git snapshot + * Sat Oct 31 2015 Remi Collet <remi@fedoraproject.org> - 1.0.0-0.1.alpha1 - initial package
\ No newline at end of file |