summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-06-02 12:54:56 +0200
committerRemi Collet <fedora@famillecollet.com>2015-06-02 12:54:56 +0200
commita4e7876a5ad74d844ceb29fd973d2a83cfb5f4d9 (patch)
tree1ef1a846056184cf897695fa087467726af8fdbd
parente89f311490c3caa5dadadf1361fc0f58093fd6fc (diff)
glpi-webservices: duplicate for 0.85
-rw-r--r--php-guzzlehttp-streams.spec57
1 files changed, 39 insertions, 18 deletions
diff --git a/php-guzzlehttp-streams.spec b/php-guzzlehttp-streams.spec
index 59b0a4c..36c62e2 100644
--- a/php-guzzlehttp-streams.spec
+++ b/php-guzzlehttp-streams.spec
@@ -1,3 +1,4 @@
+# remirepo spec file for php-guzzlehttp-streams, from Fedora:
#
# RPM spec file for php-guzzlehttp-streams
#
@@ -23,12 +24,11 @@
# Build using "--without tests" to disable tests
%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
-%{!?phpdir: %global phpdir %{_datadir}/php}
-%{!?__phpunit: %global __phpunit %{_bindir}/phpunit}
+%{!?phpdir: %global phpdir %{_datadir}/php}
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 1%{?github_release}%{?dist}
+Release: 2%{?github_release}%{?dist}
Summary: Provides a simple abstraction over streams of data
Group: Development/Libraries
@@ -43,14 +43,17 @@ Patch0: %{name}-ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
+# Tests
%if %{with_tests}
-# composer.json
+## composer.json
+BuildRequires: %{_bindir}/phpunit
BuildRequires: php(language) >= %{php_min_ver}
-BuildRequires: %{__phpunit}
-# phpcompatinfo (computed from version 3.0.0)
+## phpcompatinfo (computed from version 3.0.0)
BuildRequires: php-hash
BuildRequires: php-spl
BuildRequires: php-zlib
+## Autoloader
+BuildRequires: php-composer(symfony/class-loader) >= 2.5
%endif
# composer.json
@@ -58,6 +61,8 @@ Requires: php(language) >= %{php_min_ver}
# phpcompatinfo (computed from version 3.0.0)
Requires: php-hash
Requires: php-spl
+# Autoloader
+Requires: php-composer(symfony/class-loader) >= 2.5
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
@@ -70,35 +75,48 @@ Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
%patch0 -p1 -b .ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f
+: Create autoloader
+(cat <<'AUTOLOAD'
+<?php
+/**
+ * Autoloader created by %{name}-%{version}-%{release}
+ */
+
+if (!class_exists('Symfony\\Component\\ClassLoader\\Psr4ClassLoader', false)) {
+ require_once 'Symfony/Component/ClassLoader/Psr4ClassLoader.php';
+}
+
+$loader = new \Symfony\Component\ClassLoader\Psr4ClassLoader();
+$loader->addPrefix('GuzzleHttp\\Stream', __DIR__);
+$loader->register();
+AUTOLOAD
+) | tee src/autoload.php
+
%build
# Empty build section, nothing required
%install
+rm -rf %{buildroot}
+
mkdir -p %{buildroot}%{phpdir}/GuzzleHttp/Stream
cp -pr src/* %{buildroot}%{phpdir}/GuzzleHttp/Stream/
%check
%if %{with_tests}
-# Create autoloader
-mkdir vendor
-cat > vendor/autoload.php <<'AUTOLOAD'
-<?php
-
-spl_autoload_register(function ($class) {
- $src = str_replace(array('\\', '_'), '/', $class).'.php';
- @include_once $src;
-});
-AUTOLOAD
-
-%{__phpunit} --include-path="%{buildroot}%{phpdir}"
+%{_bindir}/phpunit -v \
+ --bootstrap %{buildroot}%{phpdir}/GuzzleHttp/Stream/autoload.php
%else
: Tests skipped
%endif
+%clean
+rm -rf %{buildroot}
+
+
%files
%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
@@ -110,6 +128,9 @@ AUTOLOAD
%changelog
+* Mon Jun 01 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 3.0.0-2
+- Added autoloader
+
* Sun Feb 08 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 3.0.0-1
- Updated to 3.0.0 (BZ #1131103)