summaryrefslogtreecommitdiffstats
path: root/php-mcnetic-zipstreamer.spec
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-01-08 12:23:23 +0100
committerRemi Collet <fedora@famillecollet.com>2016-01-08 12:23:23 +0100
commit78e6d4f46b30cc87252275ed81099e634d5e7017 (patch)
treec58a72bde521c0c8b7444bb696bd8425dd24b5f1 /php-mcnetic-zipstreamer.spec
php-mcnetic-zipstreamer: 1.7, new package
Diffstat (limited to 'php-mcnetic-zipstreamer.spec')
-rw-r--r--php-mcnetic-zipstreamer.spec121
1 files changed, 121 insertions, 0 deletions
diff --git a/php-mcnetic-zipstreamer.spec b/php-mcnetic-zipstreamer.spec
new file mode 100644
index 0000000..420442d
--- /dev/null
+++ b/php-mcnetic-zipstreamer.spec
@@ -0,0 +1,121 @@
+# remirepo/fedora spec file for php-mcnetic-zipstreamer
+#
+# Copyright (c) 2016 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/4.0/
+#
+# Please, preserve the changelog entries
+#
+%global gh_commit 44c99c659abf4dac92882437c1da68de824ca9d0
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner McNetic
+%global gh_project PHPZipStreamer
+%global with_tests 0%{!?_without_tests:1}
+%global namespace ZipStreamer
+
+Name: php-mcnetic-zipstreamer
+Version: 1.7
+Release: 1%{?dist}
+Summary: Stream zip files without i/o overhead
+
+Group: Development/Libraries
+License: GPLv3+
+URL: https://github.com/%{gh_owner}/%{gh_project}
+Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
+
+# See https://github.com/McNetic/PHPZipStreamer/issues/29
+Patch1: %{name}-warn.patch
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch: noarch
+BuildRequires: php-composer(theseer/autoload)
+%if %{with_tests}
+BuildRequires: php(language) >= 5.3.0
+BuildRequires: php-date
+BuildRequires: php-hash
+BuildRequires: php-mbstring
+BuildRequires: php-pcre
+BuildRequires: php-spl
+BuildRequires: php-composer(phpunit/phpunit)
+BuildRequires: php-pecl(Xdebug)
+BuildRequires: php-pecl(pecl_http)
+%endif
+
+# From composer.json
+# "php": ">=5.3.0"
+Requires: php(language) >= 5.3.0
+# From phpcompatinfo report for version0.7
+Requires: php-date
+Requires: php-hash
+Requires: php-mbstring
+Requires: php-spl
+%if 0%{?fedora} > 21
+# For compression
+Recommends: php-pecl(pecl_http)
+%else
+Requires: php-pecl(pecl_http)
+%endif
+
+Provides: php-composer(mcnetic/zipstreamer) = %{version}
+
+
+%description
+Simple Class to create zip files on the fly and stream directly to the
+HTTP client as the content is added (without using temporary files).
+
+Autoloader: %{_datadir}/php/%{namespace}/autoload.php
+
+
+%prep
+%setup -q -n %{gh_project}-%{gh_commit}
+
+%patch1 -p0 -b .rpm
+find . -name \*.rpm -exec rm {} \;
+
+
+%build
+%{_bindir}/phpab -o src/autoload.php src
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_datadir}/php
+cp -pr src %{buildroot}%{_datadir}/php/%{namespace}
+
+
+%check
+%if %{with_tests}
+
+: Run test suite
+%{_bindir}/phpunit \
+ --bootstrap %{buildroot}%{_datadir}/php/%{namespace}/autoload.php \
+ --configuration test/phpunit.xml
+
+if which php70; then
+ php70 %{_bindir}/phpunit \
+ --bootstrap %{buildroot}%{_datadir}/php/%{namespace}/autoload.php \
+ --configuration test/phpunit.xml
+fi
+%else
+: Test suite disabled
+%endif
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%files
+%defattr(-,root,root,-)
+%{!?_licensedir:%global license %%doc}
+%license COPYING
+%doc *.md
+%doc composer.json
+%{_datadir}/php/%{namespace}
+
+
+%changelog
+* Fri Jan 8 2016 Remi Collet <remi@fedoraproject.org> - 1.7.1
+- initial package
+- add patch to workaround error raised by pecl_http
+ see https://github.com/McNetic/PHPZipStreamer/issues/29 \ No newline at end of file