summaryrefslogtreecommitdiffstats
path: root/php-psr-http-factory.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-psr-http-factory.spec')
-rw-r--r--php-psr-http-factory.spec111
1 files changed, 111 insertions, 0 deletions
diff --git a/php-psr-http-factory.spec b/php-psr-http-factory.spec
new file mode 100644
index 0000000..919eca2
--- /dev/null
+++ b/php-psr-http-factory.spec
@@ -0,0 +1,111 @@
+# remirepo/fedora spec file for php-psr-http-factory
+#
+# Copyright (c) 2018 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/4.0/
+#
+# Please, preserve the changelog entries
+#
+
+%global gh_commit 378bfe27931ecc54ff824a20d6f6bfc303bbd04c
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner php-fig
+%global gh_project http-factory
+
+%global pk_vendor psr
+%global pk_project %{gh_project}
+
+Name: php-%{pk_vendor}-%{pk_project}
+Version: 1.0.0
+Release: 1%{?dist}
+Summary: Common interfaces for PSR-7 HTTP message factories
+
+License: MIT
+URL: https://github.com/%{gh_owner}/%{gh_project}
+Source0: %{url}/archive/%{gh_commit}/%{name}-%{version}-%{gh_commit}.tar.gz
+
+BuildArch: noarch
+# For tests
+BuildRequires: php(language) >= 7
+# remirepo:1
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(psr/http-message) >= 1.0 with php-composer(psr/http-message) < 2)
+# remirepo:3
+%else
+BuildRequires: php-psr-http-message
+%endif
+BuildRequires: php-cli
+BuildRequires: php-fedora-autoloader-devel
+
+# From composer.json, "require": {
+# "php": ">=7.0.0",
+# "psr/http-message": "^1.0"
+Requires: php(language) >= 7
+# remirepo:1
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(psr/http-message) >= 1.0 with php-composer(psr/http-message) < 2)
+# remirepo:3
+%else
+Requires: php-psr-http-message
+%endif
+# phpcompatinfo (computed from version 1.0.0)
+# <none>
+# Autoloader
+Requires: php-composer(fedora/autoloader)
+
+# Composer
+Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version}
+
+
+%description
+This package holds all interfaces related to
+PSR-17 (HTTP Message Factories).
+
+Please refer to the specification for a description:
+https://www.php-fig.org/psr/psr-17/
+
+
+Autoloader: %{_datadir}/php/Psr/Http/Message/%{pk_project}-autoload.php
+
+
+%prep
+%setup -qn %{gh_project}-%{gh_commit}
+
+
+%build
+: Generate autoloader
+%{_bindir}/phpab --template fedora --output src/%{pk_project}-autoload.php src
+
+cat << 'EOF' | tee -a src/%{pk_project}-autoload.php
+\Fedora\Autoloader\Dependencies::required(array(
+ '%{_datadir}/php/Psr/Http/Message/autoload.php',
+));
+EOF
+
+
+%install
+mkdir -p %{buildroot}%{_datadir}/php/Psr/Http
+cp -rp src %{buildroot}%{_datadir}/php/Psr/Http/Message
+
+
+%check
+: Test autoloader
+php -nr '
+require "%{buildroot}%{_datadir}/php/Psr/Http/Message/%{pk_project}-autoload.php";
+exit (interface_exists("Psr\\Http\\Message\\RequestFactoryInterface") ? 0 : 1);
+'
+
+
+%files
+# remirepo:1
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc *.md
+%doc composer.json
+%{_datadir}/php/Psr/Http/Message/*php
+
+
+%changelog
+* Thu Dec 13 2018 Remi Collet <remi@remirepo.net> - 1.0.0-1
+- Initial package, version 1.0.0
+