summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-03-07 12:10:07 +0100
committerRemi Collet <remi@remirepo.net>2019-03-07 12:10:07 +0100
commite49e1e07693f23893718f7abd74de9d4a8d84166 (patch)
tree71eef54a3bbc8d3474e1972023b2a7b14cf44ef1
parentbaed6fec14906e23ff5edaedece69b9f153de144 (diff)
single autoloader
-rw-r--r--php-mock2.spec34
1 files changed, 17 insertions, 17 deletions
diff --git a/php-mock2.spec b/php-mock2.spec
index e8446fa..c0bc237 100644
--- a/php-mock2.spec
+++ b/php-mock2.spec
@@ -15,7 +15,7 @@
Name: php-mock%{major}
Version: 2.1.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: PHP-Mock can mock built-in PHP functions
License: WTFPL
@@ -81,27 +81,27 @@ Autoloader: %{_datadir}/php/phpmock%{major}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
+: Prepare the layout
+mkdir -p rpm/tests rpm/php
+mv classes rpm/php/phpmock%{major}
+mv tests rpm/tests/phpmock%{major}
+
: Create autoloader
-cat << 'AUTOLOAD' | tee classes/autoload.php
+cat << 'AUTOLOAD' | tee rpm/php/phpmock%{major}/autoload.php
<?php
/* Autoloader for %{name} and its dependencies */
require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('phpmock\\', __DIR__);
+\Fedora\Autoloader\Autoload::addPsr4('phpmock\\', dirname(dirname(__DIR__)) . '/tests/phpmock%{major}');
\Fedora\Autoloader\Dependencies::required(array(
'%{_datadir}/php/Text/Template/Autoload.php',
));
AUTOLOAD
+grep -v '<?php' autoload.php >>rpm/php/phpmock%{major}/autoload.php
-cat << 'AUTOLOAD' | tee tests/autoload.php
-<?php
-/* Autoloader for %{name} tests */
+ln -s ../../php/phpmock%{major}/autoload.php rpm/tests/phpmock%{major}/autoload.php
-require_once dirname(dirname(__DIR__)) . '/php/phpmock%{major}/autoload.php';
-\Fedora\Autoloader\Autoload::addPsr4('phpmock\\', __DIR__);
-AUTOLOAD
-
-grep -v '<?php' autoload.php >>tests/autoload.php
%build
@@ -110,12 +110,9 @@ grep -v '<?php' autoload.php >>tests/autoload.php
%install
# Library
-mkdir -p %{buildroot}%{_datadir}/php/
-cp -pr classes %{buildroot}%{_datadir}/php/phpmock%{major}
-
-# Unit tests
-mkdir -p %{buildroot}%{_datadir}/tests
-cp -pr tests %{buildroot}%{_datadir}/tests/phpmock%{major}
+mkdir -p %{buildroot}%{_datadir}
+cp -pr rpm/php %{buildroot}%{_datadir}/php
+cp -pr rpm/tests %{buildroot}%{_datadir}/tests
%check
@@ -125,7 +122,7 @@ ret=0
for cmdarg in "php %{phpunit}" "php70 %{_bindir}/phpunit6" "php71 %{_bindir}/phpunit7" "php72 %{_bindir}/phpunit8" "php73 %{_bindir}/phpunit8"; do
if which $cmdarg; then
set $cmdarg
- $1 $2 --bootstrap %{buildroot}%{_datadir}/tests/phpmock2/autoload.php --verbose || ret=1
+ $1 $2 --bootstrap %{buildroot}%{_datadir}/tests/phpmock2/autoload.php --verbose rpm/tests|| ret=1
fi
done
exit $ret
@@ -144,6 +141,9 @@ exit $ret
%changelog
+* Thu Mar 7 2019 Remi Collet <remi@remirepo.net> - 2.1.0-2
+- single autoloader
+
* Wed Mar 6 2019 Remi Collet <remi@remirepo.net> - 2.1.0-1
- update to 2.1.0